diff --git a/ruby/lib/jam_ruby/app/mailers/auto_mailer.rb b/ruby/lib/jam_ruby/app/mailers/auto_mailer.rb new file mode 100644 index 000000000..05f144821 --- /dev/null +++ b/ruby/lib/jam_ruby/app/mailers/auto_mailer.rb @@ -0,0 +1,23 @@ +module JamRuby + # UserMailer must be configured to work + # Some common configs occur in jam_ruby/init.rb + # Environment specific configs occur in spec_helper.rb in jam-ruby and jam-web (to put it into test mode), + # and in config/initializers/email.rb in rails to configure sendmail account settings + # If UserMailer were to be used in another project, it would need to be configured there, as well. + + # Templates for UserMailer can be found in jam_ruby/app/views/jam_ruby/user_mailer + class UserMailer < ActionMailer::Base + include SendGrid + + layout "auto_mailer" + + DEFAULT_SENDER = "JamKazam " + + default :from => DEFAULT_SENDER + + sendgrid_category :use_subject_lines + #sendgrid_enable :opentrack, :clicktrack # this makes our emails creepy, imo (seth) + sendgrid_unique_args :env => Environment.mode + + end +end diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.html.erb index fc3c62e31..3c057778d 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.html.erb @@ -8,7 +8,7 @@ <% if @school %>

We hope you enjoyed your TestDrive lesson today with <%= @distribution.student.name %>.

<% else %> -

You have earned $<%= @distribution.real_distribution_display %> for your TestDrive lesson with <%= @distribution.student.name %>.

+

You have earned <%= @distribution.real_distribution_display %> for your TestDrive lesson with <%= @distribution.student.name %>.

<% end %>

<% if !@teacher_payment.teacher.has_rated_student(@distribution.student) %> @@ -20,7 +20,7 @@ <% if @school %>

we hope you enjoyed your lesson today with <%= @distribution.student.name %>.

<% else %> -

You have earned $<%= @distribution.real_distribution_display %> for your lesson with <%= @distribution.student.name %>.

+

You have earned <%= @distribution.real_distribution_display %> for your lesson with <%= @distribution.student.name %>.

<% end %>

<% if !@teacher_payment.teacher.has_rated_student(@distribution.student) %> @@ -32,7 +32,7 @@ <% if @school %>

we hope you enjoyed your <%= @distribution.month_name %> lessons with <%= @distribution.student.name %>.

<% else %> -

You have earned $<%= @distribution.real_distribution_display %> for your <%= @distribution.month_name%> lessons with <%= @distribution.student.name %>.

+

You have earned <%= @distribution.real_distribution_display %> for your <%= @distribution.month_name%> lessons with <%= @distribution.student.name %>.

<% end %>

<% if !@teacher_payment.teacher.has_rated_student(@distribution.student) %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.text.erb index 17ecc5c92..e8ce56e85 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_distribution_done.text.erb @@ -6,7 +6,7 @@ Hello <%= @name %>, <% if @school %> We hope you enjoyed your TestDrive lesson today with <%= @distribution.student.name %>. <% else %> -You have earned $<%= @distribution.amount %> for your TestDrive lesson with <%= @distribution.student.name %>. +You have earned <%= @distribution.real_distribution_display %> for your TestDrive lesson with <%= @distribution.student.name %>. <% end %> <% if !@teacher_payment.teacher.has_rated_student(@distribution.student) %> If you haven't already done so, please rate your student now to help us monitor for any issues with students who may cause issues for our instructor community. <%= @distribution.student.student_ratings_url %> @@ -16,7 +16,7 @@ If you had technical problems during your lesson, or have questions, or would li <% if @school %> We hope you enjoyed your lesson today with <%= @distribution.student.name %>. <% else %> -You have earned $<%= @distribution.amount %> for your lesson with <%= @distribution.student.name %>. +You have earned <%= @distribution.real_distribution_display %>for your lesson with <%= @distribution.student.name %>. <% end %> <% if !@teacher_payment.teacher.has_rated_student(@distribution.student) %> If you haven't already done so, please rate your student now to help us monitor for any issues with students who may cause issues for our instructor community. <%= @distribution.student.student_ratings_url %> @@ -26,7 +26,7 @@ If you had technical problems during your lesson, or have questions, or would li <% if @school %> We hope you enjoyed your <%= @distribution.month_name%> lessons with <%= @distribution.student.name %>. <% else %> -You have earned $<%= @distribution.amount %> for your <%= @distribution.month_name%> lessons with <%= @distribution.student.name %>. +You have earned <%= @distribution.real_distribution_display %>for your <%= @distribution.month_name%> lessons with <%= @distribution.student.name %>. <% end %> <% if !@teacher_payment.teacher.has_rated_student(@distribution.student) %> If you haven't already done so, please rate your student now to help us monitor for any issues with students who may cause issues for our instructor community. <%= @distribution.student.student_ratings_url %> diff --git a/ruby/lib/jam_ruby/models/auto_emailer.rb b/ruby/lib/jam_ruby/models/auto_emailer.rb new file mode 100644 index 000000000..415971666 --- /dev/null +++ b/ruby/lib/jam_ruby/models/auto_emailer.rb @@ -0,0 +1,12 @@ +module JamRuby + class AutoEmailer + + belongs_to :user, class_name: "JamRuby::User" + + def hourly_job + AutoEmailer.where('mailed = false').where("email_at < ", Time.now).each do |auto_emailer| + AutoMailer.public_send(auto_emailer.name.to_sym, auto_emailer) + end + end + end +end \ No newline at end of file diff --git a/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee b/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee index e514796c6..da12cb587 100644 --- a/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/CheckBoxList.js.jsx.coffee @@ -5,6 +5,25 @@ logger = context.JK.logger @CheckBoxList = React.createClass({ objects: [] + componentDidMount: () -> + @root = $(@getDOMNode()) + @wireICheck() + + componentDidUpdate: () -> + @wireICheck() + + wireICheck: () -> + checkBoxes = @root.find('input[type="checkbox"]') + if checkBoxes.length > 0 + context.JK.checkbox(checkBoxes, true) + checkBoxes.on('ifChanged', (e) => @checkIfCanFire(e)) + + checkIfCanFire: (e) -> + if @iCheckIgnore + return + + @onItemChanged() + onItemChanged: (e) -> # e.preventDefault() @@ -25,7 +44,7 @@ logger = context.JK.logger for object in this.props.sourceObjects nm = "check_#{object.id}" checked = @isChecked(object.id) - object_options.push `

` + object_options.push `
` `
diff --git a/web/app/assets/javascripts/react-components/RateUserDialog.js.jsx.coffee b/web/app/assets/javascripts/react-components/RateUserDialog.js.jsx.coffee index 0626fd21e..e460ba4b0 100644 --- a/web/app/assets/javascripts/react-components/RateUserDialog.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/RateUserDialog.js.jsx.coffee @@ -127,7 +127,7 @@ context = window render: () -> submitClasses = classNames({'button-orange': true, disabled: @disabled()}) - if false + if @isRatingTeacher() title = 'Rate Teacher' help = `

Please rate this teacher based on your experience with them:

` descriptionPrompt = `

Please help other students by explaining what you like or don’t like about this teacher:

` diff --git a/web/app/assets/javascripts/react-components/TeacherStudentLevel.js.jsx.coffee b/web/app/assets/javascripts/react-components/TeacherStudentLevel.js.jsx.coffee index 300d0be3f..943c8a6cf 100644 --- a/web/app/assets/javascripts/react-components/TeacherStudentLevel.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/TeacherStudentLevel.js.jsx.coffee @@ -3,6 +3,18 @@ logger = context.JK.logger @TeacherStudentLevel = React.createClass({ + mixens: [ICheckMixin] + + componentDidMount: () -> + @checkboxes = [{selector: 'input.slot-decision', stateKey: 'slot-decision'}] + + @root = $(@getDOMNode()) + + @iCheckify() + + componentDidUpdate: () -> + + @iCheckify() render: () -> ` diff --git a/web/app/assets/javascripts/utils.js b/web/app/assets/javascripts/utils.js index 9a00e241d..a4bb5d3aa 100644 --- a/web/app/assets/javascripts/utils.js +++ b/web/app/assets/javascripts/utils.js @@ -1194,12 +1194,21 @@ return false; } - context.JK.checkbox = function ($checkbox) { - return $checkbox.iCheck({ - checkboxClass: 'icheckbox_minimal', - radioClass: 'iradio_minimal', - inheritClass: true - }); + context.JK.checkbox = function ($checkbox, dark) { + if (dark){ + return $checkbox.iCheck({ + checkboxClass: 'icheckbox_minimal dark', + radioClass: 'iradio_minimal dark', + inheritClass: true + }); + }else { + return $checkbox.iCheck({ + checkboxClass: 'icheckbox_minimal', + radioClass: 'iradio_minimal', + inheritClass: true + }); + } + } context.JK.dropdown = function ($select, options) { diff --git a/web/app/assets/stylesheets/client/jamkazam.css.scss b/web/app/assets/stylesheets/client/jamkazam.css.scss index af954029f..e76647864 100644 --- a/web/app/assets/stylesheets/client/jamkazam.css.scss +++ b/web/app/assets/stylesheets/client/jamkazam.css.scss @@ -611,7 +611,7 @@ hr { text-align:center; } -body.jam .icheckbox_minimal { +body.jam .icheckbox_minimal, .icheckbox_minimal_dark { display:inline-block; position:relative; } diff --git a/web/app/assets/stylesheets/client/react-components/Profile.css.scss b/web/app/assets/stylesheets/client/react-components/Profile.css.scss index f75fa13d0..f14aa6608 100644 --- a/web/app/assets/stylesheets/client/react-components/Profile.css.scss +++ b/web/app/assets/stylesheets/client/react-components/Profile.css.scss @@ -45,6 +45,13 @@ float: left; font-size: 1em; } + .icheckbox_minimal { + color: black; + display: inline; + float: left; + font-size: 1em; + margin-right:5px; + } input { width: auto; text-align: left; diff --git a/web/vendor/assets/stylesheets/icheck/minimal/minimal.css b/web/vendor/assets/stylesheets/icheck/minimal/minimal.css index ffda1e558..b5e2fb9db 100644 --- a/web/vendor/assets/stylesheets/icheck/minimal/minimal.css +++ b/web/vendor/assets/stylesheets/icheck/minimal/minimal.css @@ -11,6 +11,9 @@ border: none; cursor: pointer; } +.icheckbox_minimal.dark { + background: url(/assets/icheck/jamkazam-dark.png) no-repeat; +} .icheckbox_minimal {