added description field to cfps
closes #1650 done some changes minor changes added markdown format to cfp#show fixed description text position in proposals fixed truncated description text in show action minor changes on non-admin side
This commit is contained in:
parent
0e16b5d0ae
commit
bd045c2976
11 changed files with 41 additions and 5 deletions
|
|
@ -55,7 +55,7 @@ module Admin
|
||||||
private
|
private
|
||||||
|
|
||||||
def cfp_params
|
def cfp_params
|
||||||
params.require(:cfp).permit(:start_date, :end_date, :cfp_type)
|
params.require(:cfp).permit(:start_date, :end_date, :description, :cfp_type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@
|
||||||
%dd
|
%dd
|
||||||
= @cfp.end_date.strftime('%A, %B %e. %Y')
|
= @cfp.end_date.strftime('%A, %B %e. %Y')
|
||||||
%dt
|
%dt
|
||||||
Days Left:
|
Description
|
||||||
|
%dd
|
||||||
|
= markdown(@cfp.description)
|
||||||
|
%dt
|
||||||
|
Days Left
|
||||||
%dd
|
%dd
|
||||||
= pluralize(@cfp.remaining_days, 'day')
|
= pluralize(@cfp.remaining_days, 'day')
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
End Date:
|
End Date:
|
||||||
%dd#end_date
|
%dd#end_date
|
||||||
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||||
|
%dt
|
||||||
|
Description:
|
||||||
|
%dd#description
|
||||||
|
= markdown(@cfp.description)
|
||||||
%dt
|
%dt
|
||||||
Days Left:
|
Days Left:
|
||||||
%dd
|
%dd
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,6 @@
|
||||||
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly' }
|
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly' }
|
||||||
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
|
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
|
||||||
= f.input :cfp_type, as: :select, collection: (@cfp.new_record? ? @program.remaining_cfp_types : [@cfp.cfp_type] + @program.remaining_cfp_types).map {|type| ["#{type.capitalize}", type]}, include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
|
= f.input :cfp_type, as: :select, collection: (@cfp.new_record? ? @program.remaining_cfp_types : [@cfp.cfp_type] + @program.remaining_cfp_types).map {|type| ["#{type.capitalize}", type]}, include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
|
||||||
|
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
End Date:
|
End Date:
|
||||||
%dd#end_date
|
%dd#end_date
|
||||||
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||||
|
%dt
|
||||||
|
Description:
|
||||||
|
%dd#description
|
||||||
|
= markdown(@cfp.description)
|
||||||
%dt
|
%dt
|
||||||
Days Left:
|
Days Left:
|
||||||
%dd
|
%dd
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
%th Type
|
%th Type
|
||||||
%th Start Date
|
%th Start Date
|
||||||
%th End Date
|
%th End Date
|
||||||
|
%th Description
|
||||||
%th Days Left
|
%th Days Left
|
||||||
%th Actions
|
%th Actions
|
||||||
%tbody
|
%tbody
|
||||||
|
|
@ -24,6 +25,9 @@
|
||||||
= cfp.start_date.strftime('%A, %B %-d. %Y')
|
= cfp.start_date.strftime('%A, %B %-d. %Y')
|
||||||
%td
|
%td
|
||||||
= cfp.end_date.strftime('%A, %B %-d. %Y')
|
= cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||||
|
%td
|
||||||
|
%p
|
||||||
|
= markdown(truncate(cfp.description))
|
||||||
%td
|
%td
|
||||||
= pluralize(cfp.remaining_days, 'day')
|
= pluralize(cfp.remaining_days, 'day')
|
||||||
%td
|
%td
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,14 @@
|
||||||
%span.notranslate
|
%span.notranslate
|
||||||
= @conference.title
|
= @conference.title
|
||||||
|
|
||||||
|
|
||||||
|
- if @program.cfp_open?
|
||||||
|
- if @program.cfp.description.present?
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= markdown(@program.cfp.description)
|
||||||
|
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= render partial: 'encouragement_text'
|
= render partial: 'encouragement_text'
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,11 @@
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.page-header
|
.page-header
|
||||||
%h1 New Proposal
|
%h1 New Proposal
|
||||||
|
- if @program.cfp_open?
|
||||||
|
- if @program.cfp.description.present?
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= markdown(@program.cfp.description)
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= render partial: 'encouragement_text'
|
= render partial: 'encouragement_text'
|
||||||
|
|
|
||||||
5
db/migrate/20170905110034_add_description_to_cfps.rb
Normal file
5
db/migrate/20170905110034_add_description_to_cfps.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddDescriptionToCfps < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :cfps, :description, :text
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -68,12 +68,13 @@ ActiveRecord::Schema.define(version: 20170924190528) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "cfps", force: :cascade do |t|
|
create_table "cfps", force: :cascade do |t|
|
||||||
t.date "start_date", null: false
|
t.date "start_date", null: false
|
||||||
t.date "end_date", null: false
|
t.date "end_date", null: false
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "program_id"
|
t.integer "program_id"
|
||||||
t.string "cfp_type"
|
t.string "cfp_type"
|
||||||
|
t.text "description"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "comments", force: :cascade do |t|
|
create_table "comments", force: :cascade do |t|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ FactoryGirl.define do
|
||||||
start_date { 1.day.ago }
|
start_date { 1.day.ago }
|
||||||
end_date { 2.days.from_now }
|
end_date { 2.days.from_now }
|
||||||
cfp_type 'events'
|
cfp_type 'events'
|
||||||
|
description 'This is a test description'
|
||||||
program
|
program
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue