Skip to content

Commit

Permalink
Merge 700a269 into 716c426
Browse files Browse the repository at this point in the history
  • Loading branch information
reidab committed Aug 10, 2014
2 parents 716c426 + 700a269 commit 0074fed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 8 additions & 4 deletions app/assets/javascripts/open_conference_ware/proposals.js
Expand Up @@ -76,10 +76,14 @@ function bind_proposal_schedule_controls() {
if(target.parent().find('option:selected[value]').get().length == 3) {

data = {
'authenticity_token': app.authenticity_token,
'start_time[date]': target.parent().find('select.date').attr('value'),
'start_time[hour]': target.parent().find('select.hour').attr('value'),
'start_time[minute]': target.parent().find('select.minute').attr('value')
proposal: {
authenticity_token: app.authenticity_token,
start_time: {
date: target.parent().find('select.date').attr('value'),
hour: target.parent().find('select.hour').attr('value'),
minute: target.parent().find('select.minute').attr('value')
}
}
};
proposal_id = target.parent().attr('id').split('_').pop();
format = 'json';
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/open_conference_ware/proposals_controller.rb
Expand Up @@ -233,11 +233,11 @@ def update
params[:proposal].delete(:title)
end

if params[:start_time] && admin?
if params[:start_time][:date].blank? || params[:start_time][:hour].blank? || params[:start_time][:minute].blank?
if params[:proposal][:start_time] && admin?
if params[:proposal][:start_time][:date].blank? || params[:proposal][:start_time][:hour].blank? || params[:proposal][:start_time][:minute].blank?
@proposal.start_time = nil
else
@proposal.start_time = "#{params[:start_time][:date]} #{params[:start_time][:hour]}:#{params[:start_time][:minute]}"
@proposal.start_time = "#{params[:proposal][:start_time][:date]} #{params[:proposal][:start_time][:hour]}:#{params[:proposal][:start_time][:minute]}"
end
end

Expand All @@ -260,7 +260,7 @@ def update
render(
json: {
proposal_status: @proposal.status,
_transition_control_html: render_to_string(partial: '/proposals/transition_control')
_transition_control_html: render_to_string(partial: '/open_conference_ware/proposals/transition_control', formats: [:html])
},
status: :ok
)
Expand Down Expand Up @@ -434,7 +434,7 @@ def assign_proposal_and_event
end

def assert_user_complete_profile
if user_profiles? and logged_in? and not current_user.complete_profile?
if user_profiles? && logged_in? && !current_user.admin? && !current_user.complete_profile?
current_user.complete_profile = true
if current_user.valid?
current_user.save
Expand Down

0 comments on commit 0074fed

Please sign in to comment.