Skip to content

Commit

Permalink
start of submissions and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
zr2d2 committed Oct 28, 2012
1 parent f70679b commit a7bc8e8
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 40 deletions.
4 changes: 2 additions & 2 deletions app/views/contents/graphic/_form_top.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ if @content.media.empty?
end
%>
<fieldset>
<legend><span><%=t(:upload_graphic)%></span></legend>
<legend><span><%= t(:upload_graphic) %></span></legend>
<div class="clearfix">
<label><%=t(:specify_file)%></label>
<label><%= t(:specify_file) %></label>
<div class="input">
<%= form.fields_for :media do |media| %>
<%= media.file_field :file %>
Expand Down
12 changes: 6 additions & 6 deletions app/views/submissions/_index_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<div class="viewblock-header_right">
<div class="status-block">
<label>ACTIVE</label>
<label><%= t(:active).upcase %></label>
<span><%= @approved_submissions ? @approved_submissions.count : 0 %></span>
</div>
<div class="status-block">
<label>PENDING</label>
<label><%= t(:pending).upcase %></label>
<span><%= @pending_submissions ? @pending_submissions.count : 0 %></span>
</div>
<div class="status-block">
<label>EXPIRED</label>
<label><%= t(:expired).upcase %></label>
<span><%= @expired_submissions ? @expired_submissions.count : 0 %></span>
</div>
<div class="status-block">
<label>DENIED</label>
<label><%= t(:denied).upcase %></label>
<span><%= @denied_submissions ? @denied_submissions.count : 0 %></span>
</div>
</div>
<div class="default-padding">
<h1 id="contentlist">
<%= link_to "All Feeds", feeds_path, :remote => true %> &gt;
<%= link_to t(:all_feeds), feeds_path, :remote => true %> &gt;
<% @feed.ancestors.reverse.each do |ancestor_feed| %>
<%= link_to ancestor_feed.name, feed_submissions_path(ancestor_feed), :remote => true %> &gt;
<% end %>
<%= @feed.name %> (moderated by <%= link_to @feed.group.name, group_path(@feed.group) %>)
<%= @feed.name %> (<%= t(:moderated_by) %> <%= link_to @feed.group.name, group_path(@feed.group) %>)
</h1>
</div>

2 changes: 1 addition & 1 deletion app/views/submissions/_moderate_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<%= f.hidden_field :moderation_flag, { :value => true }%>
<% else %>
<div class="clearfix">
<%= f.label :moderation_reason, "Reason" %>
<%= f.label :moderation_reason, t(:reason) %>
<div class="input">
<%= f.text_area :moderation_reason, :rows => 5, :style => "width: 90%;" %>
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/views/submissions/_show_body.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<h3>
<% case @submission.moderation_flag %>
<% when true %>
<b>Approved</b>
<b><%= t(:approved) %></b>
<% when false %>
<b>Denied</b>
<b><%= t(:denied) %></b>
<% when nil %>
<b>Pending Moderation</b>
<b><%= t(:pending_moderation) %></b>
<% end %>
</h3>

Expand Down Expand Up @@ -76,7 +76,7 @@


<p>
<%= link_to "#{ @submission.moderation_flag.nil? ? 'Moderate...' : 'Change Moderation'}", "#", :class => "btn small dropdown-control dd-moderate", :title => "Moderate '#{ @submission.content.name }'", :rel => "#moderate_#{ @submission.id }" %>
<%= link_to "#{ @submission.moderation_flag.nil? ? t(:moderate) : (:change_moderation)}", "#", :class => "btn small dropdown-control dd-moderate", :title => t(:moderate_title, :name => @submission.content.name), :rel => "#moderate_#{ @submission.id }" %>
</p>

<div id="moderate_<%= @submission.id %>" style="display:none;">
Expand Down Expand Up @@ -111,12 +111,12 @@

<div class="subblock">
<% user = User.find(@submission.content.user_id) %>
Submitted by <%= link_to user.name, user %>
<%= t(:submitted_by) %> <%= link_to user.name, user %>
</div>

<div class="subblock">
<% if @other_submissions.count > 0 %>
<h3>Also appears on...</h3>
<h3><%= t(:also_appears_on) %></h3>
<ul>
<% @other_submissions.each do |submission| %>
<li><%= link_to submission.feed.name, [submission.feed, submission] %></li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_show_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 class="default-padding" id="contentlist">
<%= link_to "All Feeds", feeds_path, :remote => true %> &gt;
<%= link_to t(:all_feeds), feeds_path, :remote => true %> &gt;
<% @submission.feed.ancestors.reverse.each do |ancestor_feed| %>
<%= link_to ancestor_feed.name, feed_submissions_path(ancestor_feed), :remote => true %> &gt;
<% end %>
Expand Down
22 changes: 11 additions & 11 deletions app/views/submissions/_submission_listgriditem.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@
<div class="cont">
<p><b><%= link_to submission.content.name, [submission.feed, submission], :remote => true %></b></p>

<p><%= submission.content.start_time.strftime("%m/%d") %> to <%= submission.content.end_time.strftime("%m/%d") %>
<p><%= t(:date_range, :start => submission.content.start_time.strftime("%m/%d"), :end => submission.content.end_time.strftime("%m/%d")) %>
<% if submission.is_pending? && submission.content.is_active? %>
<%= link_to "Urgent", "#", :class => "tooltip-basic", 'data-tooltip-text' => "Hey! This content has already passed its requested start date and you should moderate it." %>
<%= link_to t(:urgent), "#", :class => "tooltip-basic", 'data-tooltip-text' => t(:urgent_tooltip) %>
<% end -%>
</p>

<% if submission.is_pending? and !submission.content.is_expired? %>
<% unless submission.content.is_expired? %>
<p>
<%= link_to "Moderate...", "#", :class => "btn small dropdown-control dd-moderate", :title => "Moderate '#{ submission.content.name }'", :rel => "#moderate_#{ submission.id }" %>
<%= link_to t(:moderate), "#", :class => "btn small dropdown-control dd-moderate", :title => t(:moderate_title, :name => submission.content.name), :rel => "#moderate_#{ submission.id }" %>
</p>

<div id="moderate_<%= submission.id %>" style="display:none;">
<% if submission.is_approved? %>
<p>Currently <b style="color: green;">Approved</b></p>
<p>Change to Denied</p>
<p><%= t(:currently) %> <b style="color: green;"><%= t(:approved) %></b></p>
<p><%= t(:change_to_denied) %></p>
<%= render :partial => "submissions/moderate_form", :locals => { :submission => submission, :moderate => false } %>
<% elsif submission.is_denied? %>
<p>Currently <b style="color: red;">Denied</b></p>
<p>Change to Approved</p>
<p><%= t(:currently) %> <b style="color: red;"><%= t(:denied) %></b></p>
<p><%= t(:change_to_approved) %></p>
<%= render :partial => "submissions/moderate_form", :locals => { :submission => submission, :moderate => true } %>
<% else %>
<p>Currently <b>Pending Moderation</b></p>
<p><%= t(:currently) %> <b><%= t(:pending_moderation) %></b></p>
<div class="form-stacked">
<div class="moderate-select" class="btn-toolbar">
<div class="btn-group" data-toggle="buttons-radio">
<button class="btn approve">Approve</button>
<button class="btn deny">Deny</button>
<button class="btn approve"><%= t(:approve) %></button>
<button class="btn deny"><%= t(:deny) %></button>
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions app/views/templates/_create_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= form_for(@template, :html => { :multipart => true }) do |f| %>
<% if @template.errors.any? %>
<div id="errorExplanation">
<h2><%= pluralize(@template.errors.count, "error") %> prohibited this template from being saved:</h2>
<h2><%= pluralize(@template.errors.count, t(:error) ) + t(:prohibited_save) %></h2>
<ul>
<% @template.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
Expand All @@ -26,7 +26,7 @@
</div>

<div class="clearfix">
<%= f.label "Background Image" %>
<%= f.label :media %>
<div class="input">
<%= f.fields_for :media do |media| %>
<%= media.file_field :file %>
Expand All @@ -36,7 +36,7 @@

<div class="clearfix">
<div class="input">
<%= f.check_box :is_hidden %> <%= f.label :is_hidden, "Hide this template from being shown in lists" %>
<%= f.check_box :is_hidden %> <%= f.label :is_hidden %>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/templates/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
</fieldset>

<div class="submit_bar actions">
<%= f.submit "Submit", :class => "btn primary" %>
<%= f.submit t(:submit), :class => "btn primary" %>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/views/templates/_import_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= form_for(@template, :url => import_templates_path, :html => { :multipart => true }) do |f| %>
<% if @template.errors.any? %>
<div id="errorExplanation">
<h2><%= pluralize(@template.errors.count, "error") %> prohibited this template from being saved:</h2>
<h2><%= pluralize(@template.errors.count, t(:error) ) + t(:prohibited_save) %></h2>
<ul>
<% @template.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
Expand Down
6 changes: 3 additions & 3 deletions app/views/templates/_show_body.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%= link_to '[Edit]', edit_template_path(@template) %>
<%= link_to t(:edit), edit_template_path(@template) %>

<article>
<%= image_tag preview_template_path(@template, :width=> 600, :format => :png), :style => "width: 100%", :alt => "#{@template.name} Preview" %>
<%= image_tag preview_template_path(@template, :width=> 600, :format => :png), :style => "width: 100%", :alt => t(:preview, :name => @template.name) %>
</article>
<aside>
<p>
<b>Author:</b>
<b><%= t(:author) %></b>
<%= @template.author %>
</p>
</aside>
Expand Down
2 changes: 1 addition & 1 deletion app/views/templates/_show_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 class="default-padding" id="contentlist">
<%= link_to "All Templates", templates_path %> &gt;
<%= link_to t(:all_templates), templates_path %> &gt;
<%= @template.name %>
</h1>
2 changes: 1 addition & 1 deletion app/views/templates/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<section class="viewblock">
<header class="viewblock-header" id="template-header">
<%= back_button template_path(@template), :back %>
<h1 class="default-padding">Editing template</h1>
<h1 class="default-padding"><%= t(:editing_template) %></h1>
</header>
<div class="viewblock-cont">
<%= render 'form', :locals => { :template => @template } %>
Expand Down
11 changes: 10 additions & 1 deletion config/locales/views/contents/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,13 @@ en:
display_from: "Display From:"
display_until: "Display Until:"
submitted_by: "Submitted by"
appears_on: "Appears on..."
appears_on: "Appears on..."

helpers:
label:
graphic:
name: 'Name'
submit: 'Submit'
duration: 'Duration'
start_time: 'Start Time'
end_time: 'End Time'
34 changes: 32 additions & 2 deletions config/locales/views/submissions/en.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
en:
browse_submissions: "Browse Submissions"
moderate: "Moderate"
browse_submissions: 'Browse Submissions'

#_index_header
moderated_by: 'moderated by'
expired: 'expired'

#_moderate_form
reason: Reason

#_show_body
change_moderation: 'Change Moderation'
submitted_by: 'Submitted By'
also_appears_on: 'Also appears on...'

#_show_header
all_feeds: 'All Feeds'

#_submission_listgriditem
date_range: '%{start} to %{end}'
urgent: 'Urgent'
urgent_tooltip: 'Hey! This content has already passed its requested start date and you should moderate it.'
moderate: 'Moderate...'
moderate_title: 'moderate %{name}!'
currently: 'currently'
approved: 'Approved'
denied: 'Denied'
change_to_denied: 'Change to Denied'
change_to_approved: 'Change to Approved'
pending_moderation: 'Pending Moderation'
approve: 'approve'
deny: 'deny'

21 changes: 21 additions & 0 deletions config/locales/views/templates/en.yml
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
en:
#_create_form
background_image: 'Background Image'

#_show_body
edit: '[Edit]'
preview_alt: '%{name} Preview'
author: 'Author'

#_show_header
all_templates: 'All Templates'

#edit
editing_template: 'Editing template'

helpers:
label:
template:
name: 'Name'
author: 'Author'
media: 'Background Image'
is_hidden: 'Hide this template from being shown in lists'

0 comments on commit a7bc8e8

Please sign in to comment.