updated rails to 4.2.4

This commit is contained in:
raluka 2015-09-17 12:12:51 +02:00
parent 37697517df
commit 42e8bb11ea
55 changed files with 766 additions and 365 deletions

View file

@ -1,13 +1,13 @@
html {
position: relative;
min-height: 100%;
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by 2 times the footer height */
margin-bottom: 60px;
/* Margin bottom by navbar height */
padding-top: 60px;
/* Margin bottom by 2 times the footer height */
margin-bottom: 60px;
/* Margin bottom by navbar height */
padding-top: 60px;
}
#content {
@ -15,23 +15,23 @@ body {
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
.container {
padding: 15px;
}
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
.container {
padding: 15px;
}
}
.nav-tabs {
margin-bottom: 15px;
margin-bottom: 15px;
}
.img-center {
margin: 0 auto;
margin: 0 auto;
}
/* centered columns styles */
@ -55,7 +55,9 @@ fieldset {
margin: 20px 0 20px 0;
}
.bootstrap-switch { height: 1.7em }
.bootstrap-switch {
height: 1.7em
}
.comment-reply{
padding-top: 40px;
@ -71,4 +73,14 @@ p.comment-body {
#account-already {
font-size: 0.6em;
}
}
/* comments views pane: use padding-bottom before next comment box */
.panel.panel-default .panel-body .notifications {
padding-bottom: 20px;
}
/* comments views pane: use padding-bottom after each comment */
.panel.panel-default .panel-body .notifications p {
padding-bottom: 20px;
}

View file

@ -0,0 +1,30 @@
module Admin
class CommentsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource
def index
# All available comments, grouped and sorted
@comments = grouped_comments(accessible_ordered_comments)
# Grouped, sorted, available comments, posted since current_user last login
@unread_comments = grouped_comments(accessible_ordered_comments.find_since_last_login(current_user))
# Grouped, sorted, available comments, posted by current_user
@posted_comments = grouped_comments(accessible_ordered_comments.find_comments_by_user(current_user))
end
private
# Returning all available comments, ordered by created_at: :desc and by event.title
def accessible_ordered_comments
Comment.accessible_by(current_ability).joins('INNER JOIN events ON commentable_id = events.id').order('events.title', 'comments.created_at DESC')
end
# Grouping all comments by conference, and by event. It returns {:conference => {:event => [{comment_2}, {comment_1 }]}}
def grouped_comments(remarks)
remarks.group_by{ |comment| comment.commentable.conference }.map {|conference, comments| [conference, comments.group_by{|comment| comment.commentable}]}.to_h
end
end
end

View file

@ -27,7 +27,6 @@ module Admin
@recent_users = User.limit(5).order(created_at: :desc)
@recent_events = Event.limit(5).order(created_at: :desc)
@recent_registrations = Registration.limit(5).order(created_at: :desc)
@top_submitter = Conference.get_top_submitter
@submissions = {}

View file

@ -179,12 +179,12 @@ module Admin
def update_state(transition, notice, mail = false, subject = false, send_mail = false)
alert = @event.update_state(transition, mail, subject, send_mail, params[:send_mail].blank?)
if !alert.blank?
flash[:error] = error
return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
else
if alert.blank?
flash[:notice] = notice
redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
else
flash[:error] = alert
return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
end
end
end

View file

@ -17,9 +17,9 @@ module Admin
@registration.update_attributes(registration_params)
if @registration.save
redirect_to admin_conference_registrations_path(@conference.short_title),
notice: 'Successfully updated registration!'
notice: "Successfully updated registration for #{@registration.user.email}!"
else
flash[:error] = "An error prohibited the Registration for #{@conference.title}: "\
flash[:error] = "An error prohibited the Registration for #{@registration.user.email}: "\
"#{@registration.errors.full_messages.join('. ')}."
render :edit
end
@ -56,7 +56,7 @@ module Admin
permit(
:conference_id, :arrival, :departure,
:volunteer,
vchoice_ids: [], qanswer_ids: [],
vchoice_ids: [], qanswer_ids: [], event_ids: [],
qanswers_attributes: [],
user_attributes: [
:id, :name, :tshirt, :mobile, :volunteer_experience, :languages,

View file

@ -278,4 +278,8 @@ module ApplicationHelper
new_user_registration_path
end
end
def unread_notifications(user)
Comment.accessible_by(current_ability).find_since_last_login(user)
end
end

View file

@ -80,6 +80,22 @@ class Mailbot < ActionMailer::Base
end
end
def send_notification_email_for_comment(comment)
@comment = comment
@event = @comment.commentable
@conference = @event.conference
recipients = User.comment_notifiable(@conference) # with scope
recipients.each do |user|
@user = user
mail(to: @user.email,
from: @conference.contact.email,
reply_to: @conference.contact.email,
template_path: 'admin/emails',
template_name: 'comment_template',
subject: "New comment has been posted for #{@event.title}")
end
end
def build_email(conference, to, subject, body)
mail(to: to,
from: conference.contact.email,

View file

@ -88,12 +88,13 @@ class Ability
# Abilities from not_signed_in and signed_in are also inherited
signed_in(user)
signed_in_with_organizer_role(user)
signed_in_with_cfp_role(user)
signed_in_with_info_desk_role(user)
signed_in_with_volunteers_coordinator_role(user)
signed_in_with_organizer_role(user) if user.has_role? :organizer, :any
signed_in_with_cfp_role(user) if user.has_role? :cfp, :any
signed_in_with_info_desk_role(user) if user.has_role? :info_desk, :any
signed_in_with_volunteers_coordinator_role(user) if user.has_role? :volunteer_coordinator, :any
# for users with any role
can :access, Admin
can [:show], Conference
can :index, Commercial, commercialable_type: 'Conference'
cannot [:edit, :update, :destroy], Question, global: true
@ -137,6 +138,8 @@ class Ability
can :manage, Sponsor, conference_id: conf_ids_for_organizer
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
can :manage, Ticket, conference_id: conf_ids_for_organizer
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id)
end
def signed_in_with_cfp_role(user)
@ -155,6 +158,8 @@ class Ability
can :manage, CallForPaper, conference_id: conf_ids_for_cfp
can :manage, Commercial, commercialable_type: 'Event',
commercialable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
end
def signed_in_with_info_desk_role(user)

View file

@ -3,6 +3,7 @@ class Comment < ActiveRecord::Base
attr_accessible :commentable, :body, :user_id
validates_presence_of :body
validates_presence_of :user
after_create :send_notification
# NOTE: install the acts_as_votable plugin if you
# want user to vote on the quality of comments.
@ -40,9 +41,18 @@ class Comment < ActiveRecord::Base
where(commentable_type: commentable_str.to_s, commentable_id: commentable_id).order('created_at DESC')
}
scope :find_since_last_login, lambda { |user|
where(created_at: (user.last_sign_in_at..Time.now)).order(created_at: :desc)
}
# Helper class method to look up a commentable object
# given the commentable class name and id
def self.find_commentable(commentable_str, commentable_id)
commentable_str.constantize.find(commentable_id)
end
private
def send_notification
Mailbot.delay.send_notification_email_for_comment(self)
end
end

View file

@ -114,17 +114,17 @@ class Conference < ActiveRecord::Base
before_create :add_color
def date_range_string
startstr = "Unknown - "
endstr = "Unknown"
startstr = 'Unknown - '
endstr = 'Unknown'
if start_date.month == end_date.month && start_date.year == end_date.year
startstr = start_date.strftime("%B %d - ")
endstr = end_date.strftime("%d, %Y")
startstr = start_date.strftime('%B %d - ')
endstr = end_date.strftime('%d, %Y')
elsif start_date.month != end_date.month && start_date.year == end_date.year
startstr = start_date.strftime("%B %d - ")
endstr = end_date.strftime("%B %d, %Y")
startstr = start_date.strftime('%B %d - ')
endstr = end_date.strftime('%B %d, %Y')
else
startstr = start_date.strftime("%B %d, %Y - ")
endstr = end_date.strftime("%B %d, %Y")
startstr = start_date.strftime('%B %d, %Y - ')
endstr = end_date.strftime('%B %d, %Y')
end
result = startstr + endstr

View file

@ -49,7 +49,7 @@ class EmailSettings < ActiveRecord::Base
h['registration_end_date'] = conference.registration_period.end_date
end
if !event.nil?
if event
h['eventtitle'] = event.title
h['proposalslink'] = Rails.application.routes.url_helpers.conference_proposal_index_url(
conference.short_title, host: CONFIG['url_for_emails'])
@ -67,6 +67,8 @@ class EmailSettings < ActiveRecord::Base
parse_template(conf_update_template, values)
end
private
def parse_template(text, values)
values.each do |key, value|
if value.kind_of?(Date)

View file

@ -11,6 +11,9 @@ class User < ActiveRecord::Base
before_create :setup_role
# add scope
scope :comment_notifiable, ->(conference) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference.id)}
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable

View file

@ -0,0 +1,12 @@
- @comments.each do |conference, events|
.panel.panel-default
.panel-heading
%h4.title.panel-title= conference.title
.panel-body
- events.each do |event, comments|
.notifications
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%hr
- comments.each do |comment|
%h5.strong Posted by: #{comment.user.name} | Created at: #{comment.created_at}
%p= comment.body

View file

@ -0,0 +1,12 @@
- @posted_comments.each do |conference, events|
.panel.panel-default
.panel-heading
%h4.title.panel-title= conference.title
.panel-body
- events.each do |event, comments|
.notifications
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%hr
- comments.each do |comment|
%h5.strong Created at: #{comment.created_at}
%p= comment.body

View file

@ -0,0 +1,12 @@
- @unread_comments.each do |conference, events|
.panel.panel-default
.panel-heading
%h4.title.panel-title= conference.title
.panel-body
- events.each do |event, comments|
.notifications
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%hr
- comments.each do |comment|
%h5.strong Posted by: #{comment.user.name} | Created at: #{comment.created_at}
%p= comment.body

View file

@ -0,0 +1,24 @@
%h1 Comments
%br
.row
.col-md-12
%ul.nav.nav-tabs#commentsTable
%li.active
%a{:href=>"#unread_comments", "data-toggle"=>"tab"}
%span.fa.fa-comment
Unread
%li
%a{:href=>"#posted_comments", "data-toggle"=>"tab"}
%span.fa.fa-pencil
Posted
%li
%a{:href=>"#all_comments", "data-toggle"=>"tab"}
%span.fa.fa-comments-o
All
.tab-content
.tab-pane.active#unread_comments
= render partial: 'unread_comments'
.tab-pane#posted_comments
= render partial: 'posted_comments'
.tab-pane#all_comments
= render partial: 'all_comments'

View file

@ -0,0 +1,10 @@
Dear <%= @user.name %>,
User <%= @comment.user.name %> posted a new comment for event <%= @event.title %> of <%= @conference.short_title %> .
"<%= @comment.body %>"
To reply to this comment, please go to <%= h( admin_conference_event_url(@conference.short_title, @event)) %>
Best wishes,
<%= @conference.short_title %> Team

View file

@ -9,6 +9,7 @@
%table.table.table-hover#event_types
%thead
%th Title
%th Description
%th Length
%th Abstract Length
%th Color
@ -18,6 +19,8 @@
%tr
%td
= event_type.title
%td
= event_type.description
%td
= event_type.length
Minutes

View file

@ -54,6 +54,14 @@
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
- else
= label_tag "label_rating", "", :class => "avgrating"
%br
- voted = event.voted?(event, current_user)
- if voted
%span.label.label-success
Your rating: #{voted.rating}
- else
%span.label.label-danger
Not rated
- else
0/#{@conference.call_for_paper.rating}
%br

View file

@ -4,6 +4,6 @@
= q.title
%b A:
- registration.qanswers.where(:question_id => q.id).each do |qa|
- registration.qanswers.where(question_id: q.id).each do |qa|
= qa.answer.title
%br
%br

View file

@ -2,25 +2,17 @@
.col-md-12
.page-header
%h1
Edit registration of #{@user.username} for #{@conference.short_title}
Registration for #{@user.username}
.row
.col-md-8
= semantic_form_for(@registration, :url => admin_conference_registration_path(@conference.short_title, @registration)) do |f|
.col-md-6
= semantic_form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f|
= f.inputs 'Personal Information' do
= f.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
- @conference.questions.each do |q|
%h5
= "Q: #{q.title}"
- if q.question_type.id == 1 || q.question_type.id == 2 # yes/no or single choice
= f.input :qanswers, :collection => q.qanswers, :as => :select, :input_html => { :multiple => false }, :label => false, :include_blank => "Please make your choice",
:member_label => Proc.new {|a| a.answer.title}
- if q.question_type.id == 3 # multiple choice
= f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, :label => false,
:member_label => Proc.new {|a| a.answer.title}
= render partial: 'conference_registrations/registration_info', locals: { f: f }
-# Not necessary
- if @conference.social_events.count > 0
@ -28,4 +20,4 @@
%br Yes, I'll be attending...
%br
= f.input :social_events, as: :check_boxes, label: false, collection: @conference.social_events
= f.action :submit, button_html: { value: 'Edit Registration', class: 'btn btn-primary' }
= f.action :submit, button_html: { class: 'btn btn-primary' }

View file

@ -6,8 +6,8 @@
= "(#{@registrations.length})" if @registrations
.btn-group.pull-right
- if can? :read, Registration
= link_to "Export PDF", admin_conference_registrations_path(@conference.short_title, :format => :pdf), :class => "btn btn-default"
= link_to "Export XLS", {:format => :xlsx}, :class => "btn btn-default"
= link_to 'Export PDF', admin_conference_registrations_path(@conference.short_title, format: :pdf), class: 'btn btn-success'
= link_to 'Export XLS', {format: :xlsx}, class: 'btn btn-success'
%p.text-muted
All the people who registered to your event
%table.table.table-hover.datatable#registrations
@ -32,12 +32,12 @@
= registration.email
%td
- if registration.arrival
= registration.arrival.strftime("%d %b %H:%M")
= registration.arrival.strftime('%d %b %H:%M')
- else
n/a
%td
- if registration.departure
= registration.departure.strftime("%d %b %H:%M")
= registration.departure.strftime('%d %b %H:%M')
- else
n/a
-if @conference.questions.any?
@ -47,7 +47,7 @@
= check_box_tag "#{@conference.short_title}_#{registration.id}", registration.id, registration.attended,
class: 'switch-checkbox', method: :patch,
url: toggle_attendance_admin_conference_registration_path(@conference.short_title, id: registration.id)+"?attended=",
data: { size: "small",
data: { size: 'small',
on_color: 'success',
off_color: 'warning',
on_text: 'Present',
@ -61,7 +61,7 @@
.questions{class: "question#{index}", style: 'display:none;'}
= render partial: 'questions', locals: { registration: registration }
.modal.fade{ id: "questions", 'role' => 'dialog', 'aria-hidden' => 'true' }
.modal.fade{ id: 'questions', 'role' => 'dialog', 'aria-hidden' => 'true' }
.modal-dialog
.modal-content
.modal-header

View file

@ -4,19 +4,19 @@
.page-header
%h2 Upcoming Conferences
- @current.each do |conference|
= render :partial => "conference_details", :locals => {:conference => conference}
= render partial: 'conference_details', locals: { conference: conference }
-if @antiquated and @antiquated.any?
.row
.col-md-12
%p.text-right
%button{:type=>"button", :class=>"btn btn-link btn-sm", "data-toggle"=>"collapse", "data-target"=>"#antiquated", "aria-expanded"=>"true", "aria-controls"=>"antiquated"}
%button{ type: 'button', class: 'btn btn-link btn-sm', 'data-toggle' => 'collapse', 'data-target' => '#antiquated', 'aria-expanded' => 'true', 'aria-controls' => 'antiquated'}
Older conferences
= "(#{@antiquated.count})"
%i.fa.fa-chevron-right
%i.fa.fa-chevron-down{:style => 'display: none'}
%i.fa.fa-chevron-down{ style: 'display: none' }
#antiquated.collapse
- @antiquated.each do |conference|
= render :partial => "conference_details", :locals => {:conference => conference}
= render partial: 'conference_details', locals: { conference: conference}
-content_for :script_body do
:javascript

View file

@ -21,14 +21,7 @@
= semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f|
= render partial: 'devise/shared/sign_up_form_embedded'
- if @conference.questions.any?
= render partial: 'questions', locals: { f: f }
- if @conference.events.workshops.any?
=f.inputs 'Register to Workshops' do
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
= f.inputs 'Your Travel Info' do
= f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
= f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }
= render partial: 'registration_info', locals: { f: f }
.row
.col-md-12
%p.pull-right

View file

@ -5,4 +5,4 @@
:member_label => Proc.new {|a| a.answer.title}
- if q.question_type.id == 3 # multiple choice
= f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, label: q.title,
:member_label => Proc.new {|a| a.answer.title}
:member_label => Proc.new {|a| a.answer.title}

View file

@ -0,0 +1,8 @@
- if @conference.questions.any?
= render partial: 'conference_registrations/questions', locals: { f: f }
- if @conference.events.workshops.any?
=f.inputs 'Pre-registration required for the following:' do
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
= f.inputs 'Your Travel Info' do
= f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
= f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }

View file

@ -29,9 +29,14 @@
Dashboard
- if can? :show, @conference
%li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))}"}
= link_to(edit_admin_conference_path(@conference.short_title)) do
%span.fa.fa-home
Basics
- if can? :edit, @conference
= link_to(edit_admin_conference_path(@conference.short_title)) do
%span.fa.fa-home
Basics
- else
%a
%span.fa.fa-home
Basics
%ul
- if can? :update, Contact.new(conference_id: @conference.id)
%li{:class=> "#{active_nav_li(edit_admin_conference_contact_path(@conference.short_title))}"}

View file

@ -13,17 +13,34 @@
%ul.nav.navbar-nav#splash-nav
= content_for :splash_nav
-if user_signed_in?
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
- if not current_user.name.blank?
#{current_user.name}
-else
#{current_user.email}
= image_tag(current_user.gravatar_url(size: '18'), title: "Yo #{current_user.name}!", :alt => '')
%b.caret
%ul.dropdown-menu
= render 'layouts/user_menu'
.btn-group.pull-right
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
- if not current_user.name.blank?
#{current_user.name}
-else
#{current_user.email}
= image_tag(current_user.gravatar_url(size: '18'), title: "Yo #{current_user.name}!", :alt => '')
%b.caret
%ul.dropdown-menu
= render 'layouts/user_menu'
- if can? :index, Comment
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
- if unread_notifications(current_user)
Notifications (#{unread_notifications(current_user).length})
%span.fa.fa-comment
%b.caret
%ul.dropdown-menu
- if unread_notifications(current_user).length > 0
%li.dropdown-header Last 5 Comments for:
- unread_notifications(current_user).limit(5).group_by{ |comment| comment.commentable}.each do |event, comments|
%li= link_to("#{event.title}(#{comments.count})", admin_conference_event_path(event.conference.short_title, event.id))
%li.divider
%li= link_to "See all unread Comments (#{unread_notifications(current_user).length})", admin_comments_path
%li= link_to 'See all Comments', admin_comments_path(anchor: 'all_comments')
- else
%ul.nav.navbar-nav.navbar-right
- if CONFIG['authentication']['ichain']['enabled']

View file

@ -0,0 +1,2 @@
%li= link_to("New comment for: #{unread_comment.commentable.title}", admin_conference_event_path(unread_comment.commentable.conference.short_title, unread_comment.commentable_id))

View file

@ -21,14 +21,15 @@
= link_to(destroy_user_session_path, :method=>'delete') do
%span.fa.fa-minus
Sign out
- if can? :manage, Conference
- if can? :access, Admin
%li.divider
%li
= link_to(admin_conference_index_path()) do
- if Conference.any?
- if Conference.any?
= link_to(admin_conference_index_path()) do
%span.fa.fa-home
Administration
- else
Administration
- if can? :create, Conference
=link_to(new_admin_conference_path) do
%span.fa.fa-plus
Create Conference
-if @conference and @conference.id and can? :show, @conference

View file

@ -4,9 +4,9 @@
.tabbable
%ul.nav.nav-tabs
%li.active
= link_to "Proposal", "#proposal-content", "data-toggle"=>"tab"
= link_to 'Proposal', '#proposal-content', 'data-toggle' => 'tab'
%li
= link_to 'Commercials', '#commercials-content', 'data-toggle'=>'tab'
= link_to 'Commercials', '#commercials-content', 'data-toggle' => 'tab'
.tab-content
#proposal-content.tab-pane.active
= render 'proposal/proposal_form'
@ -29,7 +29,7 @@
= link_to 'Edit', edit_conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), class: 'btn btn-primary'
- if can? :destroy, commercial
= link_to 'Delete', conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id),
:method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger'
method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
- if can? :create, @event.commercials.new
%hr
= link_to 'Add Commercial', new_conference_proposal_commercial_path(@conference.short_title, @event.id), class: 'btn btn-primary'

View file

@ -43,11 +43,11 @@
= f.input :is_highlight
%p.text-right
= link_to '#description', "data-toggle"=>"collapse" do
= link_to '#description', 'data-toggle' => 'collapse' do
Do you require something special?
.collapse#description
= f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.'
%p.text-right
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Update Proposal'
= f.submit 'Update Proposal', class: 'btn btn-success'

View file

@ -11,11 +11,11 @@
- if !current_user
%legend
%span
=link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do
=link_to('#signup', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do
= CONFIG['name']
Account
%span.pull-right#account-already
=link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do
=link_to('#signin', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do
Already have an account?
.tab-content
.tab-pane.active{role: 'tabpanel', id: 'signup'}
@ -25,7 +25,7 @@
= render partial: 'devise/shared/sign_up_form_embedded'
= f.inputs name: 'Proposal Information' do
= f.input :title, as: :string, required: true
= f.input :title, as: :string, required: true, input_html: { required: true }
= f.input :event_type_id, as: :select,
collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]},
@ -38,7 +38,7 @@
:javascript
$("##{@conference.event_types.first.id}-help").collapse('show');
= f.input :abstract, input_html: { rows: 5 },
= f.input :abstract, input_html: { rows: 5, required: true },
required: true, hint: link_to('Tips to improve your presentations', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx')
%p
@ -55,12 +55,13 @@
= f.input :require_registration, label: 'Require participants to register to your event'
%p.text-right
= link_to '#description', "data-toggle"=>"collapse", id: 'description_link' do
= link_to '#description', 'data-toggle' => 'collapse', id: 'description_link' do
Do you require something special?
.collapse#description
= f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.'
%p.text-right
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Create Proposal'
= f.submit 'Create Proposal', class: 'btn btn-success'
.tab-pane{role: 'tabpanel', id: 'signin'}
= render partial: 'devise/shared/sign_in_form_embedded'