Skip to content

Commit

Permalink
add event state visible toggle to conference settings
Browse files Browse the repository at this point in the history
  • Loading branch information
manno committed Oct 13, 2013
1 parent 07cc01d commit 595e643
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
20 changes: 13 additions & 7 deletions app/views/cfp/people/_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
%tr
%th.first
%th= t("activerecord.attributes.event.title")
%th= t("activerecord.attributes.event.state")
- if @conference.event_state_visible
%th= t("activerecord.attributes.event.state")
- if @conference.feedback_enabled
%th
%th= t(:event_feedback)
Expand All @@ -13,7 +14,8 @@
%tr
%td= image_box event.logo, :small
%td= event.title
%td= event.state
- if @conference.event_state_visible
%td= event.state
- if @conference.feedback_enabled
%td
%b= number_with_precision event.average_feedback, :precision => 2
Expand All @@ -22,16 +24,20 @@
s<sub>N-1</sub> = #{event.feedback_standard_deviation} n = #{event.event_feedbacks_count}
%td
= link_to t("edit"), edit_cfp_event_path(event), :class => "btn small"
- if event.state == "unconfirmed"
= link_to t("cfp.confirm"), confirm_cfp_event_path(event), :method => :put, :class => "btn success small"
- if event.transition_possible? :withdrawn and event.start_time and event.start_time > Time.now
= link_to t("cfp.withdraw"), withdraw_cfp_event_path(event), :method => :put, :confirm => t("cfp.withdrawal_confirmation"), :class => "btn danger small"
- if @conference.event_state_visible
- if event.state == "unconfirmed"
= link_to t("cfp.confirm"), confirm_cfp_event_path(event), :method => :put, :class => "btn success small"
- if event.transition_possible? :withdrawn and event.start_time and event.start_time > Time.now
= link_to t("cfp.withdraw"), withdraw_cfp_event_path(event), :method => :put, :confirm => t("cfp.withdrawal_confirmation"), :class => "btn danger small"
- if @conference.feedback_enabled
- event.event_feedbacks.each do |feedback|
- next if feedback.comment.blank?
%tr
%td
%td{:colspan=>2}
- if @conference.event_state_visible
%td{:colspan=>2}
- else
%td
.rating{:id => "event_rating_#{event.id}", :"data-rating" => feedback.rating}
%td= feedback.comment
%td
1 change: 1 addition & 0 deletions app/views/conferences/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
= f.input :max_timeslots, :as => :select, :collection => 1..100, :hint => "What is the maximum length of a single event (e.g. a single talk)?"
= f.input :schedule_version, :hint => "What is the current schedule version?"
= f.input :schedule_public, :hint => "Is the dynamic schedule public? You can still create static exports regardless of this setting."
= f.input :event_state_visible, :as => :boolean, :hint => "If you enable this, speakers will be able to look up the state of their submission in the cfp interface and confirm their attendance by pressing the confirm button."
= dynamic_association :languages, t(:event_languages), f, :hint => "Choose which languages events in this conference can be held in."
= f.inputs t(:static_program_export) do
= f.input :program_export_base_url, :hint => "If you want to use the static program export, enter the URL where you want to put the files under here. All references will be generated using this as a prefix."
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20131013145045_add_event_state_visible_toggle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddEventStateVisibleToggle < ActiveRecord::Migration
def change
add_column :conferences, :event_state_visible, :boolean, default: true
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20130811103746) do
ActiveRecord::Schema.define(:version => 20131013145045) do

create_table "availabilities", :force => true do |t|
t.integer "person_id"
Expand Down Expand Up @@ -56,6 +56,7 @@
t.boolean "schedule_public", :default => false, :null => false
t.string "color"
t.string "ticket_type"
t.boolean "event_state_visible", :default => true
end

add_index "conferences", ["acronym"], :name => "index_conferences_on_acronym"
Expand Down

0 comments on commit 595e643

Please sign in to comment.