From 36c384bd1d3ea375848841a2cff5062d3d849570 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Tue, 5 Jul 2016 18:10:25 +0300 Subject: [PATCH] Reimplement CFP toggling --- .../management/call_for_participations_controller.rb | 4 ++-- app/views/management/conferences/show.html.slim | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/management/call_for_participations_controller.rb b/app/controllers/management/call_for_participations_controller.rb index ced9a29..d7298f6 100644 --- a/app/controllers/management/call_for_participations_controller.rb +++ b/app/controllers/management/call_for_participations_controller.rb @@ -2,12 +2,12 @@ module Management class CallForParticipationsController < ManagementController def create current_conference.call_for_participation.open! - render :redraw + redirect_to :back end def destroy current_conference.call_for_participation.close! - render :redraw + redirect_to :back end end end diff --git a/app/views/management/conferences/show.html.slim b/app/views/management/conferences/show.html.slim index bfcfcfc..e5bbe36 100644 --- a/app/views/management/conferences/show.html.slim +++ b/app/views/management/conferences/show.html.slim @@ -6,7 +6,12 @@ = @conference.title .pull-right = t '.cfp_status' - = render partial: 'management/call_for_participations/status', locals: {conference: @conference} + - if @conference.call_for_participation.in_progress? + = link_to management_conference_call_for_participation_path(@conference), method: :delete, class: 'btn btn-sm btn-success cfp-toggle' + = icon 'dot-circle-o', '', class: 'fa-fw' + - else + = link_to management_conference_call_for_participation_path(@conference), method: :post, class: 'btn btn-sm btn-warning cfp-toggle' + = icon 'circle-o', class: 'fa-fw' .row .col-lg-3.col-md-6 .panel.panel-primary