Skip to content

Commit

Permalink
Cleaned up the Table View a lot
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian R Zaik committed Apr 24, 2010
1 parent 6ee6082 commit 10b4e25
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 91 deletions.
111 changes: 60 additions & 51 deletions app/views/categories/show.html.erb
Expand Up @@ -2,62 +2,71 @@
<% content_for :meta_tags, meta_tags(@category.name, @category.description, "icons/icon_folder.png", auto_discovery_link_tag(:rss, {:format => :rss})) %>
<% content_for :background_img, background_img(@category) %>
<% my_ancestors = @category.ancestors %>

<h2 class="breadcrumb">
<%= link_to "Home", :controller => "categories" %>&nbsp;/&nbsp;<% my_ancestors.reverse.each do |ancestor_category| %><%= link_to ancestor_category.name, ancestor_category %>&nbsp;/&nbsp;<% end %>
<%= link_to "Home", :controller => "categories" %>&nbsp;/&nbsp;<% my_ancestors.reverse.each do |ancestor_category| %><%= link_to ancestor_category.name, ancestor_category %>&nbsp;/&nbsp;<% end %>
</h2>

<h1 class="main-title">
<div class="info_box">
<p>
<% if !@category.private %>
<%= image_tag("icons/eye_icon.png", :alt => "Public", :title => "This category is visible to everyone") %>
<% else %>
<%= image_tag("icons/noeye_icon.png", :alt => "Private", :title => "This category is invisible to others") %>
<% end %>
<% if @category.writable %>
<%= image_tag("icons/write_icon.png", :alt => "Editable", :title => "Anyone can edit this category or add docs") %>
<% else %>
<%= image_tag("icons/nowrite_icon.png", :alt => "Not Editable", :title => "Nobody else can edit this category or add docs") %>
<% end %>
</p>
</div>
<%=h @category.name %>
<span>
<%=h @category.description %>
<br />
<% if admin_logged_in? || (logged_in? && @category.allowed_to_save) %>
<%= link_to 'Edit', edit_category_path(@category), :class => 'edit-link' %>
&nbsp;
<%= link_to 'Remove', category_path(@category), :confirm => 'Are you sure you want to remove this category?', :method => :delete, :class => 'cancel-link' %>
<% end %>
</span>
<div class="info_box">
<p>
<% if !@category.private %>
<%= image_tag("icons/eye_icon.png", :alt => "Public", :title => "This category is visible to everyone") %>
<% else %>
<%= image_tag("icons/noeye_icon.png", :alt => "Private", :title => "This category is invisible to others") %>
<% end %>
<% if @category.writable %>
<%= image_tag("icons/write_icon.png", :alt => "Editable", :title => "Anyone can edit this category or add docs") %>
<% else %>
<%= image_tag("icons/nowrite_icon.png", :alt => "Not Editable", :title => "Nobody else can edit this category or add docs") %>
<% end %>
</p>
</div>

<%=h @category.name %>

<span>
<%=h @category.description %>
<br />
<% if admin_logged_in? || (logged_in? && @category.allowed_to_save) %>
<%= link_to 'Edit', edit_category_path(@category), :class => 'edit-link' %>
&nbsp;
<%= link_to 'Remove', category_path(@category), :confirm => 'Are you sure you want to remove this category?', :method => :delete, :class => 'cancel-link' %>
<% end %>
</span>
</h1>

<div class="hr_dl flush"><%= image_tag("bl.png", :alt => "") %></div>

<br />

<div class="mc-indent">
<% if !@category.children.empty? || (logged_in? && @category.allowed_to_save) %>
<h2>Sub-Categories <%= link_to 'Add', new_category_path(:parent_id => @category.id), :class => "link-button" if (logged_in? && @category.allowed_to_save) %></h2>
<ul class="iconlist">
<% @category.children.each do |child| %>
<% if child.allowed_to_read %>
<li>
<% link_to child do %>
<div class="iconlist_padding">
<div class="ins">
<div class="type-folder"><%= image_tag("icons/icon_folder.png", :alt => "Icon_folder") %></div>
</div>
<h2><%=h child.name %></h2>
</div>
<% end %>
</li>
<% end %>
<% end %>
</ul>
<div style="clear:both;"></div>
<% end %>
<br />
<h2>Documents<%= link_to 'Add', new_document_path(:category_id => @category.id), :class => "link-button" if (logged_in? && @category.allowed_to_save) %></h2>
<div id="doc_holder">
<%= render :partial => 'documents/' + @doc_display, :locals => {:documents => @docs} %>
</div>
<br />
<% if !@category.children.empty? || (logged_in? && @category.allowed_to_save) %>
<h2>Sub-Categories <%= link_to 'Add', new_category_path(:parent_id => @category.id), :class => "link-button" if (logged_in? && @category.allowed_to_save) %></h2>
<ul class="iconlist">
<% @category.children.each do |child| %>
<% if child.allowed_to_read %>
<li>
<% link_to child do %>
<div class="iconlist_padding">
<div class="ins">
<div class="type-folder"><%= image_tag("icons/icon_folder.png", :alt => "Icon_folder") %></div>
</div>
<h2><%=h child.name %></h2>
</div>
<% end %>
</li>
<% end %>
<% end %>
</ul>
<div style="clear:both;"></div>
<% end %>

<br />

<h2 id="doclist">Documents<%= link_to 'Add', new_document_path(:category_id => @category.id), :class => "link-button" if (logged_in? && @category.allowed_to_save) %></h2>
<div id="doc_holder">
<%= render :partial => 'documents/' + @doc_display, :locals => {:documents => @docs} %>
</div>
<br />
</div>
2 changes: 1 addition & 1 deletion app/views/documents/_grid.html.erb
@@ -1,4 +1,4 @@
<%= link_to 'View Table', category_path(:type => 'table'), :class => "link-button update_holder" %>
<%= link_to 'View Table', category_path(:type => 'table', :anchor => "doclist"), :class => "link-button update_holder" %>
<br /><br />
<ul class="iconlist">
<% documents.each do |document| %>
Expand Down
26 changes: 11 additions & 15 deletions app/views/documents/_table.html.erb
@@ -1,34 +1,30 @@
<%= link_to 'View Grid', category_path(:type => 'grid'), :class => "link-button update_holder" %>
<%= link_to 'View Grid', category_path(:type => 'grid', :anchor => "doclist"), :class => "link-button update_holder" %>
<br /><br />
<% if !documents.empty? %>
<table cellpadding="0" cellspacing="0" width="100%" class="docs">
<thead>
<tr class="cat_title">
<th></th>
<th>Title</th>
<th>Description</th>
<th>Number of Downloads</th>
<th>Uploaded by</th>
<th>Created on</th>
<th>Last Updated</th>
<th></th>
</tr>
<tr class="cat_title">
<th style="text-align:right;">Title</th>
<th>Link</th>
<th style="text-align:left;">Description</th>
<th>Downloads</th>
<th>Updated</th>
<th></th>
</tr>
</thead>
<tbody>
<% documents.each do |document| %>
<tr class="<%= cycle('odd', 'even') %>">
<td><% link_to document do %><h2><%=h document.title %></h2><% end %></td>
<td class="doc_img">
<% unless document.current_revision.blank? %>
<% link_to download_document_revision_path(document, 'current') do %>
<%= image_tag("icons/icon_#{document.current_revision.type}_40.png", {:alt => "Download File", :width => "40px", :height => "40px"}) %>
<% end %>
<% end %>
</td>
<td><% link_to document do %><h2><%=h document.title %></h2><% end %></td>
<td><%=h document.description %></td>
<td><p><%=h document.description %></p></td>
<td><%=h document.downloaded %></td>
<td><%=h document.user.full_name unless document.user.nil? %></td>
<td><%=h document.created_at.strftime('%D') %></td>
<td><%=h document.updated_at.strftime('%D') %></td>
<td>
<% if admin_logged_in? || (logged_in? && document.allowed_to_save) %>
Expand Down
2 changes: 2 additions & 0 deletions app/views/documents/show.html.erb
@@ -1,11 +1,13 @@
<% content_for :title, @document.title %>
<% content_for :meta_tags, meta_tags(@document.title, @document.description, "icons/icon_#{@document.current_revision.type}.png") %>
<% my_ancestors = @document.category.ancestors unless @document.category.nil? %>

<h2 class="breadcrumb">
<% if !@document.category.nil? %>
<%= link_to "Home", :controller => "categories" %>&nbsp;/&nbsp;<% my_ancestors.reverse.each do |ancestor_category| %><%= link_to ancestor_category.name, ancestor_category %>&nbsp;/&nbsp;<% end %><%= link_to @document.category.name, @document.category %>
<% end %>
</h2>

<h1 class="main-title">
<div class="info_box">
<p>
Expand Down
56 changes: 32 additions & 24 deletions public/stylesheets/base.css
@@ -1,16 +1,15 @@
/* Flagship Docs (v2) - CSS */
/* Designed by Brian R Zaik (http://brzaik.com) in 2009-2010. */
/* Web Technologies Group of RPI, 2009-2010 */
/* Designed and Built by the Web Technologies Group of RPI from 2009 to 2010. */



/*##############################################################################################################################*/
/* GLOBAL CSS */
/*##############################################################################################################################*/
/*##########################################################################*/
/* GLOBAL CSS */
/*##########################################################################*/


/*##########################################################################*/
/* General Styles */
/* General Styles */
/*##########################################################################*/

/*########## GLOBAL RESET AND MASTER TAGS ##########*/
Expand Down Expand Up @@ -59,7 +58,7 @@ div.hr_dl2 { background:url(../images/layout/hr_dl2.png) top left repeat-x; heig


/*##########################################################################*/
/* Master Layout */
/* Master Layout */
/*##########################################################################*/

/*########## MESSAGE FLASH ##########*/
Expand Down Expand Up @@ -137,13 +136,12 @@ a#search_ex:active { background:url(../images/icons/search_ex_hover.png) center



/*##############################################################################################################################*/
/* AREA-SPECIFIC CSS */
/*##############################################################################################################################*/

/*##########################################################################*/
/* AREA-SPECIFIC CSS */
/*##########################################################################*/

/*##########################################################################*/
/* Categories/Show */
/* Categories/Show */
/*##########################################################################*/

/*########## GRAPHICAL ICON LISTS ##########*/
Expand All @@ -168,7 +166,7 @@ div.img_icon { background:url(../images/icons/imageicon.png) center center no-re


/*##########################################################################*/
/* Non-JS Search Results */
/* Non-JS Search Results */
/*##########################################################################*/

/*########## HEADERS ##########*/
Expand All @@ -191,7 +189,7 @@ div#doc_listing_inpage li a:hover h3 { color:#FFF; text-decoration: none !import


/*##########################################################################*/
/* Documents/Show Pages */
/* Documents/Show Pages */
/*##########################################################################*/

/*########## DOWNLOAD BLOCK ##########*/
Expand Down Expand Up @@ -223,7 +221,7 @@ div.info_box p img { vertical-align: middle; }


/*##########################################################################*/
/* Admin Forms */
/* Admin Forms */
/*##########################################################################*/

/*########## FORM ELEMENTS ##########*/
Expand Down Expand Up @@ -256,19 +254,29 @@ div.form_group legend { margin:8px; font-size:1.4em; background:#FFF; font-weigh
div.form_group label { padding:2px 0px; vertical-align:top; font-weight:bold; padding-right:6px; background:none; color:#333; font-size:0.8em; width:210px; }
div.form_group textarea { width:70%; background:#FFEFEF; border:solid 1px #999; }

### DOCUMENTS LIST VIEW ###
table.docs {-moz-border-radius: 12px 12px 0 0; border:1px solid #CCCCCC;}
table.docs td { font-size:1.06em; height:35px; vertical-align:top; padding:3px 9px; margin:0; }

/*##########################################################################*/
/* Categories/Show Pages */
/*##########################################################################*/

/*########## DOCUMENTS LIST VIEW ##########*/
table.docs {-moz-border-radius: 12px 12px 0 0; font-size:0.9em; /* border:1px solid #CCCCCC; */}
table.docs td { font-size:1.06em; height:35px; text-align:center; vertical-align:center; padding:3px 9px; margin:0; }
table.docs tr.odd td { background:#e5e5e5 url(../images/layout/docs_odd_bg.png) top left repeat-x; }
table.docs tr.even td { background:#ffffff url(../images/layout/docs_even_bg.png) top left repeat-x; }
table.docs thead tr.cat_title th { background: #605B5B; color: #ffffff; padding: 1px 10px; height: auto; letter-spacing:0.15em; font-size:0.8em; text-transform:uppercase; }
table.docs thead th { background: #605B5B; color: #ffffff; padding:6px 10px; height: auto; letter-spacing:0.25em; font-size:0.65em; text-transform:uppercase; }
table.docs td.doc_img { width:42px; text-align: center; }
table.docs a {width:180px; height:210px; font-size:small; text-align:center;}
table.docs p { text-align:left; margin:0px; }
table.docs a {width:180px; height:210px; font-size:small; text-align:right;}
table.docs a:hover h2 {text-decoration:underline;}
table.docs a h2 { color:#333 !important; background:none !important; padding:0px !important; margin:0px; font-weight:bold !important; text-align:center; }
table.docs a h2 { color:#333 !important; background:none !important; padding:0px !important; margin:0px; font-weight:bold !important; }
table.docs a.edit-link { color:#F59300 !important; font-weight:bold;}
table.docs a.cancel-link {color:#DC0000 !important; font-weight:bold;}
table.docs thead tr:first-child th:first-child { -moz-border-radius-topleft:10px; -webkit-border-top-left-radius:10px; border-top-left-radius:10px}
table.docs thead tr:first-child th:last-child { -moz-border-radius-topright:10px; -webkit-border-top-right-radius:10px; border-top-right-radius:10px}
table.docs tr:last-child td:first-child { -moz-border-radius-bottomleft:10px; -webkit-border-bottom-left-radius:10px; border-bottom-left-radius:10px}
table.docs tr:last-child td:last-child { -moz-border-radius-bottomright:10px; -webkit-border-bottom-right-radius:10px; border-bottom-right-radius:10px}
table.docs thead tr:first-child th:last-child { -moz-border-radius-topright:10px; -webkit-border-top-right-radius:10px; border-top-right-radius:10px; }
table.docs tr td { border-top:solid 1px #999; }
table.docs tr td:first-child { border-left:solid 1px #999; }
table.docs tr td:last-child { border-right:solid 1px #999; }
table.docs tr:last-child td { border-bottom:solid 1px #999; }
table.docs tr:last-child td:first-child { -moz-border-radius-bottomleft:10px; -webkit-border-bottom-left-radius:10px; border-bottom-left-radius:10px; border:solid 1px #999; border-width: 1px 0px 1px 1px; }
table.docs tr:last-child td:last-child { -moz-border-radius-bottomright:10px; -webkit-border-bottom-right-radius:10px; border-bottom-right-radius:10px; border:solid 1px #999; border-width: 1px 1px 1px 0px; }

0 comments on commit 10b4e25

Please sign in to comment.