Skip to content

Commit

Permalink
Began to change views and top menu to match revised info arch
Browse files Browse the repository at this point in the history
  • Loading branch information
brzaik committed Jul 6, 2012
1 parent 61fd619 commit 2afe18b
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 55 deletions.
1 change: 1 addition & 0 deletions app/controllers/screens_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class ScreensController < ApplicationController
# GET /screens.xml
def index
@screens = Screen.all
@templates = Template.all

respond_to do |format|
format.html # index.html.erb
Expand Down
39 changes: 20 additions & 19 deletions app/views/elements/_topmenu_contents.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,44 @@

<!-- Begin Menu for CONTENT -->
<section>
<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 %>
</div>
<div class="TM-secbot">
<h1><%= t(:content) %></h1>
</div>
<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 %>
</div>
<div class="TM-secbot">
<h1><%= t(:content) %></h1>
</div>
</section>
<!-- End Menu for CONTENT -->

<!-- Begin Menu for SCREENS -->
<!-- Begin Menu for NETWORK -->
<% if !(Group.joins(:screens, :users).where(:users => {:id => current_user.id}) + current_user.screens).empty? %>
<section>
<div class="TM-sectop">
<%= link_to t(:manage), screens_path, :class => "btn #{ controller.controller_name == 'screens' ? 'selected' : '' }" %>
<%= link_to t(:templates), templates_path, :class => "btn #{ controller.controller_name == 'templates' ? 'selected' : '' }" %>
<%= link_to t(:screens), screens_path, :class => "btn #{ controller.controller_name == 'screens' ? 'selected' : '' }" %>
<%#= link_to t(:templates), templates_path, :class => "btn #{ controller.controller_name == 'templates' ? 'selected' : '' }" %>
<%= link_to t(:users_and_groups), groups_path, :class => "btn #{ controller.controller_name == 'groups' ? 'selected' : '' }" %>
<%# if can? :list, User %>
<%#= link_to t(:accounts), users_path, :class => "btn #{ controller.controller_name == 'users' ? 'selected' : '' }" %>
<%# end %>
</div>
<div class="TM-secbot">
<h1><%= t(:screens) %></h1>
<h1><%= t(:network) %></h1>
</div>
</section>
<% end %>
<!-- End Menu for SCREENS -->
<!-- End Menu for NETWORK -->

<!-- Begin Menu for USER GROUPS -->
<!-- Begin Menu for ADMIN -->
<section>
<div class="TM-sectop">
<%= link_to t(:groups), groups_path, :class => "btn #{ controller.controller_name == 'groups' ? 'selected' : '' }" %>
<% if can? :list, User %>
<%= link_to t(:accounts), users_path, :class => "btn #{ controller.controller_name == 'users' ? 'selected' : '' }" %>
<% end %>
<%= link_to t(:dashboard), dashboard_path, :class => "btn #{ controller.controller_name == 'dashboard' ? 'selected' : '' }" %>
</div>
<div class="TM-secbot">
<h1><%= t(:users) %></h1>
<h1><%= t(:admin) %></h1>
</div>
</section>
<!-- End Menu for USER GROUPS -->
<!-- End Menu for ADMIN -->

<!-- Begin User Login Area -->
<section class="right">
Expand Down
67 changes: 40 additions & 27 deletions app/views/groups/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
<section class="C no">
<header class="C-header">
<h1>All User Groups <%= link_to 'New Group', new_group_path, :class => "button" %></h1>
</header>
<div class="C-cont">
<article>

<table>
<tr>
<th>Name</th>
<th>Actions</th>
</tr>

<% @groups.each do |group| %>
<tr>
<td><%= group.name %><%= " (Private)" if cannot? :read, group %></td>
<td>
<%= link_to 'Show', group if can? :read, group %>
<%= link_to 'Edit', edit_group_path(group) if can? :update, group %>
<%= link_to 'Destroy', group, :confirm => 'Are you sure?', :method => :delete if can? :destroy, group %>
<%= link_to "Join", group_memberships_path(:group_id => group.id, :membership => {:user_id => current_user.id}), :method => :post if user_signed_in? & !group.made_request?(current_user) %></td>
</tr>
<% end %>
</table>
</article>
<div class="clear"></div>
<div class="row-fluid">
<div class="span9">
<section class="C">
<header class="C-header">
<h1>All Groups <%= link_to 'New Group', new_group_path, :class => "button" %></h1>
</header>
<div class="C-cont">
<ul class="SL">
<% @groups.each do |group| %>
<li>
<h3>
<%= link_to group, :class => "link-hl" do %>
<%= group.name %>
<% end %>
<% if can? :update, group %>
<small><%= link_to "[#{t(:edit)}]", edit_group_path(group) %></small>
<% end %>
</h3>
<%= link_to "Join", group_memberships_path(:group_id => group.id, :membership => {:user_id => current_user.id}), :method => :post if user_signed_in? & !group.made_request?(current_user) %></td>
<p class="indented">Members:
List...
</p>
</li>
<% end %>
</ul>
<div class="clear"></div>
</div>
</section>
</div>
</section>
<div class="span3">
<section class="C">
<header class="C-header">
<h1><%= t(:users) %></h1>
</header>
<div class="C-cont">
&nbsp;
<div class="clear"></div>
</div>
</section>
</div>
</div>
31 changes: 23 additions & 8 deletions app/views/screens/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
<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>
</header>
<div id="screens-body" class="C-cont">
<%= render :partial => "screens/index_body" %>
<div class="clear"></div>
<div class="row-fluid">
<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>
</header>
<div id="screens-body" class="C-cont">
<%= render :partial => "screens/index_body" %>
<div class="clear"></div>
</div>
</section>
</div>
</section>
<div class="span3">
<section class="C">
<header class="C-header">
<h1>Templates</h1>
</header>
<div class="C-cont">
<%= render :partial => "templates/index_body" %>
<div class="clear"></div>
</div>
</section>
</div>
</div>
5 changes: 4 additions & 1 deletion config/locales/views/elements/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ en:
manage: "Manage"
templates: "Templates"
screens: "Screens"
network: "Network"
feeds: "Feeds"
groups: "Groups"
accounts: "Accounts"
users: "Users"
users_and_groups: "User Groups"
moderate: "Moderate"
admin: "Admin"
dashboard: "Dashboard"

0 comments on commit 2afe18b

Please sign in to comment.