Commit 9fdc0f73 authored by marcheing's avatar marcheing Committed by Diego de Araújo Martinez Camarinha

Convert content templates to slim

parent 749c45c6
<div class="content-details">
<div class="left-col">
<h2 class="content-title"><%= content.title %></h2>
<div class="inline-grid">
<h3 class="content-author"><%= t('.by') %> <%= content.user.profile.full_name %></h3>
<!-- TODO: Uncomment after the follow routes are defined
<a href=<#= follow_path(video.user) %> class="follow-button small has-tip top" data-tooltip aria-haspopup="true" class="has-tip top ic-premio" data-disable-hover='false' tabindex=1 title="Seguir usuário">
<i class="fa fa-long-arrow-left"></i>
<i class="fa fa-long-arrow-left"></i>
<i class="fa fa-long-arrow-left"></i>
<i class="fa fa-long-arrow-left"></i>
</a>
-->
</div>
<p><%= content.user.profile.city %> - <%= content.user.profile.state %> <%= content.user.profile.country %></p>
<p><%= t('.added_on', date: content.created_at.to_date) %><span class="video-license">BY-NC-SA</span></p>
</div>
<div class="right-col">
<!-- TODO: Uncomment after video awards and features are implemented
<div class="content-icons-group">
<# if video.awarded? %>
<span data-tooltip aria-haspopup="true" class="has-tip top ic-premio" data-disable-hover='false' tabindex=1 title="<#= t('.awarded')%>"></span>
<# end %>
<# if featured? video %>
<span data-tooltip aria-haspopup="true" class="has-tip top ic-destaque" data-disable-hover='false' tabindex=1 title="<#= t('.featured')%>"></span>
<# end %>
</div>
-->
<h3 class="content-views"><%= content.view_count %> <%= t('.views') %></h3>
<!-- TODO: Uncomment after content rating backed is complete
<div class="content-rating">
<# if user_signed_in? %>
<#= form_tag '/votes', method: :post, remote: true do %>
<#= hidden_field_tag 'vote[content_id]', video.id %>
<%# TODO: Votes will be public only on public contests %>
<#= hidden_field_tag 'public_vote', false %>
<input type="range" min="0" max="5" value="<#= video.average_of_users_grade_rounded %>" step="0.5" id="content-rating-val" name="vote[grade]">
<div class="rateit" data-rateit-backingfld="#content-rating-val" data-rateit-ispreset="true" data-rateit-starwidth="20" data-rateit-starheight="20"></div>
<div>
<button type="submit" class="evaluate-button"><#= t('.evaluate') %></button>
</div>
<# end %>
<# else %>
<#= t('.needs_to_login_to_evaluate') %>
<# end %>
</div>
-->
</div>
<div class="columns small-12">
<!-- Uncomment after the tags backend is complete
<h3 class="content-tags"><#= t('.contents.show.details.tags') %>
<# if video.show_tags.empty? %>
<#= t('.none') %>
<# else %>
<#= video.show_tags %>
<# end %>
</h3>
-->
<!-- Uncomment after the contests backend is complete
<h3 class="content-contests"> <#= t('.contents.show.details.contests') %>
<# if video.contests.empty? %>
<#= t('.none') %>
<# else %>
<# video.contests.each do |contest| %>
<#= link_to(contest.name, contest_path(id: contest)) %>
<# end %>
<# end %>
</h3>
-->
</div>
</div>
.content-details
.left-col
h2.content-title
= content.title
.inline-grid
h3.content-author
= t('.by')
= content.user.profile.full_name
p
= content.user.profile.city
| -
= content.user.profile.state
= content.user.profile.country
p
= t('.added_on', date: content.created_at.to_date)
span.video-license
| BY-NC-SA
.right-col
h3.content-views
= content.view_count
= t('.views')
.columns.small-12
<div class="form-section">
<div class="columns small-12">
<h2><%= t('send_content') %></h2>
</div>
<%= form_for(content, id: 'content-upload-form', 'data-abide' => true, novalidate: true, html: { multipart: true } ) do |f| %>
<% if content.errors.any? %>
<div id="error_explanation" data-abide-error class="alert callout">
<h2 class="fa fa-exclamation-circle"><%= pluralize(content.errors.count, "error") %> <%= t('content_save_error_nessage') %></h2>
<ul>
<% content.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<fieldset>
<div class="field-label">
<%= f.label "#{t('author')} *", for: 'content_author' %>
</div>
<div class="field-item">
<%= f.text_field :author, required: true, disabled: true, value: current_user.profile.full_name %>
</div>
</fieldset>
<!-- TODO: Add contests for content upload
<fieldset class="contest-select">
<div class="field-label">
<legend>
Concurso *
<span data-tooltip aria-haspopup="true" class="has-tip top" data-disable-hover='false' tabindex=1 title="Você pode incluir o seu vídeo em mais de um concurso, caso ele se encaixe no tema"><i class="fa fa-question-circle"></i></span>
</legend>
</div>
<div class="field-item">
<input type="checkbox" name="contest-select" id="contest-1"><label for="contest-1">Concurso 1 <a href="#" title="Ver concurso" target="_blank"><i class="fa fa-external-link"></i></a></label><br />
<input type="checkbox" name="contest-select" id="contest-2"><label for="contest-2">Concurso 2 <a href="#" title="Ver concurso" target="_blank"><i class="fa fa-external-link"></i></a></label><br />
<input type="checkbox" name="contest-select" id="contest-3"><label for="contest-3">Concurso 3 <a href="#" title="Ver concurso" target="_blank"><i class="fa fa-external-link"></i></a></label><br />
<input type="checkbox" name="contest-select" id="contest-4"><label for="contest-4">Concurso 4 <a href="#" title="Ver concurso" target="_blank"><i class="fa fa-external-link"></i></a></label>
</div>
</fieldset>
-->
<fieldset>
<div class="field-label-item">
<%= f.check_box :terms_of_service, id: 'user-terms', required: true %>
<%= f.label for: :terms_of_service do %>
<%= t('terms_of_service_html', link: (link_to t('terms_of_use'), terms_of_use_path, :data => { :colorbox => true, :colorbox_height => '80%', :colorbox_width => '80%' })) %>
<% end %>
</div>
</fieldset>
<div id="content-upload-field-group">
<div class="content-field-group video-field">
<fieldset>
<div class="field-label-item">
<h3><%= t('video') %></h3>
</div>
<div class="field-label">
<%= f.label "#{t('video')} *", for: 'video-upload' %>
</div>
<div class="field-item">
<%= f.label t('select_file'), for: 'video-upload', class: 'button' %>
<%= f.file_field :video, required: true, class: 'show-for-sr', id: 'video-upload' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('title')} *", for: 'video-title' %>
</div>
<div class="field-item">
<%= f.text_field :title, required: true, id: 'video-title' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('director')} *", for: 'video-director' %>
</div>
<div class="field-item">
<%= f.text_field :director, required: true, id: 'video-director' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label t('co_director'), for: 'video-co-director' %>
</div>
<div class="field-item">
<%= f.text_field :co_director, id: 'video-co-director' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label(for: 'video-team') do %>
<%= t('team') %>
<span data-tooltip aria-haspopup="true" class="has-tip top" data-disable-hover="false" tabindex=1 title="<%= t('team_tooltip') %>"><i class="fa fa-question-circle"></i></span>
<% end %>
</div>
<div class="field-item">
<%= f.text_area :team, id: 'video-team' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label(for: 'video-soundtrack') do %>
<%= "#{t('soundtrack')} *" %>
<span data-tooltip aria-haspopup="true" class="has-tip top" data-disable-hover="false" tabindex=1 title="<%= t('soundtrack_tooltip') %>"><i class="fa fa-question-circle"></i></span>
<% end %>
</div>
<div class="field-item">
<%= f.text_field :soundtrack, id: 'video-soundtrack', required: true %>
</div>
</fieldset>
<fieldset>
<div class="field-label-item">
<%= f.label(for: 'video-has-location') do %>
<%= check_box_tag 'video-has-location', 'yes' %>
<%= t('specific_location') %>
<% end %>
</div>
</fieldset>
<fieldset style="display: none;" id="video-location">
<div class="field-label">
<%= f.label "#{t('zip_code')} *", for: 'video-location-postal-code' %>
</div>
<div class="field-item">
<%= f.text_field :zip_code, id: 'video-location-postal-code', placeholder: '99999-999' %>
</div>
</fieldset>
<!-- TODO: Add tag support for contents
<fieldset>
<div class="field-label">
<label for="video-tags">Tags</label>
</div>
<div class="field-item">
<input type="text" id="video-tags" name="video-tags" placeholder="" aria-describedby="tagsHelpText">
<span class="form-error">
Campo obrigatório.
</span>
<p class="help-text" id="tagsHelpText">Utilize vírgulas entre as tags</p>
</div>
</fieldset>
-->
<fieldset>
<div class="field-label-item">
<%= f.label(for: 'video-adults-only') do %>
<%= f.check_box :adult, id: 'video-adults-only', value: 'yes' %>
<%= t('adult') %>
<% end %>
</div>
</fieldset>
<fieldset>
<div class="field-label-item">
<%= f.label(for: 'video-allow-commentary') do %>
<%= f.check_box :allow_comments, id: 'video-allow-commentary', value: 'yes' %>
<%= t('allow_commentary') %>
<% end %>
</div>
</fieldset>
</div>
</div>
<fieldset>
<div class="field-label-item">
<%= f.submit t('register'), class: 'button' %>
</div>
</fieldset>
<% end %>
</div>
<% content_for :footer do %>
<%= javascript_include_tag 'contents/show_zip_code_input.js' %>
<% end %>
.form-section
.columns.small-12
h2
= t('send_content')
= form_for(content, id: 'content-upload-form', 'data-abide' => true, novalidate: true, html: { multipart: true } ) do |f|
- if content.errors.any?
#error_explanation.alert.callout[data-abide-error]
h2.fa.fa-exclamation-circle
= pluralize(content.errors.count, "error")
= t('content_save_error_nessage')
ul
- content.errors.full_messages.each do |message|
li
= message
fieldset
.field-label
= f.label "#{t('author')} *", for: 'content_author'
.field-item
= f.text_field :author, required: true, disabled: true, value: current_user.profile.full_name
fieldset
.field-label-item
= f.check_box :terms_of_service, id: 'user-terms', required: true
= f.label for: :terms_of_service do
= t('terms_of_service_html', link: (link_to t('terms_of_use'), terms_of_use_path, :data => { :colorbox => true, :colorbox_height => '80%', :colorbox_width => '80%' }))
#content-upload-field-group
.content-field-group.video-field
fieldset
.field-label-item
h3
= t('video')
.field-label
= f.label "#{t('video')} *", for: 'video-upload'
.field-item
= f.label t('select_file'), for: 'video-upload', class: 'button'
= f.file_field :video, required: true, class: 'show-for-sr', id: 'video-upload'
fieldset
.field-label
= f.label "#{t('title')} *", for: 'video-title'
.field-item
= f.text_field :title, required: true, id: 'video-title'
fieldset
.field-label
= f.label "#{t('director')} *", for: 'video-director'
.field-item
= f.text_field :director, required: true, id: 'video-director'
fieldset
.field-label
= f.label t('co_director'), for: 'video-co-director'
.field-item
= f.text_field :co_director, id: 'video-co-director'
fieldset
.field-label
= f.label(for: 'video-team') do
= t('team')
| <span data-tooltip aria-haspopup="true" class="has-tip top" data-disable-hover="false" tabindex=1 title="
= t('team_tooltip')
| ">
i.fa.fa-question-circle
.field-item
= f.text_area :team, id: 'video-team'
fieldset
.field-label
= f.label(for: 'video-soundtrack') do
= "#{t('soundtrack')} *"
| <span data-tooltip aria-haspopup="true" class="has-tip top" data-disable-hover="false" tabindex=1 title="
= t('soundtrack_tooltip')
| ">
i.fa.fa-question-circle
.field-item
= f.text_field :soundtrack, id: 'video-soundtrack', required: true
fieldset
.field-label-item
= f.label(for: 'video-has-location') do
= check_box_tag 'video-has-location', 'yes'
= t('specific_location')
fieldset#video-location[style="display: none;"]
.field-label
= f.label "#{t('zip_code')} *", for: 'video-location-postal-code'
.field-item
= f.text_field :zip_code, id: 'video-location-postal-code', placeholder: '99999-999'
fieldset
.field-label-item
= f.label(for: 'video-adults-only') do
= f.check_box :adult, id: 'video-adults-only', value: 'yes'
= t('adult')
fieldset
.field-label-item
= f.label(for: 'video-allow-commentary') do
= f.check_box :allow_comments, id: 'video-allow-commentary', value: 'yes'
= t('allow_commentary')
fieldset
.field-label-item
= f.submit t('register'), class: 'button'
- content_for :footer do
= javascript_include_tag 'contents/show_zip_code_input.js'
<div class="player-box">
<%# FIXME: Poltergeist server won't recognize the video source if put on a source tag %>
<video id="video-<%= content.id %>" class="video-js" controls preload="none" data-setup="{}" src="<%= video.url %>" type="video/mp4">
<p class="vjs-no-js">
<%= t('.video_js_support_message_html') %>
</p>
</video>
</div>
.player-box
- # FIXME: Poltergeist server won't recognize the video source if put on a source tag
| <video id="video-
= content.id
| " class="video-js" controls preload="none" data-setup="{}" src="
= video.url
| " type="video/mp4">
p.vjs-no-js
= t('.video_js_support_message_html')
<h1>New Content</h1>
<%= render 'form', content: @content %>
<%= link_to 'Back', contents_path %>
h1
| New Content
= render 'form', content: @content
= link_to 'Back', contents_path
<main>
<%= hidden_field_tag 'share_translation', t('.share') %>
<%= hidden_field_tag 'share_instructions_translation', t('.share_instructions') %>
<%= hidden_field_tag 'video_link', content_url(@content.id) %>
<div class="content-detailed-section">
<div class="autoplay-section">
<div class="autoplay-label"><%= t('.autoplay') %></div>
<div class="switch tiny">
<input class="switch-input" id="auto-play" type="checkbox" name="autoplay">
<label class="switch-paddle" for="auto-play">
<span class="show-for-sr"><%= t('.autoplay') %></span>
</label>
</div>
</div>
<div class="content-box">
<%= render partial: 'video_player', locals: { content: @content, video: @video } %>
</div>
<%= render partial: 'content_details', locals: { content: @content } %>
</div>
<div class="related-content">
<div class="content-sub-container">
<div class="inline-grid">
<ul class="tabs" data-tabs id="example-tabs">
<li class="tabs-title is-active"><a href="#list-videos-related" aria-selected="true"><%= t('.related_content') %></a></li>
<li class="tabs-title"><a href="#list-videos-same-author"><%= t('.other_content_from_user')%></a></li>
<!-- TODO: Uncomment and add comments partial after the comment backend
<# if @video.allow_comments? %>
<li class="tabs-title"><a href="#comments"><#= t('.comment_this_content') %></a></li>
<# end %>
-->
</ul>
</div>
</div>
<div class="tabs-content" data-tabs-content="example-tabs">
<div class="tabs-panel is-active" id="list-videos-related">
<div id="list-related">
</div>
<p class="see-more">
<a name="load_related" class="see-more-button"><%= t('.see_more') %></a>
</p>
</div>
<div class="tabs-panel" id="list-videos-same-author">
<div id="list-same">
</div>
<p class="see-more">
<a name="load_more_from_user" class="see-more-button"><%= t('.see_more') %></a>
</p>
</div>
<!-- TODO: Uncomment and add comments partial after the comment backend
<#= render partial: 'comments', locals: { video: @video } %>
-->
</div>
</div>
</main>
<% content_for :footer do %>
<%= javascript_include_tag 'contents/share_button.js' %>
<% end %>
main
= hidden_field_tag 'share_translation', t('.share')
= hidden_field_tag 'share_instructions_translation', t('.share_instructions')
= hidden_field_tag 'video_link', content_url(@content.id)
.content-detailed-section
.autoplay-section
.autoplay-label
= t('.autoplay')
.switch.tiny
input#auto-play.switch-input[type="checkbox" name="autoplay"]
label.switch-paddle[for="auto-play"]
span.show-for-sr
= t('.autoplay')
.content-box
= render partial: 'video_player', locals: { content: @content, video: @video }
= render partial: 'content_details', locals: { content: @content }
.related-content
.content-sub-container
.inline-grid
ul#example-tabs.tabs[data-tabs]
li.tabs-title.is-active
a[href="#list-videos-related" aria-selected="true"]
= t('.related_content')
li.tabs-title
a[href="#list-videos-same-author"]
= t('.other_content_from_user')
.tabs-content[data-tabs-content="example-tabs"]
#list-videos-related.tabs-panel.is-active
#list-related
p.see-more
a.see-more-button[name="load_related"]
= t('.see_more')
#list-videos-same-author.tabs-panel
#list-same
p.see-more
a.see-more-button[name="load_more_from_user"]
= t('.see_more')
- content_for :footer do
= javascript_include_tag 'contents/share_button.js'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment