diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 7bcb33d4..02f1ac56 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -248,6 +248,11 @@ linters: - "app/views/users/edit.html.haml" - "app/views/users/show.html.haml" + ConsecutiveComments: + exclude: + # This one seems like a bug in haml-lint. + - "app/views/admin/conferences/show.html.haml" + # Offense count: 24 ConsecutiveSilentScripts: exclude: @@ -605,11 +610,6 @@ linters: - "app/views/admin/registrations/index.csv.haml" - "app/views/layouts/_admin.html.haml" - # Offense count: 1 - ImplicitDiv: - exclude: - - "app/views/admin/registrations/index.html.haml" - # Offense count: 9 MultilinePipe: exclude: @@ -637,7 +637,6 @@ linters: - "app/views/devise/passwords/new.html.haml" - "app/views/payments/new.html.haml" - # Offense count: 13 ViewLength: exclude: diff --git a/Gemfile.lock b/Gemfile.lock index 273546b8..0b5deb2f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,9 +36,9 @@ GEM erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - active_model_serializers (0.10.10) - actionpack (>= 4.1, < 6.1) - activemodel (>= 4.1, < 6.1) + active_model_serializers (0.10.12) + actionpack (>= 4.1, < 6.2) + activemodel (>= 4.1, < 6.2) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) activejob (5.2.4.5) @@ -79,7 +79,7 @@ GEM ast (2.4.0) autoprefixer-rails (9.6.4) execjs - awesome_nested_set (3.2.1) + awesome_nested_set (3.4.0) activerecord (>= 4.0.0, < 7.0) aws_cf_signer (0.1.3) axlsx_rails (0.5.2) @@ -94,7 +94,7 @@ GEM bootstrap3-datetimepicker-rails (4.17.47) momentjs-rails (>= 2.8.1) builder (3.2.4) - byebug (11.0.1) + byebug (11.1.3) cancancan (2.3.0) capybara (3.26.0) addressable @@ -127,8 +127,6 @@ GEM aws_cf_signer rest-client cocoon (1.2.15) - codecov (0.5.0) - simplecov (>= 0.15, < 0.22) coderay (1.1.1) concurrent-ruby (1.1.8) countable-rails (0.0.1) @@ -147,10 +145,10 @@ GEM dalli (2.7.11) dante (0.2.0) database_cleaner (1.7.0) - delayed_job (4.1.8) - activesupport (>= 3.0, < 6.1) - delayed_job_active_record (4.1.4) - activerecord (>= 3.0, < 6.1) + delayed_job (4.1.9) + activesupport (>= 3.0, < 6.2) + delayed_job_active_record (4.1.5) + activerecord (>= 3.0, < 6.2) delayed_job (>= 3.0, < 5) devise (4.7.3) bcrypt (~> 3.0) @@ -254,7 +252,7 @@ GEM i18n (1.8.9) concurrent-ruby (~> 1.0) i18n_data (0.8.0) - icalendar (2.7.0) + icalendar (2.7.1) ice_cube (~> 0.16) ice_cube (0.16.3) image_processing (1.12.1) @@ -380,7 +378,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.1.4) + pg (1.2.3) piwik_analytics (1.0.2) actionpack activesupport diff --git a/app/assets/images/snapcon_logo.png b/app/assets/images/snapcon_logo.png index 3d9b05b1..17f3a334 100644 Binary files a/app/assets/images/snapcon_logo.png and b/app/assets/images/snapcon_logo.png differ diff --git a/app/assets/images/snapshot-2020.png b/app/assets/images/snapshot-2020.png new file mode 100644 index 00000000..3d9b05b1 Binary files /dev/null and b/app/assets/images/snapshot-2020.png differ diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index 636ed959..c4c8356a 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -49,6 +49,8 @@ $(function () { $('.' + id).collapse('hide'); $('#' + $(this).val() + '-help.' + id).collapse('show'); + $('#' + $(this).val() + '-instructions.' + id).collapse('show'); + }); $('.dropdown-toggle').dropdown(); @@ -165,7 +167,7 @@ $( document ).ready(function() { var min = $selected.data("min-words"); // Set the filler text for the submission text - fill_if_empty('event_submission_text', $selected.data("help")); + fill_if_empty('event_submission_text', $selected.data("instructions")); $("#abstract-maximum-word-count").text(max); $("#submission-maximum-word-count").text(max); @@ -173,8 +175,7 @@ $( document ).ready(function() { $("#submission-minimum-word-count").text(min); word_count($('#event_abstract').get(0), 'abstract-count', max); word_count($('#event_submission_text').get(0), 'submission-count', max); - }) - .trigger('change'); + }).trigger('change'); /* Count the proposal abstract length */ $("#event_abstract").bind('change keyup paste input', function() { @@ -191,13 +192,13 @@ $( document ).ready(function() { }); /* Listen for reset template button, wait for confirm, and reset. */ - $('#sub_text_reset').click((e) => { + $('.js-resetSubmissionText').click((e) => { let $selected = $("#event_event_type_id option:selected"); let $this = $(e.target); let affirm = confirm($this.data('confirm')); if (affirm) { let sub_text = $('#event_submission_text'); - sub_text.val($selected.data('help')); + sub_text.val($selected.data('instructions')); sub_text.trigger('change'); } }); diff --git a/app/assets/stylesheets/osem-dashboard.scss b/app/assets/stylesheets/osem-dashboard.scss index 3b5685ad..24c60a27 100644 --- a/app/assets/stylesheets/osem-dashboard.scss +++ b/app/assets/stylesheets/osem-dashboard.scss @@ -1,26 +1,34 @@ @import "breakpoints.scss"; .dashbox span.fa { - line-height: 1.1em; + margin-bottom: 2px; + + @include breakpoint(xs) { + font-size: 1.5em; + } @include breakpoint(sm) { - font-size: 3em; + font-size: 2em; } @include breakpoint(md) { - font-size: 4em; + font-size: 3.5em; } @include breakpoint(lg) { font-size: 5em; } } -.dashbox { - padding-top: 20px; - padding-bottom: 20px; -} +.dashbox.panel { + padding: 10px; + display: -webkit-flex; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.4rem; + line-height: 1.6rem; -.dashbox label { - display: block; - font-size: 1.1em; + label { + line-height: 2rem; + } } .todolist-missing span { diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index dc73df87..1ae78998 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -124,8 +124,7 @@ module Admin # current_user.last_sign_in_at # ).count - # Step by step list - # @conference_progress = @conference.get_status + @conference_todo_list = @conference.get_status # Line charts @registrations = @conference.get_registrations_per_week diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index eebaa4fe..eb5cd930 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -60,6 +60,20 @@ module EventsHelper "#{event.average_rating}/#{max_rating}, #{pluralize(event.voters.length, 'vote')}" end + def event_type_options(event_types) + event_types.map do |type| + [ + "#{type.title} - #{show_time(type.length)}", + type.id, + data: { + min_words: type.minimum_abstract_length, + max_words: type.maximum_abstract_length, + instructions: type.submission_instructions + } + ] + end + end + def event_type_dropdown(event, event_types, conference_id) selection = event.event_type.try(:title) || 'Event Type' options = event_types.collect do |event_type| diff --git a/app/mailers/mailbot.rb b/app/mailers/mailbot.rb index 07249862..2f9d1f77 100644 --- a/app/mailers/mailbot.rb +++ b/app/mailers/mailbot.rb @@ -7,8 +7,9 @@ YTLF_TICKET_ID = 50 class Mailbot < ActionMailer::Base helper ConferenceHelper - default bcc: -> { SNAPCON_BCC_ADDRESS }, - template_name: -> { EMAIL_TEMPLATE }, + default bcc: SNAPCON_BCC_ADDRESS, + template_name: EMAIL_TEMPLATE, + content_type: 'text/html', to: -> { @user.email }, from: -> { @conference.contact.email } diff --git a/app/models/event.rb b/app/models/event.rb index ba04ba20..ff798651 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -273,7 +273,7 @@ class Event < ApplicationRecord biographies: speakers.all? { |speaker| !speaker.biography.blank? }, subtitle: !subtitle.blank?, track: (!track.blank? unless program.tracks.empty?), - difficulty_level: !difficulty_level.blank?, + difficulty_level: (difficulty_level.present? unless program.difficulty_levels.empty?), title: true, abstract: true }.with_indifferent_access diff --git a/app/views/admin/conferences/_todo_list.html.haml b/app/views/admin/conferences/_todo_list.html.haml index 88bb7c36..74ddc796 100644 --- a/app/views/admin/conferences/_todo_list.html.haml +++ b/app/views/admin/conferences/_todo_list.html.haml @@ -1,13 +1,14 @@ -.list-group - %li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)}" } +%ul.list-group + .list-group-item %h4 Conference progress .progress - .progress-bar{ 'role' => 'progressbar', 'aria-valuenow' => "#{conference_progress['process']}", 'aria-valuemin' => '0', - 'aria-valuemax' => '100', 'style' => "width: #{conference_progress['process']}%;" } + .progress-bar{ role: 'progressbar', 'aria-valuenow': conference_progress['process'], + 'aria-valuemin': 0, 'aria-valuemax': 100, + style: "width: #{conference_progress['process']}%;" } = conference_progress['process'] + '%' - %li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['registration'])}" } - %span{ 'class' => icon_for_todo(conference_progress['registration']) } + %li.list-group-item{ class: class_for_todo(conference_progress['registration']) } + %span{ class: icon_for_todo(conference_progress['registration']) } - if can? :update, @conference - if conference.registration_period = link_to 'Set up registration period', edit_admin_conference_registration_period_path(conference_progress['short_title']) @@ -15,14 +16,14 @@ = link_to 'Set up registration period', new_admin_conference_registration_period_path(conference_progress['short_title']) - else Set up registration period - %li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['cfp'])}" } - %span{ 'class' => icon_for_todo(conference_progress['cfp']) } + %li.list-group-item{ class: class_for_todo(conference_progress['cfp']) } + %span{ class: icon_for_todo(conference_progress['cfp']) } - if can? :update, Cfp.new(program_id: @program.id) = link_to 'Set up call for papers', admin_conference_program_cfps_path(conference_progress['short_title']) - else Set up call for papers - %li{'class'=>"list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['venue'])}"} - %span{'class'=>icon_for_todo(conference_progress['venue'])} + %li.list-group-item{ class: class_for_todo(conference_progress['venue']) } + %span{ class: icon_for_todo(conference_progress['venue'])} - if can? :update, Venue.new(conference: @conference) - @conference.reload - if conference.venue @@ -32,32 +33,32 @@ - else - @conference.reload Add venue - %li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['rooms'])}" } - %span{ 'class' => icon_for_todo(conference_progress['rooms']) } + %li.list-group-item{ class: class_for_todo(conference_progress['rooms']) } + %span{ class: icon_for_todo(conference_progress['rooms']) } - if @conference.venue && (can? :update, @conference.venue.rooms.build) = link_to 'Add rooms', admin_conference_venue_rooms_path(conference_progress['short_title']) - else Add rooms - %li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['tracks'])}" } - %span{ 'class' => icon_for_todo(conference_progress['tracks']) } + %li.list-group-item{ class: class_for_todo(conference_progress['tracks']) } + %span{ class: icon_for_todo(conference_progress['tracks']) } - if can? :update, @conference.program.tracks.build = link_to 'Add tracks', admin_conference_program_tracks_path(conference_progress['short_title']) - else Add tracks - %li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['event_types'])}" } - %span{ 'class' => icon_for_todo(conference_progress['event_types']) } + %li{ class: "list-group-item #{class_for_todo(conference_progress['event_types'])}" } + %span{ class: icon_for_todo(conference_progress['event_types']) } - if can? :update, @conference.program.event_types.build = link_to 'Add event types', admin_conference_program_event_types_path(conference_progress['short_title']) - else Add event types - %li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['difficulty_levels'])}" } - %span{ 'class' => icon_for_todo(conference_progress['difficulty_levels']) } + %li{ class: "list-group-item #{class_for_todo(conference_progress['difficulty_levels'])}" } + %span{ class: icon_for_todo(conference_progress['difficulty_levels']) } - if can? :update, @conference.program.difficulty_levels.build = link_to 'Add difficulty levels', admin_conference_program_difficulty_levels_path(conference_progress['short_title']) - else Add difficulty levels - %li{ class: "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['splashpage'])}" } - %span{ 'class' => icon_for_todo(conference_progress['splashpage']) } + %li.list-group-item{ class: "#{class_for_todo(conference_progress['splashpage'])}" } + %span{ class: icon_for_todo(conference_progress['splashpage']) } - if can? :update, @conference = link_to 'Set up a Splashpage', admin_conference_splashpage_path(conference_progress['short_title']) - else diff --git a/app/views/admin/conferences/edit.html.haml b/app/views/admin/conferences/edit.html.haml index de0c5811..b675481b 100644 --- a/app/views/admin/conferences/edit.html.haml +++ b/app/views/admin/conferences/edit.html.haml @@ -9,24 +9,27 @@ = semantic_form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f| = f.input :title, hint: "The full title of the conference, e.g. 'openSUSE Conference 2014'" = f.input :short_title, hint: "A short title, e.g. 'oSC14', to be used in URLs" - = f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown' } } - = f.input :color, hint: 'The color will be used eg for the dashboard.', input_html: {size: 6, type: 'color'} - = f.label 'Conference Logo' + = f.input :description, + hint: markdown_hint('A description of the conference. (Supports unsafe HTML.)'), + input_html: { rows: 5, data: { provide: 'markdown' } } + = f.input :color, hint: 'The will be used in emails.', + input_html: {size: 6, type: 'color'} + = f.label 'Conference Logo', for: 'conference_picture' %br - if @conference.picture? = image_tag @conference.picture.thumb.url - = f.input :picture, label: false, hint: 'This will be displayed on the front page.' + = f.input :picture, label: false, hint: 'This will be shown in the navigation bar and emails.' = f.hidden_field :picture_cache = f.input :custom_css, - hint: "Add Custon CSS to the main page. You might find the class '.conference-#{@conference.short_title}' useful.", - input_html: { rows: 5 } + hint: "Add custon CSS to all pages within the conference. The class .conference-#{@conference.short_title} is included on the body element.".html_safe, + input_html: { rows: 10, style: 'font-family: monospace' } = f.input :ticket_layout, as: :select, collection: Conference.ticket_layouts.keys, hint: "Layout type for tickets of the conference." = f.inputs name: 'Scheduling' do = 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_date, as: :string, input_html: { id: 'conference-start-datepicker' } + = f.input :end_date, as: :string, input_html: { id: 'conference-end-datepicker' } = 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 diff --git a/app/views/admin/conferences/show.html.haml b/app/views/admin/conferences/show.html.haml index ce49c287..63a91d27 100644 --- a/app/views/admin/conferences/show.html.haml +++ b/app/views/admin/conferences/show.html.haml @@ -3,16 +3,16 @@ Dashboard for #{@conference.title} %hr .row - .col-sm-3.col-xs-3 + .col-sm-3.col-xs-6 = render "big_statistic", icon: "user", subtitle: "Registration", value: @total_reg, delta: @new_reg - .col-sm-3.col-xs-3 + .col-sm-3.col-xs-6 = render "big_statistic", icon: "check-square", subtitle: "Submission", value: @total_submissions, delta: @new_submissions - .col-sm-3.col-xs-3 + .col-sm-3.col-xs-6 = render "big_statistic", icon: "file-text", subtitle: "Hour", value: @program_length, delta: @new_program_length - .col-sm-3.col-xs-3 + .col-sm-3.col-xs-6 = render "big_statistic", icon: "archive", subtitle: "Withdrawn", value: @total_withdrawn, delta: @new_withdrawn @@ -29,9 +29,20 @@ = render 'line_chart', title: 'Submissions per week', data: @submissions .col-md-4 - -# + - unless @conference.ended? = render 'todo_list', - conference_progress: @conference_progress, conference: @conference + conference_progress: @conference_todo_list, conference: @conference + - else + .list-group + .list-group-item + %h4 + Conference Progress + .progress + .progress-bar{ role: 'progressbar', 'aria-valuenow': 100, + 'aria-valuemin': 0, 'aria-valuemax': 100, + style: 'width: 100%;' } + Conference Complete! + .row#tickets .col-md-8 = render 'line_chart', @@ -44,14 +55,15 @@ %a{ href: '#distribution_all', 'data-toggle' => 'tab' } %span.fa.fa-star All - %li - %a{ href: '#distribution_confirmed', 'data-toggle' => 'tab' } - %span.fa.fa-comment - Confirmed - %li - %a{ href: '#distribution_withdrawn', 'data-toggle' => 'tab' } - %span.fa.fa-archive - Withdrawn + -# TODO-SNAP: Disabled for Snap!Con + %li + %a{ href: '#distribution_confirmed', 'data-toggle' => 'tab' } + %span.fa.fa-comment + Confirmed + %li + %a{ href: '#distribution_withdrawn', 'data-toggle' => 'tab' } + %span.fa.fa-archive + Withdrawn .tab-content .tab-pane.active#distribution_all .row @@ -59,38 +71,33 @@ = render 'donut_chart', title: 'Event types', combined_data: @event_type_distribution .col-md-4 - -# - = render 'donut_chart', title: 'Difficulty levels', - combined_data: @difficulty_levels_distribution + = render 'donut_chart', title: 'Difficulty levels', + combined_data: @difficulty_levels_distribution .col-md-4 - -# - = render 'donut_chart', title: 'Tracks', - combined_data: @tracks_distribution - .tab-pane#distribution_confirmed - .row - .col-md-4 - -# - = render 'donut_chart', title: 'Event types', - combined_data: @event_type_distribution_confirmed - .col-md-4 - -# - = render 'donut_chart', title: 'Difficulty levels', - combined_data: @difficulty_levels_distribution_confirmed - .col-md-4 - -# - = render 'donut_chart', title: 'Tracks', - combined_data: @tracks_distribution_confirmed - .tab-pane#distribution_withdrawn + = render 'donut_chart', title: 'Tracks', + combined_data: @tracks_distribution + -# .tab-pane#distribution_withdrawn .row .col-md-4 = render 'donut_chart', title: 'Event types', combined_data: @event_type_distribution_withdrawn .col-md-4 = render 'donut_chart', title: 'Difficulty levels', - combined_data: @difficulty_levels_distribution_withdrawn + combined_data: @difficulty_levels_distribution .col-md-4 = render 'donut_chart', title: 'Tracks', - combined_data: @tracks_distribution_withdrawn + combined_data: @tracks_distribution + -# .tab-pane#distribution_confirmed + .row + .col-md-4 + = render 'donut_chart', title: 'Event types', + combined_data: @event_type_distribution_confirmed + .col-md-4 + = render 'donut_chart', title: 'Difficulty levels', + combined_data: @difficulty_levels_distribution_confirmed + .col-md-4 + = render 'donut_chart', title: 'Tracks', + combined_data: @tracks_distribution_confirmed .row .col-md-8 diff --git a/app/views/admin/registrations/index.html.haml b/app/views/admin/registrations/index.html.haml index 09f674e9..70a50b46 100644 --- a/app/views/admin/registrations/index.html.haml +++ b/app/views/admin/registrations/index.html.haml @@ -20,7 +20,7 @@ combined_data: @registration_distribution .row .col-md-12 - %div.margin-event-table + .margin-event-table %table.datatable#registrations{ data: { source: admin_conference_registrations_path(conference_id: @conference, format: :json) } } %thead %tr diff --git a/app/views/application/_big_statistic.haml b/app/views/application/_big_statistic.haml index 7a77d29c..993903a7 100644 --- a/app/views/application/_big_statistic.haml +++ b/app/views/application/_big_statistic.haml @@ -1,13 +1,12 @@ - reverse ||= false - variant = variant_from_delta(delta, reverse: reverse) -.dashbox.text-center - %span.fa - = fa_icon(icon) - = value - %p.text-nowrap - %small +.dashbox.panel.panel-primary + .paenl-body.text-center + %span.fa + = fa_icon(icon) + = value + %p = subtitle.pluralize(value) - %span.label{ class: "label-#{variant}" } - = delta - since you last logged in - + .label{ class: "label-#{variant}" } + = delta || 0 + since last log in diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 2c1bb613..dd40fb5c 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -11,7 +11,7 @@ = f.input :password - if devise_mapping.rememberable? %p.text-right.small - = f.label 'Remember me' + = f.label 'Remember me', for: 'user_remember_me' = f.check_box :remember_me %p.text-right = f.action :submit, as: :button, label: 'Sign In', button_html: {class: 'btn btn-success'} diff --git a/app/views/mailbot/ticket_confirmation_template.html.erb b/app/views/mailbot/ticket_confirmation_template.html.erb index f92284d7..97a97c60 100644 --- a/app/views/mailbot/ticket_confirmation_template.html.erb +++ b/app/views/mailbot/ticket_confirmation_template.html.erb @@ -4,11 +4,11 @@ Dear <%= @user.name %>, Thanks! You have successfully booked <%= @ticket_purchase.quantity %> <%= @ticket_purchase.ticket.title %> ticket(s) for the event <%= @conference.title %>. Your transaction id is <%= @ticket_purchase.id %>. - + Please, find the ticket(s) pdf attached. - + Best wishes, - <%= @conference.title %> Team + <%= @conference.title %> Team -<%= render partial: "layouts/mailbot_footer" %> \ No newline at end of file +<%= render partial: "layouts/mailbot_footer" %> diff --git a/app/views/proposals/_encouragement_text.html.haml b/app/views/proposals/_encouragement_text.html.haml index 9b28088c..f7f6033f 100644 --- a/app/views/proposals/_encouragement_text.html.haml +++ b/app/views/proposals/_encouragement_text.html.haml @@ -17,6 +17,7 @@ %b.notranslate= pluralize(@program.cfp.remaining_days, 'day') left! %span.notranslate= @conference.title - will only be as good as the content you present. Submit early, submit often! + will only be as good as the content you present. + %br Submit early, submit often! - else The submission period is closed now. diff --git a/app/views/proposals/_proposal_form.html.haml b/app/views/proposals/_proposal_form.html.haml index 5f907d6a..8d16f9a9 100644 --- a/app/views/proposals/_proposal_form.html.haml +++ b/app/views/proposals/_proposal_form.html.haml @@ -11,85 +11,43 @@ = track_selector_input f - = f.input :event_type_id, as: :select, - collection: @conference.program.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id, - data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length, help: type.description }]}, - include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' } - - if @program.languages.present? = f.input :language, as: :select, collection: @languages, include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' } - - @conference.program.event_types.each do |event_type| - %span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" } - = event_type.description + - if @program.difficulty_levels.present? + = f.input :difficulty_level, as: :select, collection: @program.difficulty_levels, + input_html: { class: 'select-help-toggle' }, + include_blank: '(Please select)' if @conference.program.difficulty_levels.any? - = f.input :difficulty_level, as: :select, collection: @conference.program.difficulty_levels, input_html: { class: 'select-help-toggle' }, - include_blank: '(Please select)' if @conference.program.difficulty_levels.any? + - @program.difficulty_levels.each do |difficulty_level| + %span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" } + = difficulty_level.description - - @conference.program.difficulty_levels.each do |difficulty_level| - %span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" } - = difficulty_level.description + = render 'proposals/submission_type_content_form', f: f, program: @program - = f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } }, - hint: markdown_hint('[Tips to improve your presentations.](http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx)') - - %p - You have used - %span#abstract-count #{@event.abstract_word_count} - words. Abstracts must be between - %span#abstract-minimum-word-count - 0 - and - %span#abstract-maximum-word-count - 250 - words. - - %br - - @conference.program.event_types.each do |event_type| - %span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" } - %h3 - = event_type.name - Instructions - = markdown(event_type.submission_instructions) - - = f.input :submission_text, input_html: { rows: 5, data: { provide: 'markdown' }, placeholder: '' }, - hint: markdown_hint('Only conference organizers will read this.') - %button.btn.btn-primary.primary-button{ type: 'button', id: 'sub_text_reset', data: { confirm: 'Do you really want to reset your submission text to the provided template?' } } Reset to Template - - %p - You have used - %span#submission-count #{@event.submission_word_count} - words. Submission descriptions must be between - %span#submission-minimum-word-count - 0 - and - %span#submission-maximum-word-count - 250 - words. - - - if current_user.is_admin? or @program.cfp&.enable_registrations? + - if @program.cfp&.enable_registrations? = f.inputs 'Enable pre-registration' do = f.input :require_registration, label: 'Require participants to register to your event' - message = @event.room ? "Value must be between 1 and #{@event.room.size}" : 'Check room capacity after scheduling.' = f.input :max_attendees, hint: 'The maximum number of participants. ' + message - - if current_user.has_any_role? :admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference } - = f.input :is_highlight - %p.text-right = link_to '#description', 'data-toggle' => 'collapse' do Do you require something special? #description{ class: "collapse #{ 'in' if @event.description.present? }" } = f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.' + - if current_user.has_any_role? :admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference } + %p (Admin Only) + = f.input :is_highlight %p.text-right - if @event.new_record? = f.submit 'Submit Proposal', class: 'btn btn-success' - else - = f.submit 'Update Proposal', class: 'btn btn-success' + = f.submit 'Update Proposal', class: 'btn btn-primary' :javascript $(document).ready(function() { diff --git a/app/views/proposals/_submission_type_content_form.haml b/app/views/proposals/_submission_type_content_form.haml new file mode 100644 index 00000000..367695f3 --- /dev/null +++ b/app/views/proposals/_submission_type_content_form.haml @@ -0,0 +1,68 @@ +-# PARTIAL FOR EVENT/PROPOSAL FORM + += f.input :event_type_id, as: :select, include_blank: false, label: 'Type', + input_html: { class: 'select-help-toggle' }, + collection: event_type_options(program.event_types) + + +- program.event_types.each do |event_type| + .help-block.event_event_type_id.collapse{ id: "#{event_type.id}-help" } + %strong Description + %div + = markdown(event_type.description) + +%h3 Submission Abstract +%p + The abstract is reviewed by the committee and included in the conference program. + You are encouraged to include links or other references as appropriate. + += f.label :abstract, class: 'sr-only' += f.input :abstract, required: true, label: false, + input_html: { rows: 5, data: { provide: 'markdown' } }, + hint: markdown_hint + +%p + You have used + %span#abstract-count 0 + words. Abstracts must be between + %span#abstract-minimum-word-count 0 + and + %span#abstract-maximum-word-count 250 + words. + +%hr +%h3 Submission Details +%p + This part of the submission is intended only for the conference committee. + +- program.event_types.each do |event_type| + .help-block.select-help-text.event_event_type_id.collapse{ id: "#{event_type.id}-instructions" } + - if event_type.submission_instructions.blank? + %p + Use this space to include any additional inforrmation that is helpful in reviewing your + submission. If you have any co-presenters, please include them + below. After submission, you will have the opportunity to add them to the + speakers list. (However, they must have an active #{ENV['OSEM_NAME']} account.) + - else + %p + Please use the following as the template for your submission. This will help the conference + committee review your submission with all the details they need. If you have any + co-presenters, please include them below. After submission, you will have the opportunity + to add them to the speakers list. (However, they must have an active #{ENV['OSEM_NAME']} + account.) + .panel.panel-primary + .panel-heading + = event_type.name + Template + .panel-body + = markdown(event_type.submission_instructions) + .panel-footer + %button.btn.btn-warning.btn-xs.js-resetSubmissionText{ type: 'button', + data: { confirm: 'Do you really want to reset your submission text to the provided template?' } } + Reset Submission to Template + %span.small You may want to use this if you have changed the submission type. + += f.label :submission_text, class: 'sr-only' += f.input :submission_text, label: false, + input_html: { rows: 10, data: { provide: 'markdown' } }, + hint: markdown_hint diff --git a/app/views/proposals/_tooltip.html.haml b/app/views/proposals/_tooltip.html.haml index 2220451d..23fb1c0d 100644 --- a/app/views/proposals/_tooltip.html.haml +++ b/app/views/proposals/_tooltip.html.haml @@ -1,30 +1,31 @@ - progress_status = event.progress_status %ul.list-unstyled - if can? :create, @conference.registrations.new - %li{'class'=>class_for_todo(progress_status['registered'])} - %span{'class'=>icon_for_todo(progress_status['registered'])} - - if progress_status['registered'] + %li{class: class_for_todo(progress_status[:registered])} + %span{class: icon_for_todo(progress_status[:registered])} + - if progress_status[:registered] Speaker(s) registered to the conference - else = link_to 'Speaker(s) not registered to the conference', new_conference_conference_registration_path(event.program.conference.short_title) - %li{'class'=>class_for_todo(progress_status['biographies'])} - %span{'class'=>icon_for_todo(progress_status['biographies'])} - - if progress_status['biographies'] + %li{class: class_for_todo(progress_status[:biographies])} + %span{class: icon_for_todo(progress_status[:biographies])} + - if progress_status[:biographies] Speakers have filled out their biographies - elsif current_user.biography.blank? && event.speakers.include?(current_user) = link_to 'Fill out your biography', edit_user_path(current_user) - else Speakers' biographies missing - %li{'class'=>class_for_todo(progress_status['subtitle'])} - %span{'class'=>icon_for_todo(progress_status['subtitle'])} + %li{class: class_for_todo(progress_status[:subtitle])} + %span{class: icon_for_todo(progress_status[:subtitle])} = link_to 'Add a subtitle', edit_conference_program_proposal_path(event.program.conference.short_title, event) - %li{'class'=>class_for_todo(progress_status['commercials'])} - %span{'class'=>icon_for_todo(progress_status['commercials'])} + %li{class: class_for_todo(progress_status[:commercials])} + %span{class: icon_for_todo(progress_status[:commercials])} = link_to 'Add materials', edit_conference_program_proposal_path(event.program.conference.short_title, event, anchor: 'commercials-content') - - unless progress_status['track'].nil? - %li{'class'=>class_for_todo(progress_status['track'])} - %span{'class'=>icon_for_todo(progress_status['track'])} + - unless progress_status[:track].nil? + %li{class: class_for_todo(progress_status[:track])} + %span{class: icon_for_todo(progress_status[:track])} = link_to 'Add a track', edit_conference_program_proposal_path(event.program.conference.short_title, event) - %li{'class'=>class_for_todo(progress_status['difficulty_level'])} - %span{'class'=>icon_for_todo(progress_status['difficulty_level'])} - = link_to 'Add a difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event) + - unless progress_status[:difficulty_level].nil? + %li{class: class_for_todo(progress_status[:difficulty_level])} + %span{class: icon_for_todo(progress_status[:difficulty_level])} + = link_to 'Add a difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event) diff --git a/app/views/proposals/new.html.haml b/app/views/proposals/new.html.haml index 9c9a7004..7c709235 100644 --- a/app/views/proposals/new.html.haml +++ b/app/views/proposals/new.html.haml @@ -5,6 +5,7 @@ %h1 New #{@conference.title} Proposal - if @program.cfp_open? - if @program.cfp.description.present? + %h2 Call for Proposals .row .col-md-12 = markdown(@program.cfp.description, escape_html=false) @@ -31,52 +32,22 @@ = f.inputs name: 'Proposal Information' do = f.input :title, as: :string, required: true, input_html: { required: true } - = f.input :event_type_id, as: :select, - collection: @program.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id, - data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length, help: type.description }]}, - include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' } - if @program.languages.present? = f.input :language, as: :select, collection: @languages, include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' } - - @program.event_types.each do |event_type| - %div{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help"} - %strong Directions - %div - = markdown(event_type.description) + - if @program.difficulty_levels.present? + = f.input :difficulty_level, as: :select, collection: @program.difficulty_levels, + input_html: { class: 'select-help-toggle' }, + include_blank: '(Please select)' if @conference.program.difficulty_levels.any? - = f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } }, - hint: markdown_hint + - @program.difficulty_levels.each do |difficulty_level| + %span.help-block.select-help-text.collapse.event_difficulty_level_id{ id: "#{difficulty_level.id}-help" } + = difficulty_level.description - %p - You have used - %span#abstract-count #{@event.abstract_word_count} - words. Abstracts must be between - %span#abstract-minimum-word-count - 0 - and - %span#abstract-maximum-word-count - 250 - words. - - %br - - @conference.program.event_types.each do |event_type| - %span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" } - %h3 - = event_type.name - Instructions - %p Please use this as the template for your submission. - This part of the submission is intended only for the conference committee. - %hr - = markdown(event_type.submission_instructions) - - - = f.input :submission_text, input_html: { rows: 5, data: { provide: 'markdown' } }, - hint: markdown_hint - - %button.btn.btn-primary.primary-button{ type: 'button', id: 'sub_text_reset', data: { confirm: 'Do you really want to reset your submission text to the provided template?' } } Reset to Template + = render 'submission_type_content_form', f: f, program: @program - if @program.cfp.enable_registrations? = f.input :require_registration, label: 'Require participants to register to your event' @@ -89,7 +60,7 @@ = f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.' %p.text-right - = f.submit 'Submit Proposal', class: 'btn btn-success' + = f.submit 'Submit Proposal', class: 'btn btn-success btn-lg' .tab-pane{role: 'tabpanel', id: 'signin'} = render partial: 'devise/shared/sign_in_form_embedded' diff --git a/app/views/schedules/happening_now.haml b/app/views/schedules/happening_now.haml index 438cd774..57d077ff 100644 --- a/app/views/schedules/happening_now.haml +++ b/app/views/schedules/happening_now.haml @@ -9,14 +9,22 @@ .col-md-12 %h2 #{pluralize(@events_schedules.count, 'Event')} Occurring Within The Next 30 minutes. +<<<<<<< HEAD %h3 This page was loaded at = inyourtz(Time.now) do = Time.now.strftime('%a %b %d at %I:%M %P (%z)') +======= + %br + %small + This page was loaded at + = inyourtz(Time.now) do + = Time.now.strftime('%a %b %d at %I:%M %P (%z)') + \. +>>>>>>> b194ad8ad6e0af95b48002a350a87a514cd8593a .row / TODO: Clean this up, merge with all events page. - / scheduled events - date = nil - time = nil - @events_schedules.each do |event_schedule| diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 18297d2d..e7377bb2 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -195,6 +195,7 @@ feature Event do scenario 'can reset to text template', feature: true, js: true do event_type = conference.program.event_types[-1] event_type.description = 'Example event description' + event_type.submission_instructions = '## Fill Me In!' event_type.save! sign_in participant @@ -205,10 +206,10 @@ feature Event do fill_in 'event_submission_text', with: 'Lorem ipsum example submission text' accept_confirm do - click_button 'Reset to Template' + click_button 'Reset Submission to Template' end - expect(page.find('#event_submission_text').value).to eq(event_type.description) + expect(page.find('#event_submission_text').value).to eq(event_type.submission_instructions) end end end