From 6fa709a4de497a52100d14b458a975a4fe7ca645 Mon Sep 17 00:00:00 2001 From: Adriano Vieira Date: Sun, 12 Nov 2017 01:55:03 -0200 Subject: [PATCH 1/5] Fix to only show speaker email if it's public --- app/views/proposals/show.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/proposals/show.html.haml b/app/views/proposals/show.html.haml index c181e283..19f9371f 100644 --- a/app/views/proposals/show.html.haml +++ b/app/views/proposals/show.html.haml @@ -36,7 +36,8 @@ .col-md-8 %h4 = link_to speaker.name, user_path(speaker.id) - = "(#{speaker.email})" + - if speaker.email_public? + = "(#{speaker.email})" - if speaker.affiliation? .text-muted from From fba12aef24ff3388bb44a29df63e9e3496f8eb0a Mon Sep 17 00:00:00 2001 From: James Mason Date: Sun, 12 Nov 2017 20:43:02 -0800 Subject: [PATCH 2/5] Only include transifex JS if the ENV var is set ... otherwise, don't bother loading this blocking external resource. --- app/views/layouts/application.html.haml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index c1a6ce78..ee88a24c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,15 +9,16 @@ = javascript_include_tag "application" = csrf_meta_tags - :javascript - window.liveSettings = { - api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}", - picker: "bottom-right", - detectlang: true, - autocollect: true - }; = content_for(:script_head) - = javascript_include_tag "//cdn.transifex.com/live.js" + - if ENV['OSEM_TRANSIFEX_APIKEY'] + :javascript + window.liveSettings = { + api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}", + picker: "bottom-right", + detectlang: true, + autocollect: true + }; + = javascript_include_tag "//cdn.transifex.com/live.js" = yield(:head) %body From bd045c2976156502a456fcb06904e4cbcbae75b1 Mon Sep 17 00:00:00 2001 From: ViditChitkara Date: Tue, 5 Sep 2017 18:15:46 +0530 Subject: [PATCH 3/5] 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 --- app/controllers/admin/cfps_controller.rb | 2 +- app/views/admin/cfps/_booths_cfp.html.haml | 6 +++++- app/views/admin/cfps/_events_cfp.html.haml | 4 ++++ app/views/admin/cfps/_form.html.haml | 1 + app/views/admin/cfps/_tracks_cfp.html.haml | 4 ++++ app/views/admin/cfps/index.html.haml | 4 ++++ app/views/proposals/index.html.haml | 8 ++++++++ app/views/proposals/new.html.haml | 5 +++++ db/migrate/20170905110034_add_description_to_cfps.rb | 5 +++++ db/schema.rb | 5 +++-- spec/factories/cfps.rb | 2 +- 11 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20170905110034_add_description_to_cfps.rb diff --git a/app/controllers/admin/cfps_controller.rb b/app/controllers/admin/cfps_controller.rb index da2723b7..18b493eb 100644 --- a/app/controllers/admin/cfps_controller.rb +++ b/app/controllers/admin/cfps_controller.rb @@ -55,7 +55,7 @@ module Admin private 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 diff --git a/app/views/admin/cfps/_booths_cfp.html.haml b/app/views/admin/cfps/_booths_cfp.html.haml index 7cdc6db4..2b82f813 100644 --- a/app/views/admin/cfps/_booths_cfp.html.haml +++ b/app/views/admin/cfps/_booths_cfp.html.haml @@ -11,6 +11,10 @@ %dd = @cfp.end_date.strftime('%A, %B %e. %Y') %dt - Days Left: + Description +%dd + = markdown(@cfp.description) +%dt + Days Left %dd = pluralize(@cfp.remaining_days, 'day') diff --git a/app/views/admin/cfps/_events_cfp.html.haml b/app/views/admin/cfps/_events_cfp.html.haml index f06aa6ca..f4557bb4 100644 --- a/app/views/admin/cfps/_events_cfp.html.haml +++ b/app/views/admin/cfps/_events_cfp.html.haml @@ -10,6 +10,10 @@ End Date: %dd#end_date = @cfp.end_date.strftime('%A, %B %-d. %Y') +%dt + Description: +%dd#description + = markdown(@cfp.description) %dt Days Left: %dd diff --git a/app/views/admin/cfps/_form.html.haml b/app/views/admin/cfps/_form.html.haml index a02f3a02..b42a76e1 100644 --- a/app/views/admin/cfps/_form.html.haml +++ b/app/views/admin/cfps/_form.html.haml @@ -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 :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 :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint %p.text-right = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/cfps/_tracks_cfp.html.haml b/app/views/admin/cfps/_tracks_cfp.html.haml index bcc2df43..20926758 100644 --- a/app/views/admin/cfps/_tracks_cfp.html.haml +++ b/app/views/admin/cfps/_tracks_cfp.html.haml @@ -10,6 +10,10 @@ End Date: %dd#end_date = @cfp.end_date.strftime('%A, %B %-d. %Y') +%dt + Description: +%dd#description + = markdown(@cfp.description) %dt Days Left: %dd diff --git a/app/views/admin/cfps/index.html.haml b/app/views/admin/cfps/index.html.haml index 0067229c..fb075eae 100644 --- a/app/views/admin/cfps/index.html.haml +++ b/app/views/admin/cfps/index.html.haml @@ -12,6 +12,7 @@ %th Type %th Start Date %th End Date + %th Description %th Days Left %th Actions %tbody @@ -24,6 +25,9 @@ = cfp.start_date.strftime('%A, %B %-d. %Y') %td = cfp.end_date.strftime('%A, %B %-d. %Y') + %td + %p + = markdown(truncate(cfp.description)) %td = pluralize(cfp.remaining_days, 'day') %td diff --git a/app/views/proposals/index.html.haml b/app/views/proposals/index.html.haml index 97a721c0..e40eb30e 100644 --- a/app/views/proposals/index.html.haml +++ b/app/views/proposals/index.html.haml @@ -6,6 +6,14 @@ %span.notranslate = @conference.title + + - if @program.cfp_open? + - if @program.cfp.description.present? + .row + .col-md-12 + = markdown(@program.cfp.description) + + .row .col-md-12 = render partial: 'encouragement_text' diff --git a/app/views/proposals/new.html.haml b/app/views/proposals/new.html.haml index 25a78786..0f699559 100644 --- a/app/views/proposals/new.html.haml +++ b/app/views/proposals/new.html.haml @@ -3,6 +3,11 @@ .col-md-12 .page-header %h1 New Proposal + - if @program.cfp_open? + - if @program.cfp.description.present? + .row + .col-md-12 + = markdown(@program.cfp.description) .row .col-md-12 = render partial: 'encouragement_text' diff --git a/db/migrate/20170905110034_add_description_to_cfps.rb b/db/migrate/20170905110034_add_description_to_cfps.rb new file mode 100644 index 00000000..a4976ee2 --- /dev/null +++ b/db/migrate/20170905110034_add_description_to_cfps.rb @@ -0,0 +1,5 @@ +class AddDescriptionToCfps < ActiveRecord::Migration + def change + add_column :cfps, :description, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 6c6531c1..bdf3ad65 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -68,12 +68,13 @@ ActiveRecord::Schema.define(version: 20170924190528) do end create_table "cfps", force: :cascade do |t| - t.date "start_date", null: false - t.date "end_date", null: false + t.date "start_date", null: false + t.date "end_date", null: false t.datetime "created_at" t.datetime "updated_at" t.integer "program_id" t.string "cfp_type" + t.text "description" end create_table "comments", force: :cascade do |t| diff --git a/spec/factories/cfps.rb b/spec/factories/cfps.rb index 6b061d53..ea59a8c1 100644 --- a/spec/factories/cfps.rb +++ b/spec/factories/cfps.rb @@ -5,7 +5,7 @@ FactoryGirl.define do start_date { 1.day.ago } end_date { 2.days.from_now } cfp_type 'events' - + description 'This is a test description' program end end From 837d8ec0db282d3c7ef0b3011ab2fc75b3b8d69b Mon Sep 17 00:00:00 2001 From: rahul Date: Tue, 17 Oct 2017 20:01:15 +0530 Subject: [PATCH 4/5] Add popup confirmation on update button Popup is added so user can confirm the changes Closes https://github.com/openSUSE/osem/issues/1687 --- app/views/admin/conferences/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/conferences/edit.html.haml b/app/views/admin/conferences/edit.html.haml index 26ae198f..b14fd7bb 100644 --- a/app/views/admin/conferences/edit.html.haml +++ b/app/views/admin/conferences/edit.html.haml @@ -29,4 +29,4 @@ = f.inputs name: 'Booths' do = f.input :booth_limit, as: :number, in: 0..9999, hint: 'Booth limit is the maximum number of booths that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not going to accept more booths than the conference can accommodate. You currently have ' + pluralize(@conference.booths.accepted.count, 'accepted booth') +'.' - = f.action :submit, as: :button, button_html: {class: 'btn btn-primary'} + = f.action :submit, as: :button, button_html: { class: 'btn btn-primary', data: { confirm: 'Are you sure you want to proceed?' } } From 4785293bf1348549ade1c68ef35f613eaa509a6f Mon Sep 17 00:00:00 2001 From: rahul Date: Sat, 11 Nov 2017 00:54:31 +0530 Subject: [PATCH 5/5] Add hint in start and end hour in conference#edit --- app/controllers/admin/conferences_controller.rb | 1 + app/helpers/application_helper.rb | 6 ++++++ app/views/admin/conferences/edit.html.haml | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index d8c101d1..8f8f2959 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -193,6 +193,7 @@ module Admin def edit @conferences = Conference.all @date_string = date_string(@conference.start_date, @conference.end_date) + @affected_event_count = @conference.program.events.scheduled(@conference.program.selected_schedule_id).count respond_to do |format| format.html format.json { render json: @conference.to_json } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f77d7963..b5e2892e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -163,6 +163,12 @@ module ApplicationHelper end end + def rescheduling_hint(affected_event_count) + if affected_event_count > 0 + "You have #{affected_event_count} scheduled #{'event'.pluralize(affected_event_count)}. Changing the conference hours will unschedule those scheduled outside the conference hours." + end + end + ## # ====Gets # a conference object diff --git a/app/views/admin/conferences/edit.html.haml b/app/views/admin/conferences/edit.html.haml index b14fd7bb..ac90610d 100644 --- a/app/views/admin/conferences/edit.html.haml +++ b/app/views/admin/conferences/edit.html.haml @@ -22,8 +22,8 @@ = f.input :timezone, as: :time_zone, hint: 'The conference time zone' = f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', readonly: 'readonly' } = f.input :end_date, as: :string, input_html: { id: 'conference-end-datepicker', readonly: 'readonly' } - = f.input :start_hour, input_html: {size: 2, type: 'number', min: 0, max: 23} - = f.input :end_hour, input_html: {size: 2, type: 'number', min: 1, max: 24} + = f.input :start_hour, input_html: {size: 2, type: 'number', min: 0, max: 23}, hint: rescheduling_hint(@affected_event_count) + = f.input :end_hour, input_html: {size: 2, type: 'number', min: 1, max: 24}, hint: rescheduling_hint(@affected_event_count) = f.inputs name: 'Registrations' do = f.input :registration_limit, as: :number, in: 0..9999, hint: 'Limit the number of registrations to the conference (0 no limit). Please note that the registration limit doesn\'t apply to speakers of confirmed events (they will still be able to register even if it has been reached). You currently have ' + pluralize(@conference.registrations.count, 'registration') = f.inputs name: 'Booths' do