From 688557b7cbabaed43750640181993230064da008 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Wed, 2 Apr 2014 20:07:42 +0300 Subject: [PATCH] show schedule in home page only if it is set as public --- app/models/call_for_papers.rb | 2 +- app/views/admin/callforpapers/show.html.haml | 1 + app/views/home/index.html.haml | 2 +- .../20140401094729_add_schedule_public_to_call_for_papers.rb | 5 +++++ 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20140401094729_add_schedule_public_to_call_for_papers.rb diff --git a/app/models/call_for_papers.rb b/app/models/call_for_papers.rb index 879cf2fe..10cb7f80 100644 --- a/app/models/call_for_papers.rb +++ b/app/models/call_for_papers.rb @@ -1,5 +1,5 @@ class CallForPapers < ActiveRecord::Base - attr_accessible :start_date, :end_date, :hard_deadline, :description, :schedule_changes, :rating, :rating_desc + attr_accessible :start_date, :end_date, :hard_deadline, :description, :schedule_changes, :rating, :rating_desc, :schedule_public belongs_to :conference validates_presence_of :start_date, :end_date, :hard_deadline diff --git a/app/views/admin/callforpapers/show.html.haml b/app/views/admin/callforpapers/show.html.haml index ab4ba208..7f879e54 100644 --- a/app/views/admin/callforpapers/show.html.haml +++ b/app/views/admin/callforpapers/show.html.haml @@ -8,6 +8,7 @@ = f.input :hard_deadline, :as => :string, :input_html => { :id => "cfp-hard-datepicker", :readonly => "readonly" } = f.input :description, :hint => "Welcome text for the Call for Papers" = f.input :schedule_changes + = f.input :schedule_public = f.input :rating, :hint => "Enter the number of different rating levels you want to have for voting on proposals. Enter 0 if you do not want to vote on proposals." = f.input :rating_desc, :label => "Rating Description", :hint => "Enter comments about voting process.", :input_html => {:value => "1 is for 'I don't like this proposal',\n2 is for 'I am ok with this proposal.',\n3 is for 'I love this proposal!'", :rows => 5, :class => "span6"} = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index b6f27829..a37067c4 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -29,7 +29,7 @@ = link_to "Modify Registration", register_conference_path(conference.short_title), :class =>"btn btn-default" - else = link_to "Register", register_conference_path(conference.short_title), :class =>"btn btn-success" - = link_to "Schedule", conference_schedule_path(conference.short_title), :class =>"btn btn-default" + = link_to "Schedule", conference_schedule_path(conference.short_title), :class =>"btn btn-default" if conference.call_for_papers and conference.call_for_papers.schedule_public - if !current_user.nil? && current_user.person.proposal_count(conference) > 0 = link_to "View My Proposals", conference_proposal_index_path(conference.short_title), :class =>"btn btn-default" - elsif conference.cfp_open? diff --git a/db/migrate/20140401094729_add_schedule_public_to_call_for_papers.rb b/db/migrate/20140401094729_add_schedule_public_to_call_for_papers.rb new file mode 100644 index 00000000..f08d925c --- /dev/null +++ b/db/migrate/20140401094729_add_schedule_public_to_call_for_papers.rb @@ -0,0 +1,5 @@ +class AddSchedulePublicToCallForPapers < ActiveRecord::Migration + def change + add_column :call_for_papers, :schedule_public, :boolean + end +end