diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index dcab692c..5f1bc625 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -94,11 +94,6 @@ $(function () { return false; }); - $("#event-comment-link").click(function(){ - $("#comments-div").toggle(); - return false; - }); - $(".comment-reply").hide(); $(".user-details-popover").popover(); $("#comments-div").hide(); diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 2dcd5a27..80e36f47 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -68,7 +68,6 @@ module Admin def new @conference = Conference.new - @organizations = Organization.accessible_by(current_ability, :update).pluck(:name, :id) end def create diff --git a/app/controllers/admin/programs_controller.rb b/app/controllers/admin/programs_controller.rb index 09a86099..d47d4d1d 100644 --- a/app/controllers/admin/programs_controller.rb +++ b/app/controllers/admin/programs_controller.rb @@ -12,11 +12,12 @@ module Admin def update authorize! :update, @conference.program @program = @conference.program + params['program']['languages'] = params['program']['languages'].join(',') if params['program']['languages'].present? @program.assign_attributes(program_params) send_mail_on_schedule_public = @program.notify_on_schedule_public? event_schedules_count_was = @program.event_schedules.count - if @program.update(program_params) + if @program.save ConferenceScheduleUpdateMailJob.perform_later(@conference) if send_mail_on_schedule_public respond_to do |format| format.html do @@ -40,7 +41,7 @@ module Admin private def program_params - params.require(:program).permit(:rating, :schedule_public, :schedule_interval, :schedule_fluid, :languages, :blind_voting, :voting_start_date, :voting_end_date, :selected_schedule_id) + params.require(:program).permit(:rating, :schedule_public, :schedule_interval, :schedule_fluid, :blind_voting, :voting_start_date, :voting_end_date, :selected_schedule_id, :languages) end end end diff --git a/app/controllers/admin/questions_controller.rb b/app/controllers/admin/questions_controller.rb index 3d67cf96..b6451c92 100644 --- a/app/controllers/admin/questions_controller.rb +++ b/app/controllers/admin/questions_controller.rb @@ -3,7 +3,7 @@ module Admin class QuestionsController < Admin::BaseController load_and_authorize_resource :conference, find_by: :short_title - load_and_authorize_resource through: :conference, except: [:new, :create] + load_and_authorize_resource except: [:new, :create] def index authorize! :index, Question.new(conference_id: @conference.id) diff --git a/app/controllers/admin/registrations_controller.rb b/app/controllers/admin/registrations_controller.rb index 588c87c5..0fa8a8af 100644 --- a/app/controllers/admin/registrations_controller.rb +++ b/app/controllers/admin/registrations_controller.rb @@ -20,7 +20,7 @@ module Admin respond_to do |format| format.html format.json do - render json: RegistrationDatatable.new(view_context: view_context, conference: @conference) + render json: RegistrationDatatable.new({}, conference: @conference, view_context: view_context) end format.pdf { render 'index', layout: false } format.xlsx do diff --git a/app/controllers/admin/tickets_controller.rb b/app/controllers/admin/tickets_controller.rb index b19032a9..e0e5b186 100644 --- a/app/controllers/admin/tickets_controller.rb +++ b/app/controllers/admin/tickets_controller.rb @@ -17,7 +17,7 @@ module Admin def create @ticket = @conference.tickets.new(ticket_params) - if @ticket.save(ticket_params) + if @ticket.save redirect_to admin_conference_tickets_path(conference_id: @conference.short_title), notice: 'Ticket successfully created.' else diff --git a/app/controllers/conference_registrations_controller.rb b/app/controllers/conference_registrations_controller.rb index e2e75452..70cfc736 100644 --- a/app/controllers/conference_registrations_controller.rb +++ b/app/controllers/conference_registrations_controller.rb @@ -24,7 +24,7 @@ class ConferenceRegistrationsController < ApplicationController end authorize! :new, @registration, message: message - # @user variable needs to be set so that _sign_up_form_embedded works properly + # @user needs to be set for devise/registrations/new_embedded @user = @registration.build_user end @@ -42,7 +42,7 @@ class ConferenceRegistrationsController < ApplicationController @registration = @conference.registrations.new(registration_params) @user = if current_user.nil? - # @user variable needs to be set so that _sign_up_form_embedded works properly + # @user needs to be set for devise/registrations/new_embedded @registration.build_user(user_params) else current_user diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 2b022571..c281d4e1 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -3,16 +3,6 @@ class RegistrationsController < Devise::RegistrationsController prepend_before_action :check_captcha, only: [:create] - def edit - @openids = Openid.where(user_id: current_user.id).order(:provider) - super - end - - def update - @openids = Openid.where(user_id: current_user.id).order(:provider) - super - end - protected def after_update_path_for(resource) diff --git a/app/datatables/registration_datatable.rb b/app/datatables/registration_datatable.rb index 9ba7ae6a..7384933c 100644 --- a/app/datatables/registration_datatable.rb +++ b/app/datatables/registration_datatable.rb @@ -1,10 +1,15 @@ # frozen_string_literal: true -class RegistrationDatatable < AjaxDatatablesRails::Base +class RegistrationDatatable < AjaxDatatablesRails::ActiveRecord extend Forwardable def_delegator :@view, :edit_admin_conference_registration_path + def initialize(params, opts = {}) + @view = opts[:view_context] + super + end + def view_columns @view_columns ||= { id: { source: 'Registration.id', cond: :eq }, diff --git a/app/helpers/event_types_helper.rb b/app/helpers/event_types_helper.rb new file mode 100644 index 00000000..e200e33c --- /dev/null +++ b/app/helpers/event_types_helper.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module EventTypesHelper + ## + # Includes functions related to event_types + ## + ## + # ====Returns + # * +String+ -> number of registrations / max allowed registrations + def event_type_select_options(event_types = {}) + event_types.map { |type| ["#{type.title} - #{show_time(type.length)}", type.id] } + end +end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 31384a2c..ddb16e4c 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -46,14 +46,6 @@ module EventsHelper end end - def track_selector_input(form) - if @program.tracks.confirmed.cfp_active.any? - form.input :track_id, as: :select, - collection: @program.tracks.confirmed.cfp_active.pluck(:name, :id), - include_blank: '(Please select)' - end - end - def rating_tooltip(event, max_rating) "#{event.average_rating}/#{max_rating}, #{pluralize(event.voters.length, 'vote')}" end diff --git a/app/views/admin/booths/edit.html.haml b/app/views/admin/booths/edit.html.haml index 0cac17e7..07fca460 100644 --- a/app/views/admin/booths/edit.html.haml +++ b/app/views/admin/booths/edit.html.haml @@ -1,5 +1,9 @@ -%h1 - Editing - = @booth.title - -= render 'booths/form' +.row + .col-md-12 + .page-header + %h1 + Edit #{t'booth'} + = @booth.title +.row + .col-md-8 + = render 'booths/form' diff --git a/app/views/admin/booths/new.html.haml b/app/views/admin/booths/new.html.haml index 0cf6adb5..843ade27 100644 --- a/app/views/admin/booths/new.html.haml +++ b/app/views/admin/booths/new.html.haml @@ -1,3 +1,8 @@ -%h1 New #{t'booth'} - -= render 'booths/form' +.row + .col-md-12 + .page-header + %h1 + New #{t'booth'} +.row + .col-md-8 + = render 'booths/form' diff --git a/app/views/admin/cfps/_form.html.haml b/app/views/admin/cfps/_form.html.haml index 8e3c7f35..f6af3687 100644 --- a/app/views/admin/cfps/_form.html.haml +++ b/app/views/admin/cfps/_form.html.haml @@ -1,28 +1,20 @@ -.row - .col-md-12 - .page-header - %h1 - Call for - = cfp.cfp_type.capitalize -.row - .col-md-8 - = semantic_form_for(cfp, url: cfp_form_url(cfp, conference), - html: { multipart: true, - data: { end_conference: conference.end_date.to_s } }) do |f| - = f.input :cfp_type, as: :hidden - = f.input :start_date, as: :string, - input_html: { class: 'form-control', - id: 'registration-period-start-datepicker' } - = f.input :end_date, as: :string, - input_html: { class: 'form-control', - id: 'registration-period-end-datepicker' } - = f.input :description, hint: markdown_hint, - input_html: { rows: 2, data: { provide: 'markdown' } } - - if cfp.cfp_type == 'events' - = f.input :enable_registrations, as: :boolean, - hint: 'Allow submitters to request registration?' - - else - = f.input :enable_registrations, as: :hidden - %p.text-right - = f.action :submit, as: :button, - button_html: { class: 'btn btn-primary' } += form_for(@cfp, url: (@cfp.new_record? ? admin_conference_program_cfps_path : admin_conference_program_cfp_path(@conference.short_title, @cfp)), data: { end_conference: @conference.end_date.to_s }) do |f| + = f.hidden_field :cfp_type + .form-group + = f.label :start_date, "Start Date" + = f.text_field :start_date, class: 'form-control', id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date + .form-group + = f.label :end_date, "End Date" + = f.text_field :end_date, class: 'form-control', id: 'registration-period-end-datepicker', start_date: @conference.start_date, end_date: @conference.end_date + .form-group + = f.label :description, "Description" + = f.text_area :description, rows: 2, data: { provide: 'markdown' } + %span.help-block + = markdown_hint + - if @cfp.cfp_type == 'events' + .checkbox + %label + = f.check_box :enable_registrations + Allow submitters to request registration? + %p.text-right + = f.submit nil, { class: 'btn btn-success' } diff --git a/app/views/admin/cfps/edit.haml b/app/views/admin/cfps/edit.haml index 2851f823..ea45338e 100644 --- a/app/views/admin/cfps/edit.haml +++ b/app/views/admin/cfps/edit.haml @@ -1 +1,9 @@ -= render 'form', cfp: @cfp, conference: @conference +.row + .col-md-12 + .page-header + %h1 + Call for + = @cfp.cfp_type.capitalize +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/cfps/new.haml b/app/views/admin/cfps/new.haml index 2851f823..ea45338e 100644 --- a/app/views/admin/cfps/new.haml +++ b/app/views/admin/cfps/new.haml @@ -1 +1,9 @@ -= render 'form', cfp: @cfp, conference: @conference +.row + .col-md-12 + .page-header + %h1 + Call for + = @cfp.cfp_type.capitalize +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/commercials/index.html.haml b/app/views/admin/commercials/index.html.haml index 095ddad2..0da9ffef 100644 --- a/app/views/admin/commercials/index.html.haml +++ b/app/views/admin/commercials/index.html.haml @@ -13,10 +13,13 @@ #resource-placeholder{ style: 'background-color:#d3d3d3; float: left; width: 400px; height: 250px; margin: 5px; border-width: 1px; border-style: solid; border-color: rgba(0,0,0,.2);' } .row .col-md-6 - = semantic_form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', autofocus: true }, - hint: 'Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + = form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f| + .form-group + = f.label :url + = f.url_field :url, required: 'required', autofocus: true, class: 'form-control' + %span.help-block + Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr. + = f.submit nil, { class: 'btn btn-primary pull-right', id: 'commercial_submit_action', disabled: true } %hr - @commercials.each_slice(3) do |slice| @@ -29,9 +32,13 @@ = render partial: 'shared/media_item', locals: { commercial: commercial } .caption - if can? :update, commercial - = semantic_form_for commercial, url: admin_conference_commercial_path(conference_id: @conference.short_title, id: commercial) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider' - = f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update' + = form_for commercial, url: admin_conference_commercial_path(conference_id: @conference.short_title, id: commercial) do |f| + .form-group + = f.label :url + = f.url_field :url, id: "commercial_url_#{commercial.id}", required: 'required' + %span.help-block + Just paste the url of your video/photo provider + = f.submit nil, { class: 'btn btn-success' } - if can? :destroy, commercial = link_to 'Delete', admin_conference_commercial_path(@conference.short_title, commercial.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' diff --git a/app/views/admin/conferences/_form_fields.html.haml b/app/views/admin/conferences/_form_fields.html.haml new file mode 100644 index 00000000..ceb72acc --- /dev/null +++ b/app/views/admin/conferences/_form_fields.html.haml @@ -0,0 +1,95 @@ +%h4 + Basic Information +%hr +- if f.object.new_record? + .form-group + = f.label :organization, "Organization" + = f.select :organization_id, Organization.accessible_by(current_ability, :update).pluck(:name, :id) +.form-group + = f.label :title, "Title" + %abbr{title: 'This field is required'} * + = f.text_field :title, required: true, class: 'form-control', placeholder: 'Title' + %span.help-block + The name of your conference as it shall appear throughout the site. Example: 'openSUSE Conference 2013' +.form-group + = f.label :title, "Short Title" + %abbr{title: 'This field is required'} * + = f.text_field :short_title, required: true, pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.', prepend: conferences_url + '/', class: 'form-control', placeholder: 'Short Title' + %span.help-block + A short and unique handle for your conference, using only letters, numbers, underscores, and dashes. This will be used to identify your conference in URLs etc. Example: + %em + froscon2011 +- unless f.object.new_record? # We are showing more fields on the edit form + .form-group + = f.text_area :description, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint('A description of the conference.') + .form-group + = f.color_field :color, size: 6, class: 'form-control' + %span.help-block + The color will be used for the dashboard, for instance. + .form-group + = f.label :picture, 'Conference Logo' + - if f.object.picture? + = image_tag f.object.picture.thumb.url + = f.file_field :picture + %span.help-block + This will be displayed on the front page. + = f.hidden_field :picture_cache + = f.select :ticket_layout, Conference.ticket_layouts.keys, {}, class: 'form-control' + %span.help-block + Layout type for tickets of the conference. + +%h4 + Scheduling +%hr += f.time_zone_select :timezone, nil, { default: 'UTC' }, { class: 'form-control' } +%span.help-block + Please select in what time zone your conference will take place. +.form-group + = f.label :start_date, "Start Date" + %abbr{title: 'This field is required'} * + = f.text_field :start_date, id: 'conference-start-datepicker', required: true, class: 'form-control' +.form-group + = f.label :end_date, "End Date" + %abbr{title: 'This field is required'} * + = f.text_field :end_date, id: 'conference-end-datepicker', required: true, class: 'form-control' +- unless f.object.new_record? # We are showing more fields on the edit form + .form-group + = f.number_field :start_hour, size: 2, min: 0, max: 23, class: 'form-control' + %span.help-block + = rescheduling_hint(@affected_event_count) + .form-group + = f.number_field :end_hour, size: 2, min: 1, max: 24, class: 'form-control' + %span.help-block + = rescheduling_hint(@affected_event_count) + %h4 + Registrations + %hr + .form-group + = f.number_field :registration_limit, in: 0..9999, class: 'form-control' + %span.help-block + Limit the number of registrations to the conference (0 no limit). Please note that the registration limit + does not apply to speakers of confirmed events, they will still be able to register even if the limit has been reached. + You currently have + = pluralize(@conference.registrations.count, 'registration') + %h4 + Booths + %hr + .form-group + = f.number_field :booth_limit, in: 0..9999, class: 'form-control' + %span.help-block + = (t'booth').capitalize + limit is the maximum number of + = (t'booth').pluralize + 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 + = (t'booth').pluralize + than the conference can accommodate. You currently have + = pluralize(@conference.booths.accepted.count, "accepted #{t'booth'}") + '.' +%p.text-right + - if f.object.new_record? + = f.submit nil, { class: 'btn btn-success' } + - else + = f.submit nil, { class: 'btn btn-success', data: { confirm: 'Are you sure you want to proceed?' } } + diff --git a/app/views/admin/conferences/edit.html.haml b/app/views/admin/conferences/edit.html.haml index 456c5f12..4537783f 100644 --- a/app/views/admin/conferences/edit.html.haml +++ b/app/views/admin/conferences/edit.html.haml @@ -6,27 +6,5 @@ The most basic settings of your conference .row .col-md-8 - = 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' - %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.hidden_field :picture_cache - = 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_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 - = f.input :booth_limit, as: :number, in: 0..9999, - hint: "#{(t'booth').capitalize } limit is the maximum number of #{(t'booth').pluralize} 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 #{(t'booth').pluralize} than the conference can accommodate. You currently have " + pluralize(@conference.booths.accepted.count, "accepted #{t'booth'}") +'.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary', data: { confirm: 'Are you sure you want to proceed?' } } + = form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f| + = render partial: 'form_fields', locals: { f: f } diff --git a/app/views/admin/conferences/new.html.haml b/app/views/admin/conferences/new.html.haml index 9e115457..2d2ea53e 100644 --- a/app/views/admin/conferences/new.html.haml +++ b/app/views/admin/conferences/new.html.haml @@ -1,15 +1,4 @@ .row .col-md-8 - = semantic_form_for(@conference, url: admin_conferences_path) do |f| - = f.inputs 'Basic Information' do - = f.input :organization, as: :select, collection: @organizations - = f.input :title, hint: "The name of your conference as it shall appear throughout the site. Example: 'OpenSUSE Conference 2013'", - input_html: { required: 'required' } - = f.input :short_title, hint: "A short and unique handle for your conference, using only letters, numbers, underscores, and dashes. This will be used to identify your conference in URLs etc. Example: 'froscon2011'", - input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }, prepend: conferences_url + '/' - = f.inputs 'Scheduling' do - = f.input :timezone, as: :time_zone, default: Time.zone.name, hint: 'Please select in what time zone your conference will take place.' - = f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', required: 'required' } - = f.input :end_date, as: :string, input_html: { id: 'conference-end-datepicker', required: 'required' } - = f.actions do - = f.action :submit, button_html: {class: 'btn btn-success pull-right'} + = form_for(@conference, url: admin_conferences_path) do |f| + = render partial: 'form_fields', locals: { f: f } diff --git a/app/views/admin/contacts/edit.html.haml b/app/views/admin/contacts/edit.html.haml index c242a01f..1a67342c 100644 --- a/app/views/admin/contacts/edit.html.haml +++ b/app/views/admin/contacts/edit.html.haml @@ -6,17 +6,53 @@ How people can contact you .row .col-md-8 - = semantic_form_for(@contact, url: admin_conference_contact_path(@conference.short_title), html: {multipart: true}) do |f| - = f.inputs name: 'Mail' do - = f.input :email, input_html: { autofocus: true }, hint: 'Contact email address for your conference. Will be used as reply-to address in emails sent out by the system.' - = f.input :sponsor_email, hint: 'This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers' - = f.inputs name: 'Social Media' do - = f.input :social_tag, hint: "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'" - = f.input :blog, hint: 'This will appear in the social media section as a link to your conference blog.' - = f.input :facebook, hint: 'This will appear in the social media section as a link to the Facebook page of your Conference' - = f.input :googleplus, label: 'Google+ Url', hint: 'This will appear in the social media section as a link to the Google+ Page of your Conference' - = f.input :twitter, hint: 'This will appear in the social media section as a link to the Twitter Page of your Conference' - = f.input :instagram, hint: 'This will appear in the social media section as a link to the Instagram Page of your Conference' - = f.input :mastodon, hint: 'This will appear in the social media section as a link to the Mastodon Page of your Conference' - = f.input :youtube, hint: 'This will appear in the social media section as a link to the YouTube channel for your conference.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = form_for(@contact, url: admin_conference_contact_path(@conference.short_title), html: {multipart: true}) do |f| + %h4 + Mail + %hr + .form-group + = f.label :email + = f.email_field :email, autofocus: true, class: 'form-control' + %span.help-block + Contact email address for your conference. Will be used as reply-to address in emails sent out by the system. + = f.label :sponsor_email + = f.email_field :sponsor_email, class: 'form-control' + %span.help-block + This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers. + %h4 + Social Media + %hr + .form-group + = f.label :social_tag + = f.text_field :social_tag, class: 'form-control' + %span.help-block + The hashtag you'll use on Twitter and Google+. Don't include the '#' sign! + = f.label :blog, 'Blog URL' + = f.url_field :blog, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to your conference blog. + = f.label :facebook, 'Facebook URL' + = f.url_field :facebook, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Facebook page of your Conference' + = f.label :googleplus, 'Google+ URL' + = f.url_field :googleplus, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Google+ Page of your Conference' + = f.label :twitter, 'Twitter URL' + = f.url_field :twitter, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Twitter Page of your Conference' + = f.label :instagram, 'Insta URL' + = f.url_field :instagram, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Instagram Page of your Conference + = f.label :mastodon, 'Mastodon URL' + = f.url_field :mastodon, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Mastodon Page of your Conference + = f.label :youtube, 'Youtube URL' + = f.url_field :youtube, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the YouTube channel for your conference. + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/difficulty_levels/_form.html.haml b/app/views/admin/difficulty_levels/_form.html.haml index f28ab7e3..0f3b40b9 100644 --- a/app/views/admin/difficulty_levels/_form.html.haml +++ b/app/views/admin/difficulty_levels/_form.html.haml @@ -1,16 +1,13 @@ -.row - .col-md-12 - .page-header - %h1 - - if @difficulty_level.new_record? - New - Difficulty Level - = @difficulty_level.title -.row - .col-md-8 - = semantic_form_for(@difficulty_level, url: (@difficulty_level.new_record? ? admin_conference_program_difficulty_levels_path : admin_conference_program_difficulty_level_path(@conference.short_title, @difficulty_level))) do |f| - = f.input :title, input_html: { autofocus: true }, required: true - = f.input :description, input_html: {rows: 3, class: 'span6'} - = f.input :color, input_html: {size: 6, type: 'color'} - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@difficulty_level, url: (@difficulty_level.new_record? ? admin_conference_program_difficulty_levels_path : admin_conference_program_difficulty_level_path(@conference.short_title, @difficulty_level))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true , required: true, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 3, class: 'span6 form-control' + .form-group + = f.label :color + = f.color_field :color, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/difficulty_levels/edit.html.haml b/app/views/admin/difficulty_levels/edit.html.haml new file mode 100644 index 00000000..baec7d47 --- /dev/null +++ b/app/views/admin/difficulty_levels/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Difficulty Level + = @difficulty_level.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/difficulty_levels/new.html.haml b/app/views/admin/difficulty_levels/new.html.haml new file mode 100644 index 00000000..6d8fc4de --- /dev/null +++ b/app/views/admin/difficulty_levels/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Difficulty Level +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/emails/index.html.haml b/app/views/admin/emails/index.html.haml index 97946a75..48f19a89 100644 --- a/app/views/admin/emails/index.html.haml +++ b/app/views/admin/emails/index.html.haml @@ -1,6 +1,6 @@ .row .col-md-8 - = semantic_form_for(@settings, url: admin_conference_email_path(@conference.short_title, @conference.email_settings), html: {multipart: true}) do |f| + = form_for(@settings, url: admin_conference_email_path(@conference.short_title, @conference.email_settings), html: {multipart: true}) do |f| .row .col-md-12 %div{ role: 'tabpanel' } @@ -19,43 +19,77 @@ / Tab panes .tab-content #onboarding.tab-pane.active{ role: 'tabpanel' } - = f.input :send_on_registration, label: 'Send an email when the user registers for the conference?', input_html: {'data-name' => 'email_settings_registration_subject', 'class' => 'send_on_radio'} - = f.input :registration_subject - = f.input :registration_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_registration, data: {name: 'email_settings_registration_subject'}, class: 'send_on_radio' + Send an email when the user registers for the conference? + .form-group + = f.label :registration_subject, 'Subject' + = f.text_field :registration_subject, class: 'form-control' + .form-group + = f.label :registration_body, 'Body' + = f.text_area :registration_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_registration_subject', 'data-subject-text' => 'Thank you for registering', 'data-body-input-id' => 'email_settings_registration_body', 'data-body-text' => "Dear {name},\n\nThank you for Registering for the conference {conference}.\nPlease complete your registration by filling out your travel information.\n\nIf you are unable to attend please unregister online:\n{registrationlink}\n\nFeel free to contact us with any questions or concerns.\nWe look forward to see you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'registration_help' } Show Help = render partial: 'help', locals: { id: 'registration_help', show_event_variables: false } #proposal.tab-pane{ role: 'tabpanel' } - = f.input :send_on_submitted_proposal, label: 'Send an email when the proposal is submitted', input_html: { 'data-name' => 'email_settings_proposal_submited_subject', 'class' => 'send_on_radio' } - = f.input :submitted_proposal_subject - = f.input :submitted_proposal_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_submitted_proposal, data: { name: 'email_settings_proposal_submited_subject'}, class: 'send_on_radio' + Send an email when the proposal is submitted + .form-group + = f.label :submitted_proposal_subject, 'Subject' + = f.text_field :submitted_proposal_subject, class: 'form-control' + .form-group + = f.label :submitted_proposal_body, 'Body' + = f.text_area :submitted_proposal_body, input_html: { rows: 10, cols: 20 }, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_submitted_proposal_subject', 'data-subject-text' => 'Your proposal has been submitted successfully', 'data-body-input-id' => 'email_settings_submitted_proposal_body', 'data-body-text' => "Dear {name}\n\nThank you for submitting your proposal {eventtitle}.\n\nOur team will review it and get back to you as soon as possible.\n\nFeel free to contact us with any questions or concerns.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'submitted_proposal_help' } Show Help = render partial: 'help', locals: { id: 'submitted_proposal_help', show_event_variables: true } - - = f.input :send_on_accepted, label: 'Send an email when the proposal is accepted?', input_html: { 'data-name' => 'email_settings_accepted_subject', 'class' => 'send_on_radio' } - = f.input :accepted_subject - = f.input :accepted_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_accepted, data: { name: 'email_settings_accepted_subject' }, class: 'send_on_radio' + Send an email when the proposal is accepted? + .form-group + = f.label :accepted_subject, 'Subject' + = f.text_field :accepted_subject, class: 'form-control' + .form-group + = f.label :accepted_body, 'Body' + = f.text_area :accepted_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_accepted_subject', 'data-subject-text' => 'Your submission has been accepted', 'data-body-input-id' => 'email_settings_accepted_body', 'data-body-text' => "Dear {name}\n\nWe are very pleased to inform you that your submission {eventtitle} has been accepted for the conference {conference}.\n\nThe public page of your submission can be found at:\n{proposalslink}\nIf you haven“t already registered for {conference}, please do as soon as possible:\n{registrationlink}\n\nFeel free to contact us with any questions or concerns.\n\nWe look forward to seeing you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'accepted_help' } Show Help = render partial: 'help', locals: { id: 'accepted_help', show_event_variables: true } - = f.input :send_on_rejected, label: 'Send an email when the proposal is rejected?', input_html: { 'data-name' => 'email_settings_rejected_subject', 'class' => 'send_on_radio' } - = f.input :rejected_subject - = f.input :rejected_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_rejected, data: { name: 'email_settings_rejected_subject'}, class: 'send_on_radio' + Send an email when the proposal is rejected? + .form-group + = f.label :rejected_subject, 'Subject' + = f.text_field :rejected_subject, class: 'form-control' + .form-group + = f.label :rejected_body, 'Body' + = f.text_area :rejected_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_rejected_subject', 'data-subject-text' => 'Your submission has been rejected', 'data-body-input-id' => 'email_settings_rejected_body', 'data-body-text' => "Dear {name},\n\nThank you for your submission {eventtitle} for the conference {conference}.\nAfter careful consideration we are sorry to inform you that your submission has been rejected.\n\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'rejected_help' } Show Help = render partial: 'help', locals: {id: 'rejected_help', show_event_variables: true} - = f.input :send_on_confirmed_without_registration, label: "Send an email when a user has a confirmed proposal, but isn't yet registered?", input_html: {'data-name' => 'email_settings_confirmed_without_registration_subject', 'class' => 'send_on_radio'} - = f.input :confirmed_without_registration_subject - = f.input :confirmed_without_registration_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_confirmed_without_registration, data: {name: 'email_settings_confirmed_without_registration_subject'}, class: 'send_on_radio' + Send an email when a user has a confirmed proposal, but isn't yet registered? + .form-group + = f.label :confirmed_without_registration_subject, 'Subject' + = f.text_field :confirmed_without_registration_subject, class: 'form-control' + .form-group + = f.label :confirmed_without_registration_body, 'Body' + = f.text_area :confirmed_without_registration_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_confirmed_without_registration_subject', 'data-subject-text' => 'Your proposal has been confirmed without registration', 'data-body-input-id' => 'email_settings_confirmed_without_registration_body', @@ -63,27 +97,48 @@ %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'confirmed_help' } Show Help = render partial: 'help', locals: {id: 'confirmed_help', show_event_variables: true} #notifications.tab-pane{ role: 'tabpanel' } - = f.input :send_on_conference_dates_updated, label: 'This is to notify all participants that the conference dates has been changed.', input_html: { 'data-name' => 'email_settings_conference_dates_updated_subject', 'class' => 'send_on_radio' } - = f.input :conference_dates_updated_subject - = f.input :conference_dates_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_conference_dates_updated, data: { name: 'email_settings_conference_dates_updated_subject'}, class: 'send_on_radio' + Send an email when to all participants if the conference dates are changed? + .form-group + = f.label :conference_dates_updated_subject, 'Subject' + = f.text_field :conference_dates_updated_subject, class: 'form-control' + .form-group + = f.label :conference_dates_updated_body, 'Body' + = f.text_area :conference_dates_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_conference_dates_updated_subject', 'data-subject-text' => 'The dates of the conference have changed', 'data-body-input-id' => 'email_settings_conference_dates_updated_body', 'data-body-text' => "Dear {name},\n\nThe date of {conference} has changed.\n New Dates : {conference_start_date} - {conference_end_date}.\n\nFeel free to contact us with any questions or concerns.\n\nWe look forward to seeing you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_dates_help' } Show Help = render partial: 'help', locals: {id: 'updated_dates_help', show_event_variables: false} - = f.input :send_on_conference_registration_dates_updated, label: 'This is to notify all participants that the conference registration dates has been changed.', input_html: {'data-name' => 'email_settings_conference_registration_dates_updated_subject', 'class' => 'send_on_radio'} - = f.input :conference_registration_dates_updated_subject - = f.input :conference_registration_dates_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_conference_registration_dates_updated, data: { name: 'email_settings_conference_registration_dates_updated_subject' }, class: 'send_on_radio' + Send an email when to all participants if the conference registration dates changed? + .form-group + = f.label :conference_registration_dates_updated_subject, 'Subject' + = f.text_field :conference_registration_dates_updated_subject, class: 'form-control' + .form-group + = f.label :conference_registration_dates_updated_body, 'Body' + = f.text_area :conference_registration_dates_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_conference_registration_dates_updated_subject', 'data-subject-text' => 'The registration dates have changed', 'data-body-input-id' => 'email_settings_conference_registration_dates_updated_body', 'data-body-text' => "Dear {name},\n\nThe registration date of {conference} has changed.\n New Dates : {registration_start_date} - {registration_end_date}.\n\nFeel free to contact us with any questions or concerns.\n\nWe look forward to seeing you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_registrations_dates_help' } Show Help = render partial: 'help', locals: {id: 'updated_registrations_dates_help', show_event_variables: false} - = f.input :send_on_venue_updated, label: 'Send an email on updating the Venue.', input_html: { 'data-name' => 'email_settings_venue_updated_subject', 'class' => 'send_on_radio' } - = f.input :venue_updated_subject - = f.input :venue_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_venue_updated, data: { name: 'email_settings_venue_updated_subject'}, class: 'send_on_radio' + Send an email on updating the Venue? + .form-group + = f.label :venue_updated_subject, 'Subject' + = f.text_field :venue_updated_subject, class: 'form-control' + .form-group + = f.label :venue_updated_body, 'Body' + = f.text_area :venue_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_venue_updated_subject', 'data-subject-text' => 'The venue has changed', 'data-body-input-id' => 'email_settings_venue_updated_body', @@ -91,18 +146,32 @@ %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_venue_help' } Show Help = render partial: 'help', locals: {id: 'updated_venue_help', show_event_variables: false} #cfp.tab-pane{ role: 'tabpanel' } - = f.input :send_on_program_schedule_public, hint: 'This will notify all participants when the dates are updated or when the schedule is made public' - = f.input :program_schedule_public_subject, hint: 'This subject will used whenever dates are updated or when the schedule is made public' - = f.input :program_schedule_public_body, input_html: { rows: 10, cols: 20 } + .checkbox + %labl + = f.check_box :send_on_program_schedule_public + Send an email when to all participants if the schedule is made public? + .form-group + = f.label :program_schedule_public_subject, 'Subject' + = f.text_field :program_schedule_public_subject, class: 'form-control' + .form-group + = f.label :program_schedule_public_body, 'Body' + = f.text_area :program_schedule_public_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_program_schedule_public_subject', 'data-subject-text' => 'The schedule has been released', 'data-body-input-id' => 'email_settings_program_schedule_public_body', 'data-body-text' => "Dear {name},\n\nThe schedule for {conference} has been announced.\nLink to Schedule {schedule_link}\n\nBest wishes\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_cfp_help' } Show Help = render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false} - = f.input :send_on_cfp_dates_updated, hint: 'This will notify all participants when the dates are updated or when the schedule is made public' - = f.input :cfp_dates_updated_subject, hint: 'This subject will used whenever dates are updated or when the schedule is made public' - = f.input :cfp_dates_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_cfp_dates_updated + Send an email when to all participants if call for paper dates are updated? + .form-group + = f.label :cfp_dates_updated_subject, 'Subject' + = f.text_field :cfp_dates_updated_subject, class: 'form-control' + .form-group + = f.label :cfp_dates_updated_body, 'Body' + = f.text_area :cfp_dates_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_cfp_dates_updated_subject', 'data-subject-text' => 'The Call for Papers dates have changed', 'data-body-input-id' => 'email_settings_cfp_dates_updated_body', @@ -110,18 +179,30 @@ %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_cfp_help' } Show Help = render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false} #booth.tab-pane{ role: 'tabpanel' } - = f.input :send_on_booths_acceptance - = f.input :booths_acceptance_subject - = f.input :booths_acceptance_body, input_html: { rows:10, cols: 20 } + .check_box + %label + = f.check_box :send_on_booths_acceptance + .form-group + = f.label :booths_acceptance_subject, 'Subject' + = f.text_field :booths_acceptance_subject, class: 'form-control' + .form-group + = f.label :booths_acceptance_body, 'Body' + = f.text_area :booths_acceptance_body, rows:10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_booths_acceptance_subject', 'data-subject-text' => "Your #{t'booth'} has been accepted!", 'data-body-input-id' => 'email_settings_booths_acceptance_body', 'data-body-text' => "Dear {name},\n\nWe are pleased to inform you that your #{t'booth'} request {booth_title} has been accepted for the conference {conference}.\nPlease click the confirm button to let us know you can make it as soon as possible!\n\nFeel free to contact us with any questions or concerns.\n\nWe are looking forward to seeing you there.\n\nBest wishes\n\n{conference} Team"} Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'booth_acceptance_help' } Show help = render partial: 'help', locals: {id: 'booth_acceptance_help', show_event_variables: false} - = f.input :send_on_booths_rejection - = f.input :booths_rejection_subject - = f.input :booths_rejection_body, input_html: { rows:10, cols:20 } + .checkbox + %label + = f.check_box :send_on_booths_rejection + .form-group + = f.label :booths_rejection_subject, 'Subject' + = f.text_field :booths_rejection_subject, class: 'form-control' + .form-group + = f.label :booths_rejection_body, 'Body' + = f.text_area :booths_rejection_body, rows:10, cols:20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_booths_rejection_subject', 'data-subject-text' => "Your #{t'booth'} request has been rejected", 'data-body-input-id' => 'email_settings_booths_rejection_body', @@ -131,4 +212,4 @@ .row .col-md-12 - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/event_types/_form.html.haml b/app/views/admin/event_types/_form.html.haml index 29fac398..813474c3 100644 --- a/app/views/admin/event_types/_form.html.haml +++ b/app/views/admin/event_types/_form.html.haml @@ -1,19 +1,29 @@ -.row - .col-md-12 - .page-header - %h1 - - if @event_type.new_record? - New - Event Type - = @event_type.title -.row - .col-md-12 - = semantic_form_for(@event_type, url: (@event_type.new_record? ? admin_conference_program_event_types_path : admin_conference_program_event_type_path(@conference.short_title, @event_type))) do |f| - = f.input :title, input_html: { autofocus: true } - = f.input :length, input_html: {size: 3, type: 'number', step: @event_type.program.schedule_interval, min: @event_type.program.schedule_interval} - = f.input :description - = f.input :minimum_abstract_length, input_html: {size: 3} - = f.input :maximum_abstract_length, input_html: {size: 3} - = f.input :color, input_html: { size: 6, type: 'color' } - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@event_type, url: (@event_type.new_record? ? admin_conference_program_event_types_path : admin_conference_program_event_type_path(@conference.short_title, @event_type))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true, required: true, class: 'form-control' + .form-group + = f.label :length + = f.number_field :length, size: 3, step: @event_type.program.schedule_interval, min: @event_type.program.schedule_interval, class: 'form-control' + %span.help-block + In steps of + = @event_type.program.schedule_interval + and minimum + = @event_type.program.schedule_interval + .form-group + = f.label :description + = f.text_field :description, class: 'form-control' + .form-group + = f.label :minimum_abstract_length + %abbr{title: 'This field is required'} * + = f.number_field :minimum_abstract_length, size: 3, required: true, class: 'form-control' + .form-group + = f.label :maximum_abstract_length + %abbr{title: 'This field is required'} * + = f.number_field :maximum_abstract_length, size: 3, required: true, class: 'form-control' + .form-group + = f.label :color + = f.color_field :color, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/event_types/edit.html.haml b/app/views/admin/event_types/edit.html.haml new file mode 100644 index 00000000..ebf17c09 --- /dev/null +++ b/app/views/admin/event_types/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Event Type + = @event_type.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/event_types/new.html.haml b/app/views/admin/event_types/new.html.haml new file mode 100644 index 00000000..a106ce43 --- /dev/null +++ b/app/views/admin/event_types/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Event Type +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/events/_nested_comments.html.haml b/app/views/admin/events/_nested_comments.html.haml index 0bfb440c..41165fd1 100644 --- a/app/views/admin/events/_nested_comments.html.haml +++ b/app/views/admin/events/_nested_comments.html.haml @@ -6,8 +6,9 @@ %div %a.pull-right.comment-reply-link{ href: '#' } Reply .comment-reply - = semantic_form_for :comment, url: comment_admin_conference_program_event_path(@conference.short_title, comment.commentable_id), method: :post do |f| - = f.input :body + = form_for :comment, url: comment_admin_conference_program_event_path(@conference.short_title, comment.commentable_id), method: :post do |f| + .form-group + = f.text_area :body, class: 'form-control' %input{ name: 'parent', type: 'hidden', value: comment.id } %input{ name: 'authenticity_token', type: 'hidden', value: '#{form_authenticity_token}' } %button.btn.btn-primary.pull-right{ name: 'button', type: 'submit' } Add Reply diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 999313b7..12f0efb6 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -122,17 +122,19 @@ - cache [@conference, @event, @comments] do .row - = link_to "Comments (#{@comment_count})", '#', id: 'event-comment-link' - #comments-div + .col-md-12 + %h4 + Comments + = "(#{@comment_count})" + = link_to('#comment-collapse', class: 'btn btn-link', role: 'button', data: {toggle: "collapse" }) do + Show %hr - %ul.media - %div - .row-fluid - = semantic_form_for :comment, url: comment_admin_conference_program_event_path(@conference.short_title, @event.id), method: :post do |f| - = f.input :body - = f.submit 'Add Comment', class: 'btn btn-primary pull-right' - %br - %br - - @comments.each do |comment| - %div - = render partial: 'nested_comments', locals: { comment: comment, padding: 0} + .collapse#comment-collapse + - @comments.each do |comment| + = render partial: 'nested_comments', locals: { comment: comment, padding: 0} + = form_for(:comment, url: comment_admin_conference_program_event_path(@conference.short_title, @event.id), method: :post) do |f| + .form-group + = f.text_area :body, class: 'form-control' + .text-right + = f.submit nil, class: 'btn btn-primary' + diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 4944d946..eda41a3f 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -28,21 +28,21 @@ .modal-dialog .modal-content .modal-header - %h1 Add commercials to events - .text-muted - Upload your file with data in the following format: - %b Event_ID:Commercial_Link - , eg. - %br - %b 11:https://youtube.com/myvideo - + %h1 + Add commercials to events .modal-body - = semantic_form_for '', - url: mass_upload_commercials_admin_conference_program_path(@conference.short_title), - method: :post do |f| - = f.input 'file', as: :file + = form_for('', url: mass_upload_commercials_admin_conference_program_path(@conference.short_title), method: :post) do |f| + .form-group + = f.file_field 'file', as: :file + %span.help-block + Upload your file with data in the following format: + %b Event_ID:Commercial_Link + for instance: + %pre + 11:https://youtube.com/myvideo + 23:https://vimeo.com/myvideo .modal-footer - = f.submit 'Add', class: 'btn btn-primary' + = f.submit nil, class: 'btn btn-primary' .row .col-md-4 = render 'donut_chart', title: 'Events state', diff --git a/app/views/admin/lodgings/_form.html.haml b/app/views/admin/lodgings/_form.html.haml index 8d5ba82e..a0fae78a 100644 --- a/app/views/admin/lodgings/_form.html.haml +++ b/app/views/admin/lodgings/_form.html.haml @@ -1,19 +1,20 @@ -.row - .col-md-12 - .page-header - %h1 - - if @lodging.new_record? - New - Lodging - = @lodging.name -.row - .col-md-8 - = semantic_form_for(@lodging, url: (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f| - = f.input :name, input_html: { autofocus: true} - = f.input :website_link, input_html: { type: :url } - = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint - - if @lodging.picture? - = image_tag @lodging.picture.thumb.url - = f.input :picture - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@lodging, url: (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, require: true, autofocus: true, class: 'form-control' + .form-group + = f.label :website_link + = f.url_field :website_link, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, cols: 20, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint + .form-group + - if @lodging.picture? + = image_tag @lodging.picture.thumb.url + = f.label :picture + = f.file_field :picture, class: 'form-control' + %p.text-right + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/lodgings/edit.html.haml b/app/views/admin/lodgings/edit.html.haml new file mode 100644 index 00000000..2a62cc01 --- /dev/null +++ b/app/views/admin/lodgings/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Lodging + = @lodging.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/lodgings/new.html.haml b/app/views/admin/lodgings/new.html.haml new file mode 100644 index 00000000..23a97b03 --- /dev/null +++ b/app/views/admin/lodgings/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Lodging +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/organizations/_form.html.haml b/app/views/admin/organizations/_form.html.haml index 9e8db2a1..13544440 100644 --- a/app/views/admin/organizations/_form.html.haml +++ b/app/views/admin/organizations/_form.html.haml @@ -1,20 +1,22 @@ -= semantic_form_for(@organization, url: (@organization.new_record? ? admin_organizations_path : admin_organization_path(@organization))) do |f| - = f.inputs name: 'Organization details' do - = f.input :name, as: :string, required: true - = f.input :description, as: :text, - input_html: { rows: 10, data: { provide: 'markdown' } }, - hint: markdown_hint, - placeholder: 'Decribe about your organization...' - = f.input :code_of_conduct, as: :text, - input_html: { rows: 10, data: { provide: 'markdown' } }, - hint: markdown_hint, - placeholder: 'Rules governing behavior and dispute resolution...' += form_for(@organization, url: (@organization.new_record? ? admin_organizations_path : admin_organization_path(@organization))) do |f| + .form-group + = f.label :name, "Name" + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, class: 'form-control', placeholder: 'Name' + .form-group + = f.text_area :description, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Decribe about your organization...' + %span.help-block + = markdown_hint + .form-group + = f.text_area :code_of_conduct, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Rules governing behavior and dispute resolution...' + %span.help-block + = markdown_hint + .form-group = image_tag f.object.picture.thumb.url if f.object.picture? - - if @organization.picture? - = image_tag(@organization.picture.thumb.url, width: '20%') - = f.input :picture + = f.file_field :picture %p.text-right - - if @organization.new_record? - = f.submit 'Create Organization', class: 'btn btn-success' - - else - = f.submit 'Update Organization', class: 'btn btn-success' + %button{type: 'submit', class: 'btn btn-success'} + - if @organization.new_record? + Create Organization + - else + Update Organization diff --git a/app/views/admin/organizations/edit.html.haml b/app/views/admin/organizations/edit.html.haml new file mode 100644 index 00000000..c9d69bcd --- /dev/null +++ b/app/views/admin/organizations/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Organization + = @organization.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/organizations/new.html.haml b/app/views/admin/organizations/new.html.haml new file mode 100644 index 00000000..b38ea937 --- /dev/null +++ b/app/views/admin/organizations/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Organization +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/organizations/show_org_admins.haml b/app/views/admin/organizations/show_org_admins.haml index 7fe1f943..5c7698db 100644 --- a/app/views/admin/organizations/show_org_admins.haml +++ b/app/views/admin/organizations/show_org_admins.haml @@ -8,15 +8,11 @@ .row.col-md-3 - if ( can? :assign_org_admins, @organization ) - = semantic_form_for :user, - url: assign_org_admins_admin_organization_path(@organization, - @role.name), method: :post do |u| - - = u.label 'Add user by email: ' - .input-group - = u.input :email, label: false, placeholder: "User's email" - .input-group-btn - = u.submit 'Add', id: 'user-add', class: 'btn btn-primary' + = form_for :user, url: assign_org_admins_admin_organization_path(@organization, @role.name), method: :post do |f| + .form-group + = f.label :email, 'Add user by email: ' + = f.text_field :email, placeholder: "User's email", class: 'form-control', required: true + = f.submit 'Add', id: 'user-add', class: 'btn btn-primary' .row .col-md-12 diff --git a/app/views/admin/programs/_form.html.haml b/app/views/admin/programs/_form.html.haml index c158453a..037418bf 100644 --- a/app/views/admin/programs/_form.html.haml +++ b/app/views/admin/programs/_form.html.haml @@ -1,17 +1,51 @@ -.row - .col-md-12 - .page-header - %h1 Program -.row - .col-md-8 - = semantic_form_for(@program, url: admin_conference_program_path(@conference.short_title), html: {multipart: true}) do |f| - = f.input :schedule_public, label: 'Show Schedule on the home and splash page' - = f.input :schedule_fluid, label: 'Allow submitters to change their event after it is scheduled' - = 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 :languages, hint: "Enter the languages allowed for events as values of #{link_to('ISO 639-1', 'http://www.loc.gov/standards/iso639-2/php/code_list.php', target: "_blank")} language codes separated with commas. The first language would be the default language. Leave it blank if you do not want to specify languages.".html_safe - = f.input :schedule_interval, input_html: { autofocus: true }, hint: "It is the minimal time interval of your schedule. The value should be 5, 6, 10, 12, 15, 20, 30 or 60. Warning! Some events could be unscheduled when changing this value." - = f.input :blind_voting, hint: 'Enable this feature if you do not want to show voting results and voters prior to user submitting a vote. For the feature to work you need to set the voting dates below as well' - = f.input :voting_start_date, as: :string, input_html: { id: 'datetimepicker-voting_start_date', value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?) } - = f.input :voting_end_date, as: :string, input_html: { id: 'datetimepicker-voting_end_date', value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?) } - %p.text-right - = f.action :submit, as: :button, button_html: {class: 'btn btn-primary'} += form_for(@program, url: admin_conference_program_path(@conference.short_title), html: {multipart: true}) do |f| + .checkbox + %label + = f.check_box :schedule_public + Show Schedule on the home and splash page + .checkbox + %label + = f.check_box :schedule_fluid + Allow submitters to change their event after it is scheduled + %h4 + Voting + %hr + .form-group + = f.label :rating + = f.number_field :rating, class: 'form-control' + %span.help-block + 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. + .checkbox + %label + = f.check_box :blind_voting + Enable blind voting + %span.help-block + If you do not want to show other peoples votes prior to submitting a vote. + For the feature to work you need to set the voting dates below as well + .form-group + = f.label :voting_start_date + = f.text_field :voting_start_date, id: 'datetimepicker-voting_start_date', value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?), class: 'form-control' + = f.label :voting_end_date + = f.text_field :voting_end_date, id: 'datetimepicker-voting_end_date', value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?), class: 'form-control' + %h4 + Languages + %hr + %p + Current Languages: + - if f.object.languages.present? + = f.object.languages_list.to_sentence + - else + Any Language + .form-group + = f.label :languages + = f.select :languages, I18nData.languages.invert, { include_blank: 'Any Language', include_hidden: false }, { multiple: true, class: 'form-control' } + %span.help-block + The languages allowed for events. + .form-group + = f.number_field :schedule_interval, autofocus: true, class: 'form-control' + %span.help-block + It is the minimal time interval of your schedule. The value should be 5, 6, 10, 12, 15, 20, 30 or 60. + Warning! Some events could be unscheduled when changing this value. + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/programs/edit.html.haml b/app/views/admin/programs/edit.html.haml new file mode 100644 index 00000000..8d2be031 --- /dev/null +++ b/app/views/admin/programs/edit.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Program +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/programs/new.html.haml b/app/views/admin/programs/new.html.haml new file mode 100644 index 00000000..a607a890 --- /dev/null +++ b/app/views/admin/programs/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Program +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/programs/show.html.haml b/app/views/admin/programs/show.html.haml index eceb21c5..db1e91ff 100644 --- a/app/views/admin/programs/show.html.haml +++ b/app/views/admin/programs/show.html.haml @@ -34,7 +34,10 @@ %dt Languages: %dd - = @program.languages + - if @program.languages.present? + = @program.languages_list.to_sentence + - else + Any Language %dt Public Schedule %dd#schedule_public diff --git a/app/views/admin/questions/_answer_fields.html.haml b/app/views/admin/questions/_answer_fields.html.haml index 5bffc9bc..e650995e 100644 --- a/app/views/admin/questions/_answer_fields.html.haml +++ b/app/views/admin/questions/_answer_fields.html.haml @@ -1,4 +1,3 @@ .nested-fields - = f.inputs do - = f.input :title - = remove_association_link :answer, f + = f.text_field :title + = remove_association_link :answer, f diff --git a/app/views/admin/questions/_form.html.haml b/app/views/admin/questions/_form.html.haml index abefd902..75326bf4 100644 --- a/app/views/admin/questions/_form.html.haml +++ b/app/views/admin/questions/_form.html.haml @@ -1,10 +1,17 @@ .row .col-md-6 %legend Question - = f.input :title, label: 'Your Question' - = f.input :question_type - = f.input :global, label: 'Make Global', - hint: '(Global questions are available for selection to all conferences)' + .form-group + = f.label :title, 'Your Question' + = f.text_field :title, class: 'form-control' + .form-group + = f.select :question_type_id, QuestionType.all.pluck(:title, :id), {}, { class: 'form-control' } + .checkbox + %label + = f.check_box :global + Make Global + %span.help-block + Global questions are available for selection to all conferences .col-md-6.hidden{id: 'answers_col'} = dynamic_association :answers, 'Answers', f, hint: 'Insert your answers in the order you want them to appear' diff --git a/app/views/admin/questions/edit.html.haml b/app/views/admin/questions/edit.html.haml index 4b261f38..31aa35a1 100644 --- a/app/views/admin/questions/edit.html.haml +++ b/app/views/admin/questions/edit.html.haml @@ -2,8 +2,6 @@ Edit Question %h3 "#{@question.title}" -= semantic_form_for(@question, url: admin_conference_question_path(@conference.short_title, @question.id)) do |f| - += form_for(@question, url: admin_conference_question_path(@conference.short_title, @question.id)) do |f| = render partial: 'form', locals: {f: f} - = f.submit 'Save', class: 'btn btn-primary', confirm: 'Are you sure you want to make these changes?' diff --git a/app/views/admin/questions/index.html.haml b/app/views/admin/questions/index.html.haml index f69d2846..6d2d187c 100644 --- a/app/views/admin/questions/index.html.haml +++ b/app/views/admin/questions/index.html.haml @@ -11,7 +11,7 @@ .row .col-md-12 - if @questions.count > 0 - = semantic_form_for(@conference, url: update_conference_admin_conference_questions_path(@conference.short_title)) do |f| + = form_for(@conference, url: update_conference_admin_conference_questions_path(@conference.short_title)) do |f| .questions{id: 'myquestions'} = render partial: 'questions' - if can? :update, Question.new(conference_id: @conference.id) @@ -25,7 +25,7 @@ %h3{id: 'new-question-header'} Add new question .modal-body - = semantic_form_for(@new_question, url: admin_conference_questions_path(@conference.short_title), method: :post) do |f| + = form_for(@new_question, url: admin_conference_questions_path(@conference.short_title), method: :post) do |f| = render partial: 'form', locals: {f: f} %button{class: 'btn btn-primary'} Save diff --git a/app/views/admin/registration_periods/_form.html.haml b/app/views/admin/registration_periods/_form.html.haml index c3d3c86c..35b996b1 100644 --- a/app/views/admin/registration_periods/_form.html.haml +++ b/app/views/admin/registration_periods/_form.html.haml @@ -1,11 +1,11 @@ -.row - .col-md-12 - .page-header - %h1 Registration Period -.row - .col-md-8 - = semantic_form_for(@registration_period, url: admin_conference_registration_period_path(@conference.short_title)) do |f| - = f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date } - = f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker' } - %p.text-right - = f.submit 'Save Registration Period', class: 'btn btn-primary' += form_for(@registration_period, url: admin_conference_registration_period_path(@conference.short_title)) do |f| + .form-group + = f.label :start_date + %abbr{title: 'This field is required'} * + = f.text_field :start_date, required: true, 'data-end-conference': @conference.end_date.to_s, id: 'registration-period-start-datepicker', class: 'form-control' + .form-group + = f.label :end_date + %abbr{title: 'This field is required'} * + = f.text_field :end_date, required: true, id: 'registration-period-end-datepicker', class: 'form-control' + %p.text-right + = f.submit 'Save Registration Period', class: 'btn btn-primary' diff --git a/app/views/admin/registration_periods/edit.html.haml b/app/views/admin/registration_periods/edit.html.haml new file mode 100644 index 00000000..df1967c1 --- /dev/null +++ b/app/views/admin/registration_periods/edit.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Registration Period +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/registration_periods/new.html.haml b/app/views/admin/registration_periods/new.html.haml new file mode 100644 index 00000000..05af3751 --- /dev/null +++ b/app/views/admin/registration_periods/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Registration Period +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/registrations/edit.html.haml b/app/views/admin/registrations/edit.html.haml index b9b99769..0301d010 100644 --- a/app/views/admin/registrations/edit.html.haml +++ b/app/views/admin/registrations/edit.html.haml @@ -7,12 +7,20 @@ = link_to 'Edit User', edit_admin_user_path(@user), class: 'btn btn-primary pull-right' if can? :edit, @user .row .col-md-6 - = semantic_form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f| - = f.inputs 'Personal Information' do - = semantic_fields_for :user do |u| - = u.input :name, as: :string - = u.input :nickname, as: :string - = u.input :affiliation, placeholder: 'Company/User Group/nothing', as: :string - = f.inputs 'Registration Information' do + = form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f| + %h4 + Personal Information + %hr + = fields_for :user do |u| + .form-group + = u.label :name + = u.text_field :name, class: 'form-control' + = u.label :nickname + = u.text_field :nickname, class: 'form-control' + = u.label :affiliation + = u.text_field :affiliation, placeholder: 'Company/User Group etc.', class: 'form-control' + %h4 + Registration Information + %hr = render partial: 'conference_registrations/registration_info', locals: { f: f } - = f.action :submit, button_html: { class: 'btn btn-primary' } + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/resources/_form.html.haml b/app/views/admin/resources/_form.html.haml index a7a1b328..726c0c0a 100644 --- a/app/views/admin/resources/_form.html.haml +++ b/app/views/admin/resources/_form.html.haml @@ -1,16 +1,20 @@ -.row - .col-md-12 - .page-header - %h1 - - if @resource.new_record? - New - Resource -.row - .col-md-8 - = semantic_form_for(@resource, :url => (@resource.new_record? ? admin_conference_resources_path : admin_conference_resource_path(@conference.short_title, @resource))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } } - = f.input :used - = f.input :quantity - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@resource, :url => (@resource.new_record? ? admin_conference_resources_path : admin_conference_resource_path(@conference.short_title, @resource))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, autofocus: true, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint + .form-group + = f.label :used + %abbr{title: 'This field is required'} * + = f.number_field :used, required: true, class: 'form-control' + .form-group + = f.label :quantity + %abbr{title: 'This field is required'} * + = f.number_field :quantity, required: true, class: 'form-control' + %p.text-right + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/resources/edit.html.haml b/app/views/admin/resources/edit.html.haml new file mode 100644 index 00000000..0c3e05e8 --- /dev/null +++ b/app/views/admin/resources/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Resource + = @resource.name +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/resources/new.html.haml b/app/views/admin/resources/new.html.haml index bcc58327..af670bab 100644 --- a/app/views/admin/resources/new.html.haml +++ b/app/views/admin/resources/new.html.haml @@ -1 +1,8 @@ -= render 'form' +.row + .col-md-12 + .page-header + %h1 + Create Resource +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/roles/_form.html.haml b/app/views/admin/roles/_form.html.haml index 860f43a9..dc9ad563 100644 --- a/app/views/admin/roles/_form.html.haml +++ b/app/views/admin/roles/_form.html.haml @@ -1,15 +1,5 @@ -.row - .col-md-12 - .page-header - %h2 - Role - = @role.name.titleize - .text-muted - = @role.description - -= semantic_form_for @role, url: @url do |f| - .row - .col-md-5 - = f.input :description, input_html: { autofocus: true } - - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for @role, url: @url do |f| + .form-group + = f.label :description + = f.text_field :description, autofocus: true, class: 'form-control' + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/roles/edit.html.haml b/app/views/admin/roles/edit.html.haml new file mode 100644 index 00000000..bf848966 --- /dev/null +++ b/app/views/admin/roles/edit.html.haml @@ -0,0 +1,11 @@ +.row + .col-md-12 + .page-header + %h2 + Role + = @role.name.titleize + .text-muted + = @role.description +.row + .col-md-5 + = render partial: 'form' diff --git a/app/views/admin/roles/show.html.haml b/app/views/admin/roles/show.html.haml index b8796121..629427fb 100644 --- a/app/views/admin/roles/show.html.haml +++ b/app/views/admin/roles/show.html.haml @@ -17,16 +17,15 @@ = link_to @track.name, admin_conference_program_track_path(@conference.short_title, @track) -.row.col-md-3 - - if ( can? :toggle_user, @role ) && !@role.new_record? +.row + .col-md-3 + - if ( can? :toggle_user, @role ) && !@role.new_record? - = semantic_form_for :user, url: @url, method: :post do |u| - - = u.label 'Add user by email: ' - .input-group - = u.input :email, input_html: { autofocus: true }, label: false, placeholder: "User's email" - .input-group-btn - = u.submit 'Add', id: 'user-add', class: 'btn btn-primary' + = form_for :user, url: @url, method: :post do |f| + .form-group + = f.label :email, 'Add user by email: ' + = f.email_field :email, autofocus: true, placeholder: "User's email", class: 'form-control' + = f.submit 'Add', id: 'user-add', class: 'btn btn-primary' .row .col-md-12 diff --git a/app/views/admin/rooms/_form.html.haml b/app/views/admin/rooms/_form.html.haml index 90de99e0..a531548a 100644 --- a/app/views/admin/rooms/_form.html.haml +++ b/app/views/admin/rooms/_form.html.haml @@ -1,15 +1,9 @@ -.row - .col-md-12 - .page-header - %h1 - - if @room.new_record? - New - Room - = @room.name -.row - .col-md-8 - = semantic_form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :size, label: 'Capacity', input_html: {size: 5} - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, autofocus: true, required: true, class: 'form-control' + = f.label :size, 'Capacity' + = f.number_field :size, size: 5, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/rooms/edit.html.haml b/app/views/admin/rooms/edit.html.haml new file mode 100644 index 00000000..068748b8 --- /dev/null +++ b/app/views/admin/rooms/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Room + = @room.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/rooms/new.html.haml b/app/views/admin/rooms/new.html.haml new file mode 100644 index 00000000..2e4c1538 --- /dev/null +++ b/app/views/admin/rooms/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Room +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/schedules/_form.html.haml b/app/views/admin/schedules/_form.html.haml index 8c6c091d..9304b8e8 100644 --- a/app/views/admin/schedules/_form.html.haml +++ b/app/views/admin/schedules/_form.html.haml @@ -5,6 +5,8 @@ New Track Schedule .row .col-md-12 - = semantic_form_for @schedule, url: admin_conference_schedules_path(@conference.short_title) do |f| - = f.input :track, collection: Track.accessible_by(current_ability).where(program: @program).self_organized.confirmed.pluck(:name, :id), include_blank: false - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = form_for @schedule, url: admin_conference_schedules_path(@conference.short_title) do |f| + .form-group + = f.select :track, Track.accessible_by(current_ability).where(program: @program).confirmed.pluck(:name, :id), { include_blank: false }, { class: 'form-control' } + = f.submit nil, class: 'btn btn-primary' + diff --git a/app/views/admin/splashpages/_form.html.haml b/app/views/admin/splashpages/_form.html.haml index 3db1e9ea..64456158 100644 --- a/app/views/admin/splashpages/_form.html.haml +++ b/app/views/admin/splashpages/_form.html.haml @@ -1,66 +1,71 @@ -.row - .col-md-12 - .page-header - %h1 Splashpage - -= semantic_form_for(@splashpage, url: admin_conference_splashpage_path(@conference.short_title)) do |f| - .row - .col-md-12 - = f.inputs name: 'Components' do - %ul.fa-ul - %li - %th - %button.btn.btn-default#select-all{ type: "button" } - Select All - %th - %button.btn.btn-default#unselect-all{ type: "button" } - Unselect All - %li - = f.input :include_cfp, label: 'Display call for papers and call for tracks, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } - %li - = f.input :include_program, label: 'Display the program', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_program) } - - %ul.fa-ul - %li - = f.input :include_tracks, label: 'Include confirmed tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) } - %li - = f.input :include_booths, label: "Include confirmed #{(t'booth').pluralize}", input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_booths) } - - %li - = f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) } - - %li - = f.input :include_tickets, label: 'Display tickets', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tickets) } - - %li - = f.input :include_venue, label: 'Display the venue', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_venue) } - - %li - = f.input :include_lodgings, label: 'Display the lodgings', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_lodgings) } - - %li - = f.input :include_sponsors, label: 'Display sponsors', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_sponsors) } - - %li - = f.input :include_social_media, label: 'Display social media links', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_social_media) } - - = f.inputs name: 'Access' do - %ul.fa-ul - %li - = f.input :public, label: 'Make splash page public?' - .row - .col-md-12 - %p.text-right - = f.submit 'Save Changes', class: 'btn btn-primary' += form_for(@splashpage, url: admin_conference_splashpage_path) do |f| + .checkbox + %label + = f.check_box :include_cfp + Display call for papers and call for tracks? + .checkbox + %label + = f.check_box :include_program + Display the program? + .checkbox + %label + = f.check_box :include_tracks + Include confirmed tracks in the program? + .checkbox + %label + = f.check_box :include_booths + Include confirmed + = (t'booth').pluralize + in the program? + .checkbox + %label + = f.check_box :include_registrations + Display the registration period? + .checkbox + %label + = f.check_box :include_tickets + Display the tickets? + .checkbox + %label + = f.check_box :include_venue + Display the venue? + .checkbox + %label + = f.check_box :include_lodgings + Display the lodgings? + .checkbox + %label + = f.check_box :include_sponsors + Display the sponsors? + .checkbox + %label + = f.check_box :include_social_media + Display the social media links? + %h4 + Access + %hr + .checkbox + %label + = f.check_box :public + Make splash page public? + .text-right + .checkbox + %label + = check_box_tag 'selectAll' + Select / Deselect All + = f.submit 'Save', { class: 'btn btn-primary' } :javascript $(document).ready(function(){ - $('#select-all').click(function(event) { - var parent = $(this).parents('.inputs:last'); - parent.find('.input.checkbox input[type=checkbox]').prop('checked',true); - }); - $('#unselect-all').click(function(event) { - var parent = $(this).parents('.inputs:last'); - parent.find('.input.checkbox input[type=checkbox]').prop('checked',false); - }); + $('#selectAll').click(function() { + if (this.checked) { + $(':checkbox').each(function() { + this.checked = true; + }); + } else { + $(':checkbox').each(function() { + this.checked = false; + }); + } + }); }); diff --git a/app/views/admin/splashpages/edit.html.haml b/app/views/admin/splashpages/edit.html.haml new file mode 100644 index 00000000..0711bd1b --- /dev/null +++ b/app/views/admin/splashpages/edit.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Configure Splashpage +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/splashpages/new.html.haml b/app/views/admin/splashpages/new.html.haml new file mode 100644 index 00000000..0711bd1b --- /dev/null +++ b/app/views/admin/splashpages/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Configure Splashpage +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/splashpages/show.html.haml b/app/views/admin/splashpages/show.html.haml index a9046fdc..0bf3267c 100644 --- a/app/views/admin/splashpages/show.html.haml +++ b/app/views/admin/splashpages/show.html.haml @@ -55,7 +55,7 @@ .row .col-md-12 - if can? :update, @splashpage - = link_to 'Edit', edit_admin_conference_splashpage_path, class: 'btn btn-primary' + = link_to 'Configure', edit_admin_conference_splashpage_path, class: 'btn btn-primary' - if can? :destroy, @splashpage = link_to 'Delete', admin_conference_splashpage_path, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' diff --git a/app/views/admin/sponsors/_form.html.haml b/app/views/admin/sponsors/_form.html.haml index 19bc2ae6..78cf0c4d 100644 --- a/app/views/admin/sponsors/_form.html.haml +++ b/app/views/admin/sponsors/_form.html.haml @@ -1,19 +1,23 @@ -.row - .col-md-12 - .page-header - %h1 - -if @sponsor.new_record? - New - Sponsor - = @sponsor.name -.row - .col-md-8 - = semantic_form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint - = image_tag f.object.picture.thumb.url if f.object.picture? - = f.input :picture - = f.input :website_url - = f.input :sponsorship_level, collection: @conference.sponsorship_levels - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, autofocus: true, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, cols: 20, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint + .form-group + = f.label :picture + = image_tag f.object.picture.thumb.url if f.object.picture? + = f.file_field :picture + .form-group + = f.label :website_url + %abbr{title: 'This field is required'} * + = f.url_field :website_url, required: true, class: 'form-control' + .form-group + = f.label :sponsorship_level_id, 'Level' + = f.select :sponsorship_level_id, @conference.sponsorship_levels.pluck(:title, :id), { include_blank: false }, { class: 'form-control' } + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/sponsors/edit.html.haml b/app/views/admin/sponsors/edit.html.haml new file mode 100644 index 00000000..2114a547 --- /dev/null +++ b/app/views/admin/sponsors/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Sponsor + = @sponsor.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/sponsors/new.html.haml b/app/views/admin/sponsors/new.html.haml new file mode 100644 index 00000000..2ed726b6 --- /dev/null +++ b/app/views/admin/sponsors/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Sponsor +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/sponsorship_levels/_form.html.haml b/app/views/admin/sponsorship_levels/_form.html.haml index ae819a71..459c3fd3 100644 --- a/app/views/admin/sponsorship_levels/_form.html.haml +++ b/app/views/admin/sponsorship_levels/_form.html.haml @@ -1,14 +1,8 @@ -.row - .col-md-12 - .page-header - %h1 - - if @sponsorship_level.new_record? - New - Sponsorship Level - = @sponsorship_level.title -.row - .col-md-8 - = semantic_form_for(@sponsorship_level, url: (@sponsorship_level.new_record? ? admin_conference_sponsorship_levels_path : admin_conference_sponsorship_level_path(@conference.short_title, @sponsorship_level))) do |f| - = f.input :title, input_html: { autofocus: true } - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@sponsorship_level, url: (@sponsorship_level.new_record? ? admin_conference_sponsorship_levels_path : admin_conference_sponsorship_level_path(@conference.short_title, @sponsorship_level))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true, required: true, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' + diff --git a/app/views/admin/sponsorship_levels/edit.html.haml b/app/views/admin/sponsorship_levels/edit.html.haml new file mode 100644 index 00000000..fab6a007 --- /dev/null +++ b/app/views/admin/sponsorship_levels/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Sponsorship Level + = @sponsorship_level.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/sponsorship_levels/new.html.haml b/app/views/admin/sponsorship_levels/new.html.haml new file mode 100644 index 00000000..5a8bebd6 --- /dev/null +++ b/app/views/admin/sponsorship_levels/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Sponsorship Level +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/survey_questions/_form.html.haml b/app/views/admin/survey_questions/_form.html.haml index eb861944..a4e1eea6 100644 --- a/app/views/admin/survey_questions/_form.html.haml +++ b/app/views/admin/survey_questions/_form.html.haml @@ -11,82 +11,85 @@ = @survey_question.title .col-md-6 - = semantic_form_for @survey_question, url: @url do |f| - - .row - .col-md-12 - = f.input :title, input_html: { autofocus: true } - = f.input :mandatory - .survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' } - = f.input :possible_answers, hint: 'Comma separated', input_html: { rows: 3 } - .row - .col-md-6 - = f.input :min_choices - .col-md-6 - = f.input :max_choices - %hr - .row - .col-md-6 - %label{ required: 'required' } - Type of Question: - .form-group - %select.selectpicker.form-control{ id: 'survey_question_kind', name: 'survey_question[kind]' } - - SurveyQuestion.kinds.each do |kind| - %option{ id: "#{kind.second}", 'data-icon' => "fa fa-#{SurveyQuestion::ICONS[kind.first.to_sym]}", selected: @survey_question.kind == kind.first } - = kind.first - .col-md-6 + = form_for @survey_question, url: @url do |f| + .form-group + = f.text_field :title, autofocus: true, class: 'form-control' + .checkbox %label - Preview: - .panel.panel-default - .panel-body{ id: 'survey_question_preview' } - %p{ id: 'title', style: 'word-wrap: break-word' } - = @survey_question.title.blank? ? 'What is your answer?' : @survey_question.title - - .kinds.boolean{ class: @survey_question.boolean? ? '' : 'hidden' } - %input{ type: 'radio', name: 'radio' } Yes + = f.check_box :mandatory + Mandatory? + .survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' } + .form-group + = f.text_area :possible_answers, rows: 3, class: 'form-control' + %span.help-block + Comma separated + .form-group + = f.label :min_choices + = f.number_field :min_choices, class: 'form-control' + .form-group + = f.label :max_choices + = f.number_field :max_choices, class: 'form-control' + .form-group + %label{ required: 'required' } + Type of Question: + .form-group + %select.selectpicker.form-control{ id: 'survey_question_kind', name: 'survey_question[kind]' } + - SurveyQuestion.kinds.each do |kind| + %option{ id: "#{kind.second}", 'data-icon' => "fa fa-#{SurveyQuestion::ICONS[kind.first.to_sym]}", selected: @survey_question.kind == kind.first } + = kind.first + = f.submit nil, class: 'btn btn-primary' + .col-md-6 + %label + Preview: + %span.help-block + This is how you visitors will see the question in the survey. + .panel.panel-default + .panel-body{ id: 'survey_question_preview' } + %p{ id: 'title', style: 'word-wrap: break-word' } + = @survey_question.title.blank? ? 'What is your answer?' : @survey_question.title + .kinds.boolean{ class: @survey_question.boolean? ? '' : 'hidden' } + %input{ type: 'radio', name: 'radio' } Yes + %br + %input{ type: 'radio', name: 'radio' } No + .kinds.choice{ class: @survey_question.choice? ? '' : 'hidden' } + - if @survey_question.possible_answers.blank? + - if @survey_question.single_choice? + .radio + %label + %input{ type: 'radio' } + Choice + - else + .checkbox + %label + %input{ type: 'checkbox' } + Choice 1 + .checkbox + %label + %input{ type: 'checkbox' } + Choice 2 + .checkbox + %label + %input{ type: 'checkbox' } + Choice 3 + - else + - @survey_question.possible_answers.split(',').map(&:strip).each do |option| + - if @survey_question.single_choice? + %input{ type: 'radio', name: 'radio' } + = option %br - %input{ type: 'radio', name: 'radio' } No - - .kinds.choice{ class: @survey_question.choice? ? '' : 'hidden' } - - if @survey_question.possible_answers.blank? - - if @survey_question.single_choice? - %input{ type: 'radio', name: 'radio' } Choice 1 - %br - %input{ type: 'radio', name: 'radio' } Choice 2 - %br - %input{ type: 'radio', name: 'radio' } Choice 3 - - else - %input{ type: 'checkbox', name: 'checkbox' } Choice 1 - %br - %input{ type: 'checkbox', name: 'checkbox' } Choice 2 - %br - %input{ type: 'checkbox', name: 'checkbox' } Choice 3 - - else - - @survey_question.possible_answers.split(',').map(&:strip).each do |option| - - if @survey_question.single_choice? - %input{ type: 'radio', name: 'radio' } - = option - %br - - else - %input{ type: 'checkbox', name: 'checkbox' } - = option - %br - - .kinds.string{ class: @survey_question.string? ? '' : 'hidden' } - %input.form-control - - .kinds.text{ class: @survey_question.text? ? '' : 'hidden' } - %textarea.form-control{ rows: 4 } - - - .kinds.datetime{ class: @survey_question.datetime? ? '' : 'hidden' } - .form-group{ class: 'datetimepicker' } - .input-group - .input-group-addon - %span.fa.fa-calendar - %input.form-control{ readonly: 'readonly' } - .kinds.numeric{ class: @survey_question.numeric? ? '' : 'hidden' } - - %input.form-control{ type: 'number' } - - = f.submit 'Save', class: 'btn btn-primary' + - else + %input{ type: 'checkbox', name: 'checkbox' } + = option + %br + .kinds.string{ class: @survey_question.string? ? '' : 'hidden' } + %input.form-control + .kinds.text{ class: @survey_question.text? ? '' : 'hidden' } + %textarea.form-control{ rows: 4 } + .kinds.datetime{ class: @survey_question.datetime? ? '' : 'hidden' } + .form-group{ class: 'datetimepicker' } + .input-group + .input-group-addon + %span.fa.fa-calendar + %input.form-control{ readonly: 'readonly' } + .kinds.numeric{ class: @survey_question.numeric? ? '' : 'hidden' } + %input.form-control{ type: 'number' } diff --git a/app/views/admin/surveys/_form.html.haml b/app/views/admin/surveys/_form.html.haml index d01eb467..ef35538f 100644 --- a/app/views/admin/surveys/_form.html.haml +++ b/app/views/admin/surveys/_form.html.haml @@ -7,12 +7,22 @@ %h1 Edit Survey: #{ @survey.title } .col-md-6 - = semantic_form_for @survey, url: @url do |f| + = form_for @survey, url: @url do |f| = f.hidden_field :surveyable_type = f.hidden_field :surveyable_id - = f.input :title - = f.input :description, input_html: { rows: 3 } - = f.input :target, as: :select, collection: Survey.targets.keys, label: "When to ask" - = f.input :start_date, as: :string, input_html: { class: 'datetimepicker' } - = f.input :end_date, as: :string, input_html: { class: 'datetimepicker' } - = f.submit 'Save', class: 'btn btn-primary' + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 3, class: 'form-control' + .form-group + = f.label :target, "When to ask" + = f.select :target, Survey.targets.keys, class: 'form-control' + .form-group + = f.label :start_date + = f.text_field :start_date, class: 'datetimepicker', class: 'form-control' + = f.label :end_date + = f.text_field :end_date, class: 'datetimepicker', class: 'form-control' + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/surveys/_survey_question.html.haml b/app/views/admin/surveys/_survey_question.html.haml index bb7a54d3..485bd559 100644 --- a/app/views/admin/surveys/_survey_question.html.haml +++ b/app/views/admin/surveys/_survey_question.html.haml @@ -11,7 +11,6 @@ %label %input{ type: 'radio', name: "survey_submission[#{survey_question.id}][]", value: 'No', checked: survey_reply.text == 'No' } No - - elsif survey_question.choice? %input{ type: 'hidden', name: "survey_submission[#{survey_question.id}][]" } - possible_answers = survey_question.possible_answers.split(',').map(&:strip) diff --git a/app/views/admin/surveys/show.html.haml b/app/views/admin/surveys/show.html.haml index 27f8b2c8..521fed7c 100644 --- a/app/views/admin/surveys/show.html.haml +++ b/app/views/admin/surveys/show.html.haml @@ -21,12 +21,9 @@ = link_to 'Stats' , '#stats-content', 'data-toggle' => 'tab' .tab-content .tab-pane.active#questions-content - = semantic_form_for 'survey_submission', url: '#' do |f| - - @survey.survey_questions.each.with_index(1) do |survey_question, question_index| - .row - .col-md-12 - - survey_reply = survey_question.survey_replies.new(survey_question_id: survey_question.id, user_id: current_user.id) - = render partial: 'survey_question', locals: { survey_question: survey_question, question_index: question_index, survey_reply: survey_reply } + - @survey.survey_questions.each.with_index(1) do |survey_question, question_index| + - survey_reply = survey_question.survey_replies.new(survey_question_id: survey_question.id, user_id: current_user.id) + = render partial: 'survey_question', locals: { survey_question: survey_question, question_index: question_index, survey_reply: survey_reply } = link_to 'Add Question', new_admin_conference_survey_survey_question_path(@conference.short_title, @survey), class: 'btn btn-success pull-right' .tab-pane#replies-content = render partial: 'survey_replies' diff --git a/app/views/admin/tickets/_form.html.haml b/app/views/admin/tickets/_form.html.haml index 8e07116f..54f82c50 100644 --- a/app/views/admin/tickets/_form.html.haml +++ b/app/views/admin/tickets/_form.html.haml @@ -1,18 +1,25 @@ -.row - .col-md-12 - .page-header - %h1 - - if @ticket.new_record? - New - = @ticket.title - Ticket -.row - .col-md-8 - = semantic_form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f| - = f.input :title, input_html: { autofocus: true } - = f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } } - = f.input :price - = f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false - = f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.' - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, required: true, autofocus: true, class: 'form-control' + .form-group + = f.text_area :description, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + .form-group + = f.label :price + = f.number_field :price, class: 'form-control' + - if Ticket.where(conference: @conference).empty? + .form-group + = f.label :price_currency, 'Currency' + = f.select :price_currency, ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], { include_blank: false }, { class: 'form-control' } + - else + = hidden_field_tag "ticket[price_currency]", f.object.conference.tickets.first.price_currency + %span.help-block + Your conference tickets are in + = f.object.conference.tickets.first.price_currency + .checkbox + %label + = f.check_box :registration_ticket + A registration ticket is with which user register for the conference. + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/tickets/edit.html.haml b/app/views/admin/tickets/edit.html.haml new file mode 100644 index 00000000..01dd790d --- /dev/null +++ b/app/views/admin/tickets/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Ticket + = @ticket.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/tickets/new.html.haml b/app/views/admin/tickets/new.html.haml new file mode 100644 index 00000000..2481b479 --- /dev/null +++ b/app/views/admin/tickets/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Ticket +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/tracks/_form.html.haml b/app/views/admin/tracks/_form.html.haml index 7c9fda4e..24f0913d 100644 --- a/app/views/admin/tracks/_form.html.haml +++ b/app/views/admin/tracks/_form.html.haml @@ -1,28 +1,2 @@ -.row - .col-md-12 - .page-header - %h1 - -if @track.new_record? - New - = @track.name - Track -.row - .col-md-12 - = semantic_form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path(@conference.short_title) : admin_conference_program_track_path(@conference.short_title, @track))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' } - = f.input :color, input_html: {size: 6, type: 'color'}, required: true - = f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, required: @track.self_organized_and_accepted_or_confirmed? } - = f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', required: @track.self_organized_and_accepted_or_confirmed? } - - if @conference.venue.try(:rooms).present? - = f.input :room, as: :select, collection: (@conference.venue.rooms).map {|room| ["#{room.name}", room.id]}, include_blank: true, label: 'Room', input_html: { class: 'select-help-toggle', required: @track.self_organized_and_accepted_or_confirmed? } - - else - %b - Please add a - = link_to 'venue', admin_conference_venue_path(@conference.short_title) - with - = link_to 'rooms', admin_conference_venue_rooms_path(@conference.short_title) - , if you want to select a room for the track. - = f.input :description, input_html: {rows: 2, data: { provide: 'markdown' } }, hint: markdown_hint - = f.input :cfp_active, label: 'Allow event submitters to select this track for their proposal' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path(@conference.short_title) : admin_conference_program_track_path(@conference.short_title, @track))) do |f| + = render partial: 'tracks/form_fields', locals: { f: f } diff --git a/app/views/admin/tracks/edit.html.haml b/app/views/admin/tracks/edit.html.haml new file mode 100644 index 00000000..8d29ea44 --- /dev/null +++ b/app/views/admin/tracks/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Tack + = @track.name +.row + .col-md-12 + = render partial: 'form' diff --git a/app/views/admin/tracks/new.html.haml b/app/views/admin/tracks/new.html.haml new file mode 100644 index 00000000..9fde2274 --- /dev/null +++ b/app/views/admin/tracks/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Track +.row + .col-md-12 + = render partial: 'form' diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml deleted file mode 100644 index 7604f0d3..00000000 --- a/app/views/admin/users/_form.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -= semantic_form_for [:admin, @user] do |f| - = f.inputs 'Basic Information' do - - unless @user.new_record? - .pull-right - %b - Confirmed? - - if can? :toggle_confirmation, @user - = check_box_tag @user.id, @user.id, @user.confirmed?, - url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=", - class: 'switch-checkbox', - readonly: false - - else - = check_box_tag @user.id, @user.id, @user.confirmed?, - url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=", - class: 'switch-checkbox', - readonly: true - = f.input :is_admin, hint: 'An admin can create a new conference, manage users and make other users admins.' - = f.input :name, as: :string - = f.input :username, :as => :string if @user.new_record? - = f.input :email - = f.input :password if @user.new_record? - = f.input :affiliation, as: :string - = f.input :biography, input_html: { rows: 10, data: { provide: 'markdown' } }, - hint: markdown_hint - = f.actions do - = f.action :submit, button_html: {class: 'btn btn-primary'} diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml new file mode 100644 index 00000000..f5f89e68 --- /dev/null +++ b/app/views/admin/users/new.html.haml @@ -0,0 +1,7 @@ +.row + .col-md-12 + .page-header + %h1 + Create User + = form_for [:admin, @user] do |f| + = render partial: 'devise/registrations/form_fields', locals: { f: f, full: true } diff --git a/app/views/admin/venues/_form.html.haml b/app/views/admin/venues/_form.html.haml index 1c68282f..960b01e4 100644 --- a/app/views/admin/venues/_form.html.haml +++ b/app/views/admin/venues/_form.html.haml @@ -12,17 +12,47 @@ .tab-content #details-content.tab-pane.active .col-md-8 - = semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| - = f.inputs :name, :website - = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint - = f.label 'Venue Logo' - %br - - if @venue.picture? - = image_tag @venue.picture.thumb.url - = f.input :picture, label: false, hint: 'This will be displayed on the venue are of the splash page.' - = f.hidden_field :picture_cache - = f.inputs :street, :postalcode, :city, :country, :latitude, :longitude - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, class: 'form-control' + .form-group + = f.label :website + = f.url_field :website, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, cols: 20, data: { provide: 'markdown' } + %span.help-block + = markdown_hint + .form-group + = f.label 'Logo' + %br + - if @venue.picture? + = image_tag @venue.picture.thumb.url + = f.file_field :picture + = f.hidden_field :picture_cache + %span.help-block + This will be displayed on the venue are of the splash page. + .form-group + = f.label :street + %abbr{title: 'This field is required'} * + = f.text_field :street, required: true, class: 'form-control' + = f.label :postalcode + = f.text_field :postalcode, class: 'form-control' + = f.label :city + %abbr{title: 'This field is required'} * + = f.text_field :city, required: true, class: 'form-control' + .form-group + = f.label :country + = f.select :country, I18nData.countries.invert, { include_hidden: false }, { class: 'form-control' } + .form-group + = f.label :latitude + = f.text_field :latitude, class: 'form-control' + .form-group + = f.label :longitude + = f.text_field :longitude, class: 'form-control' + = f.submit nil, class: 'btn btn-primary' #commercials-content.tab-pane - if can? :create, @venue.commercial and @venue.id @@ -34,10 +64,13 @@ .row .col-md-6 - = semantic_form_for(Commercial.new,as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title)) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' }, - hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + = form_for(Commercial.new,as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title)) do |f| + .form-group + = f.label :url + = f.url_field :url, class: 'form-control', required: 'required' + %span.help-block + Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr. + = f.submit nil, class: 'btn btn-primary pull-right', id: 'commercial_submit_action', disabled: true %hr - else - if @venue.commercial.persisted? @@ -47,9 +80,13 @@ = render partial: 'shared/media_item', locals: { commercial: @venue.commercial } .caption - if can? :update, @venue.commercial - = semantic_form_for @venue.commercial, as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: @venue.commercial.id) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{@venue.commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider' - = f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update' + = form_for @venue.commercial, as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: @venue.commercial.id) do |f| + .form-group + = f.label :url + = f.url_field :url, id: "commercial_url_#{@venue.commercial.id}", class: 'form-control', required: 'required' + %span.help-block + Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr. + = f.submit nil, class: 'btn btn-success' - if can? :destroy, @venue.commercial = link_to 'Delete', admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: @venue.commercial.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' diff --git a/app/views/application/edit.html.haml b/app/views/admin/venues/edit.html.haml similarity index 100% rename from app/views/application/edit.html.haml rename to app/views/admin/venues/edit.html.haml diff --git a/app/views/application/new.html.haml b/app/views/admin/venues/new.html.haml similarity index 100% rename from app/views/application/new.html.haml rename to app/views/admin/venues/new.html.haml diff --git a/app/views/admin/volunteers/_vday_fields.html.erb b/app/views/admin/volunteers/_vday_fields.html.erb deleted file mode 100644 index 21c40b23..00000000 --- a/app/views/admin/volunteers/_vday_fields.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -