Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection Show Page #578

Merged
merged 1 commit into from
Jul 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions app/assets/stylesheets/collections.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.collection_description {
color: #333;
font-family: 'Lato', Verdana, Arail, Helvetica, sans-serif;
font-size: 1.15em;
font-weight: 300;
line-height: 1.25em;
letter-spacing: .10em;
}

.metadata-collections dt {
float: left;
margin-right: 1em;
}

.collection-icon {
font-size: 20vw;
color: #fab801;
padding: 15px 0 0 10px;
}

.actions-controls-collections {
display: block;
margin: 1em 0 0 1em;
}

.actions-controls-collections a:link,
.actions-controls-collections a:visited,
.actions-controls-collections a:hover {
color: #FFF;
text-align: center;
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/sufia.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@import 'header';
@import 'styles';
@import 'file-listing';
@import 'collections';

#browse-everything {
top:10%;
Expand Down
2 changes: 1 addition & 1 deletion app/views/collections/_media_display.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="<%= collections.collection_path %>" target="_new"><img src="/assets/folder.png" alt="No preview available" width="100%" /></a>
<a href="<%= collections.collection_path %>" target="_new"><span class="glyphicon glyphicon-th collection-icon"></span></a>
10 changes: 5 additions & 5 deletions app/views/collections/_show_actions.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2 class="non lower">Actions</h2>
<p>
<h2 class="sr-only">Actions</h2>
<div class="actions-controls-collections">
<% if can? :edit, @collection %>
<%= link_to "Edit", collections.edit_collection_path %> &nbsp;&nbsp;
<%= link_to "Add files from your dashboard", sufia.dashboard_files_path %>
<span class="label label-default"><%= link_to "Edit", collections.edit_collection_path %></span> &nbsp;&nbsp;
<span class="label label-default"><%= link_to "Add files", sufia.dashboard_files_path %></span>
<%end %>
</p>
</div>
30 changes: 11 additions & 19 deletions app/views/collections/_show_descriptions.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
<h2 class="non lower">Descriptions</h2>
<table class="table table-striped"><!-- class="verticalheadings"> -->
<tbody>
<tr>
<th><%= get_label("total_items") %></th>
<td><%= @collection.members.count %></td>
</tr>
<tr>
<th><%= get_label("size") %></th>
<td><%= number_to_human_size(@collection.bytes) %></td>
</tr>
<% (@collection.terms_for_display).each do |term| %>
<h2 class="sr-only">Descriptions</h2>
<dl class="metadata-collections">
<dt><%= get_label("total_items") %></dt>
<dd><%= @collection.members.count %></dd>
<dt><%= get_label("size") %></dt>
<dd><%= number_to_human_size(@collection.bytes) %></dd>
<% (@collection.terms_for_display).each do |term| %>
<% if @collection.send(term).present? %>
<tr>
<th><%= get_label(term) %></th>
<td><%= render_show_field_partial_with_action("records", term, {record: @collection}) %> </td>
</tr>
<dt><%= get_label(term) %></dt>
<dd><%= render_show_field_partial_with_action("records", term, {record: @collection}) %></dd>
<% end %>
<% end %>
</tbody>
</table> <!-- /verticalheadings -->
<% end %>
</dl>
28 changes: 14 additions & 14 deletions app/views/collections/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
<%= render partial: 'generic_files/breadcrumbs', locals: {
include_file: false, generic_file: GenericFile.new(title: @collection.title) } %>

<h1 class="lower"><%= @collection.title %></h1>

<h3><%=@collection.description%> </h3>

<% unless has_collection_search_parameters? %>
<div itemscope itemtype="http://schema.org/CollectionPage" class="row">
<div class="col-sm-4">
<%= render partial: 'collections/media_display', locals: { generic_file: @collection } %>
<div class="col-sm-9 pull-right">
<header>
<h1><%= @collection.title %></h1>
<p class="collection_description"><%=@collection.description%></p>
</header>
<% unless has_collection_search_parameters? %>
<%= render partial: 'collections/show_descriptions', locals: { generic_file: @collection } %>
<% end %>
</div>
<div class="col-sm-8"><!-- class="column second"> -->
<div class="col-sm-3">
<%= render partial: 'collections/media_display', locals: { generic_file: @collection } %>
<% unless has_collection_search_parameters? %>
<%= render partial: 'collections/show_actions' %>
<%= render partial: 'collections/show_descriptions', locals: { generic_file: @collection } %>
</div><!-- /columns second -->
</div> <!-- /columns two-b -->
<% end %>
<% end %>
</div>
</div>

<%= render 'sort_and_per_page' %>

Expand All @@ -35,5 +37,3 @@

<%= render_document_index @member_docs %>
<%= render partial: 'paginate' %>