Skip to content

Commit

Permalink
Added moderate index page linked through top menu and altered content…
Browse files Browse the repository at this point in the history
… cell headers to move padding outside of the header class itself
  • Loading branch information
brzaik committed Jul 8, 2012
1 parent 253a2b2 commit c632e36
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
font-size: 10px;
font-weight: bold;
padding: 1px 4px;

&.alert {
background-color: $red;
}
}

.link-hl .badge {
Expand Down
20 changes: 16 additions & 4 deletions app/assets/stylesheets/application/layout/contentcell.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,37 @@ section.C {
@include border-radius-corners(8px, 8px, 0px, 0px);
background: #FFF image-url('layout/C/header_bg.png') bottom left repeat-x;
display: block;
padding: 8px 14px 6px 14px;
padding-bottom: 5px;
border: solid 1px #ababab;
padding: 0px;
border: solid 1px #ababab;
border-bottom: 0px;

h1 {
color: #666;
color: #333;
font-size: 1.4em;
letter-spacing: 0.05em;
text-shadow: 0 1px #eee;
}

.default-padding {
padding: 8px 14px 5px 14px;
}

// element inside the header that can be optionally used for right-aligned
// contextual buttons relevant to this section of the page
.C-header_right {
float: right;
margin-left: 20px;
}

// status element that fits a label and a value, usually a count
// often aligned or floated to the right side of .C-header_right
.status-block {
background: $grayLightest;
height: 100%;
padding: 4px 8px;
border-left: solid 1px $gray;
}

// this element is only included when the back_button helper is used to place a back button
.C-header_back {
float: left;
Expand Down
10 changes: 10 additions & 0 deletions app/controllers/feeds_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ def index
end
end

def moderate
@feeds = Feed.all
auth!

respond_to do |format|
format.js { }
format.html { }
end
end

# GET /feeds/1
# GET /feeds/1.xml
def show
Expand Down
4 changes: 2 additions & 2 deletions app/views/contents/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<div class="span10">
<section class="C">
<header class="C-header">
<div class="C-header_right"><a class="button" href="#"><%=t(:design_graphic)%></a></div>
<h1><%= t(:add) + " " + @content.class.to_s + " " + t(:content) %></h1>
<div class="C-header_right default-padding"><a class="button" href="#"><%=t(:design_graphic)%></a></div>
<h1 class="default-padding"><%= t(:add) + " " + @content.class.to_s + " " + t(:content) %></h1>
</header>
<div class="C-cont">
<%= render 'form' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/dashboard/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section class="C">
<header class="C-header">
<h1><%= t(:dashboard) %></h1>
<h1 class="default-padding"><%= t(:dashboard) %></h1>
</header>
<div class="C-cont">
<%= form_tag "/dashboard/update" do %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/elements/_topmenu_contents.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<div class="TM-sectop">
<%= link_to t(:browse), feeds_path, :class => "btn #{ current_page?(feeds_path) || (controller.controller_name == 'submissions' && ['index', 'show'].include?(controller.action_name)) ? 'selected' : '' }" %>
<%= link_to t(:add), new_content_path, :class => "btn #{ current_page?(new_content_path) ? 'selected' : '' }" if can? :create, Content %>
<%= link_to '#', :class => "btn" do %>
<%= link_to moderate_path, :class => "btn" do %>
<%= t(:moderate) %>&nbsp;<span class="badge alert">##</span>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/feeds/_browse_header.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<h1><%=t :browse_content %></h1>
<h1 class="default-padding"><%=t :browse_content %></h1>
4 changes: 2 additions & 2 deletions app/views/feeds/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<% if user_signed_in? %>
<section class="C">
<header class="C-header">
<h3>My Concerto</h3>
<h1 class="default-padding">My Concerto</h1>
</header>
<div class="C-cont">
<div class="default-padding">
Expand All @@ -35,7 +35,7 @@

<section class="C">
<header class="C-header">
<h3>Network Vitals</h3>
<h1 class="default-padding">Network Vitals</h1>
</header>
<div class="C-cont">
<div class="default-padding">
Expand Down
32 changes: 32 additions & 0 deletions app/views/feeds/moderate.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<section class="C">
<header id="browse-header" class="C-header">
<div class="C-header_right">
<div class="status-block">
<label>PENDING</label>
<span>14</span>
</div>
</div>
<div class="default-padding">
<h1>Contents Pending Your Moderation</h1>
</div>
</header>
<div id="browse-body" class="C-cont">
<div class="default-padding">
<h2><%= @feeds.count %> feeds with pending content</h2>
</div>

<ul class="SL">
<% @feeds.each do |pending_feed| %>
<li>
<h3>
<%= link_to feed_submissions_path(pending_feed), :remote => true, :class => "link-hl" do %>
<span class="badge alert"><%= pending_feed.pending_contents.count %></span> <%= pending_feed.name %>
<% end %>
</h3>
</li>
<% end %>
</ul>

<div class="clear"></div>
</div>
</section>
4 changes: 2 additions & 2 deletions app/views/groups/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="span9">
<section class="C">
<header class="C-header">
<h1>All Groups <%= link_to 'New Group', new_group_path, :class => "button" %></h1>
<h1 class="default-padding">All Groups <%= link_to 'New Group', new_group_path, :class => "button" %></h1>
</header>
<div class="C-cont">
<div class="subnav clearfix">
Expand Down Expand Up @@ -55,7 +55,7 @@
<div class="span3">
<section class="C">
<header class="C-header">
<h1><%= t(:users) %></h1>
<h1 class="default-padding"><%= t(:users) %></h1>
</header>
<div class="C-cont">
&nbsp;
Expand Down
4 changes: 2 additions & 2 deletions app/views/screens/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="span9">
<section class="C">
<header class="C-header" id="screens-header">
<h1>All Screens <%= link_to 'New Screen', new_screen_path, :class => "btn" if can? :create, Screen %></h1>
<h1 class="default-padding">All Screens <%= link_to 'New Screen', new_screen_path, :class => "btn" if can? :create, Screen %></h1>
</header>
<div id="screens-body" class="C-cont">
<%= render :partial => "screens/index_body" %>
Expand All @@ -13,7 +13,7 @@
<div class="span3">
<section class="C">
<header class="C-header">
<h1>Templates <%= link_to 'New Template', new_template_path, :class => "btn" if can? :create, Template %></h1>
<h1 class="default-padding">Templates <%= link_to 'New Template', new_template_path, :class => "btn" if can? :create, Template %></h1>
</header>
<div class="C-cont">
<%= render :partial => "templates/index_body" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_index_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 id="contentlist">
<h1 class="default-padding" id="contentlist">
<%= link_to "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;
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,4 +1,4 @@
<h1 id="contentlist">
<h1 class="default-padding" id="contentlist">
<%= link_to "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;
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
resources :fields
end

match "moderate/" => "feeds#moderate"

resources :feeds do
resources :submissions, :only => [:index, :show, :update]
end
Expand Down

0 comments on commit c632e36

Please sign in to comment.