osem-fcy/app/views/proposal/_proposal_form.html.haml
2014-07-23 16:24:05 +02:00

72 lines
3.9 KiB
Text

= semantic_form_for(@event, :url => @url) do |f|
%section#basic
= f.inputs :name => "Session Information" do
- if !@conference.call_for_papers.schedule_changes && @event.state == "confirmed" && !organizer_or_admin?
Title: #{@event.title}
%br
%br
- else
= f.input :title, :as => :string, :required => true
= f.input :subtitle, :as => :string
%section#details
- if (@event.state === "unconfirmed" || @event.state === "confirmed") && !organizer_or_admin? && !@conference.call_for_papers.schedule_changes
Event type: #{@event.event_type.title}
%br
%br
- else
= f.input :event_type_id,:as => :select, :collection => @conference.event_types.map {|x| ["#{x.title} - #{show_time(x.length)}", x.id]}, :include_blank => false, :label => "Session Type"
= f.input :difficulty_level, :as => :select, :collection => @conference.difficulty_levels, :include_blank => "(Please select)" if @conference.use_difficulty_levels
= f.input :require_registration
= f.input :abstract, :input_html => {:rows => 5, :class => "span11"},
:required => true, :label => "Session Abstract"
You have used
%span#abstract-count #{@event.abstract_word_count}
words. Abstracts must be between
%span#abstract-minimum-word-count
0
and
%span#abstract-maximum-word-count
250
words.
%br
%br
= f.input :description, :input_html => {:rows => 5, :class=> "span11"}, :hint => "This will only be shown to organizers, not to attendees."
= f.input :media_type, :as => :select, :label => "Media Type", :collection => Conference.media_types.values, :include_blank => false
%p{:class => "help-block media-type", :id => "youtube-help"} Go to your YouTube video, click on "share" and copy everything behind http://youtu.be/"
%p{:class => "help-block media-type", :id => "slideshare-help", :style => "display:none"} Go to your SlideShare, click on "share" -> "embed" and copy the id
%p{:class => "help-block media-type", :id => "flickr-help", :style => "display:none"} Go to your flickr image, click on "Grab the link" -> "Show short url" and copy everything behind https://flic.kr/p/
%p{:class => "help-block media-type", :id => "vimeo-help", :style => "display:none"} Go to your vimeo video, click on "share" and copy everything behind http://vimeo.com/
%p{:class => "help-block media-type", :id => "speakerdeck-help", :style => "display:none"} Go to your SpeakerDeck, click on "share" -> "embed" and copy the data-id
%p{:class => "help-block media-type", :id => "instagram-help", :style => "display:none"} Go to your Instagram photo page and copy everything behind instagram.com/p/ (without trailing /# hash symbol)
= f.input :media_id, :label => "Media ID", :as => :string
%section#information
- if current_user.name.blank? || current_user.biography.blank?
= f.inputs :name => "Your Information" do
= semantic_fields_for current_user do |u|
- if current_user.name.blank?
= u.input :name, :as => :string, :required => true
- if current_user.biography.blank?
= u.input :biography, :required => true, :input_html => {:rows => 5, :class => 'span11', "onkeyup" => "word_count(this, 'biography-count', 150)"}
You have used
%span#biography-count #{current_user.biography_word_count}
words. Biographies are limited to 150 words.
%p.text-right
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}
:javascript
var maxcount = 0;
$("#event_event_type_id").change(function () {
var str = "";
var min_str = ""
#{generate_abstract_length_js @conference}
$("#abstract-maximum-word-count").text(str);
$("#abstract-minimum-word-count").text(min_str);
word_count($('#event_abstract').get(0), 'abstract-count', maxcount);
})
.trigger('change');
$("#event_abstract").bind('keyup', function() {
word_count(this, 'abstract-count', maxcount);
} );