myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3348] trunk: More tweaks for branded search resu


From: noreply
Subject: [myexperiment-hackers] [3348] trunk: More tweaks for branded search results
Date: Fri, 25 Jan 2013 09:44:57 +0000 (UTC)

Revision
3348
Author
fbacall
Date
2013-01-25 09:44:56 +0000 (Fri, 25 Jan 2013)

Log Message

More tweaks for branded search results

Modified Paths

Diff

Modified: trunk/app/views/blobs/_table.rhtml (3347 => 3348)


--- trunk/app/views/blobs/_table.rhtml	2013-01-24 15:17:07 UTC (rev 3347)
+++ trunk/app/views/blobs/_table.rhtml	2013-01-25 09:44:56 UTC (rev 3348)
@@ -1,107 +1,112 @@
 <% query ||= false -%>
-<% odd_row = false -%>
-<% unless collection.empty? %>
 
-<table class="alt_table">
-	<% for blob in collection %>
-		<% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
-		<% if collection.size == 1 -%>
-			<% show ||= Authorization.check('view', blob, current_user) -%>
-		<% else -%>
-			<% show = Authorization.check('view', blob, current_user) -%>
-		<% end -%>
-	  <% if show -%>
-			<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
-				<% cache(:controller => 'files_cache', :action ="" 'listing', :id => blob.id) do -%>
-					<td style="width: 100px;">
-						<p style="margin-top:0; padding-top:0; text-align: center;"><b>Uploader:</b></p>
-						<center><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, true, 60) %></center>
-					</td>
-					<td style="text-align: left; max-width: 370px">
-						<a name="<%= blob.local_name.gsub(/ /, "_") %>"></a>
-						<p class="title">
-							<%= icon "blob", nil, nil, nil, '' %>
-							<% title = contributable_name(blob.id, 'Blob') %>
-							<%=link_to(query ? highlight_all(title, query) : title, blob_path(blob)) %>
-						</p>
-						
-						<p style="font-size: 85%; margin-top: 0; padding-top: 0;">
-							<b>Created:</b> <%=datetime blob.contribution.created_at, false %>
-							<% unless blob.contribution.created_at == blob.contribution.updated_at %>
-								|	<b>Last updated:</b> <%=datetime blob.contribution.updated_at, false %>
-							<% end %>
-						</p>
-						
-						<% unless (creditors = blob.creditors).empty? %>
-							<p style="font-size:85%;">
-							<b>Credits:</b>
-							<% creditors.each do |c| %>
-								<% if c.creditor_type == 'User' %>
-									<%= icon('user', nil, nil, nil, '') %> 
-								<% elsif c.creditor_type == 'Network' %>
-									<%= icon('network-member', nil, nil, nil, '') %>
-								<% end %>
-								<%= contributor(c.creditor_id, c.creditor_type) %>
-							<% end %>
-							</p>
-						<% end %>
-						<% unless (attributors = blob.attributors).empty? %>
-							<p style="font-size:85%;">
-							<b>Attributions:</b>
-							<% attributors.each do |a| %>
-								<% if Authorization.check("view", a.attributor, current_user) -%>
-									<% if a.attributor_type == 'Workflow' %>
-										<%= icon('workflow', nil, nil, nil, '') %> 
-									<% elsif a.attributor_type == 'Blob' %>
-										<%= icon('blob', nil, nil, nil, '') %>
-									<% end %>
-									<%= contributable(a.attributor_id, a.attributor_type) %>
-								<% end -%>
-							<% end %>
-							</p>
-						<% end %>
-						
-            <% if blob.license_id.nil? %>
-              <p style="font-size:85%;"><b>License: </b>No license</p>
-            <% else %>
-              <p style="font-size:85%;"><b>License: </b><% @license = License.find(blob.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
+<% collection.each do |blob| %>
+  <% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
+  <% if collection.size == 1 -%>
+    <% show ||= Authorization.check('view', blob, current_user) -%>
+  <% else -%>
+    <% show = Authorization.check('view', blob, current_user) -%>
+  <% end -%>
+  <% if show -%>
+
+    <div class="resource_list_item <%= blob.contribution.policy.layout -%>">
+
+      <div class="avatar_panel">
+        <span class="owner"><%= owner_text blob -%></span>
+        <%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, true, 60) %>
+        <% if layout = blob.contribution.policy.layout %>
+          <% begin %>
+            <%= render :partial => "skins/branding/#{layout}" %>
+          <% rescue ActionView::MissingTemplate %>
+          <% end %>
+        <% end %>
+      </div>
+
+      <div class="main_panel">
+
+        <div class="actions">
+          <%= icon "show", blob_path(blob), nil, nil, "View" %>
+          <% if Authorization.check("download", blob, current_user) %><%= icon "download", download_blob_path(blob) %><% end %>
+          <% if mine?(blob) %><%= icon "manage", edit_blob_path(blob), nil, nil, "Manage" %><% end %>
+        </div>
+
+        <% cache(:controller => 'files_cache', :action ="" 'listing', :id => blob.id) do -%>
+          <a name="<%= blob.local_name.gsub(/ /, "_") %>"></a>
+          <p class="title">
+            <%= icon "blob", nil, nil, nil, '' %>
+            <% truncated_title = truncate(blob.title, :length => 55) %>
+            <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, blob_path(blob),
+                       :title => blob.title) %>
+          </p>
+
+          <p>
+            <b>Created:</b> <%=datetime blob.contribution.created_at, false %>
+            <% unless blob.contribution.created_at == blob.contribution.updated_at %>
+              |	<b>Last updated:</b> <%=datetime blob.contribution.updated_at, false %>
             <% end %>
-						
-						<div class="desc" style="font-size: 85%;">
-							<% if blob.body and blob.body.length > 0 %>
-					  		<% desc = truncate(strip_html(blob.body), :length => 500) %>
-					    	<%= query ? highlight_all(desc, query) : desc %>
-						  <% else -%>
-								<span class="none_text">No description</span>	
-							<% end %>
-						</div>
-						
-						<p style="font-size:85%;"><b>File type: </b><%= h blob.content_type.title %></p>
-						
-						<p style="font-size: 85%;">
-							<a href="" blob_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
-							<a href="" blob_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
-							<b>Viewed:</b> <%=pluralize blob.contribution.site_viewings_count, "time" %> |
-				      <b>Downloaded:</b> <%=pluralize blob.contribution.site_downloads_count, "time" %>
-						</p>
-						
-						<% unless (tags = blob.tags).empty? %>
-							<a href="" blob_path(blob) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
-							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-						<% else %>
-							<p style="font-size: 85%;"><i>This File has no tags!</i></p>
-						<% end %>	
-					</td>
-				<% end %>
-					
-					<td class="actions" style="width: 80px;">
-				    <%= icon "show", blob_path(blob), nil, nil, "View" %>
-					  <% if Authorization.check("download", blob, current_user) %><%= icon "download", download_blob_path(blob) %><% end %>
-				    <% if mine?(blob) %><%= icon "manage", edit_blob_path(blob), nil, nil, "Manage" %><% end %>
-				  </td>
-			</tr>
-		<% end %>
-	<% end %>
-</table>
+          </p>
 
+          <% unless (creditors = blob.creditors).empty? %>
+            <p>
+              <b>Credits:</b>
+              <% creditors.each do |c| %>
+                <% if c.creditor_type == 'User' %>
+                  <%= icon('user', nil, nil, nil, '') %>
+                <% elsif c.creditor_type == 'Network' %>
+                  <%= icon('network-member', nil, nil, nil, '') %>
+                <% end %>
+                <%= contributor(c.creditor_id, c.creditor_type) %>
+              <% end %>
+            </p>
+          <% end %>
+          <% unless (attributors = blob.attributors).empty? %>
+            <p>
+              <b>Attributions:</b>
+              <% attributors.each do |a| %>
+                <% if Authorization.check("view", a.attributor, current_user) -%>
+                  <% if a.attributor_type == 'Workflow' %>
+                    <%= icon('workflow', nil, nil, nil, '') %>
+                  <% elsif a.attributor_type == 'Blob' %>
+                    <%= icon('blob', nil, nil, nil, '') %>
+                  <% end %>
+                  <%= contributable(a.attributor_id, a.attributor_type) %>
+                <% end -%>
+              <% end %>
+            </p>
+          <% end %>
+
+          <% if blob.license_id.nil? %>
+            <p><b>License: </b>No license</p>
+          <% else %>
+            <p><b>License: </b><% @license = License.find(blob.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
+          <% end %>
+
+          <div class="desc">
+            <% if blob.body and blob.body.length > 0 %>
+              <% desc = truncate(strip_html(blob.body), :length => 500) %>
+              <%= query ? highlight_all(desc, query) : desc %>
+            <% else -%>
+              <span class="none_text">No description</span>
+            <% end %>
+          </div>
+
+          <p><b>File type: </b><%= h blob.content_type.title %></p>
+
+          <p>
+            <a href="" blob_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
+            <a href="" blob_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
+            <b>Viewed:</b> <%=pluralize blob.contribution.site_viewings_count, "time" %> |
+            <b>Downloaded:</b> <%=pluralize blob.contribution.site_downloads_count, "time" %>
+          </p>
+
+          <% unless (tags = blob.tags).empty? %>
+            <a href="" blob_path(blob) + '#tags' -%>"><p><b>Tags:</b></p></a>
+            <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+          <% else %>
+            <p><i>This File has no tags!</i></p>
+          <% end %>
+        <% end %>
+      </div>
+    </div>
+  <% end %>
 <% end %>

Modified: trunk/app/views/networks/_table.rhtml (3347 => 3348)


--- trunk/app/views/networks/_table.rhtml	2013-01-24 15:17:07 UTC (rev 3347)
+++ trunk/app/views/networks/_table.rhtml	2013-01-25 09:44:56 UTC (rev 3348)
@@ -1,89 +1,91 @@
 <% query ||= false -%>
-<% odd_row = false -%>
-<% unless collection.empty? -%>
-	<table class="alt_table">
-		<% for network in collection -%>
-			<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
-					<td style="width: 120px;">
-						<p style="margin-top:0; padding-top:0; text-align: center;"><b>Owner:</b></p>
-						<center><%= contributor(network.user_id, "User", true, 80) %></center>
-					</td>
-					<td style="text-align: left;">
-						<p class="title">
-							<% if (current_user != 0) && (network.user_id == current_user.id) %>
-								<%= icon "network-owned", nil, nil, nil, '' %>
-							<% else %>
-								<%= icon "network-member", nil, nil, nil, '' %>
-							<% end %>
-							<%=link_to(query ? highlight_all(h(network.title), query) : h(network.title), network_path(network)) %>
-						</p>
-				<% cache(:controller => 'groups_cache', :action ="" 'listing', :id => network.id) do -%>
-						<p style="font-size: 85%;">
-							<% if network.unique_name and network.unique_name.length > 0 %>
-								<b>Unique name: </b><%=h network.unique_name -%>
-							<% end %>
-							<b>Created: </b><%=datetime network.created_at, true -%>
-						</p>
-						
-						<div class="desc">
-							<div style="font-size: 85%;">
-							<% if network.description and network.description.length > 0 -%>
-								<% desc = truncate(strip_html(network.description), :length => 400) -%>
-								<%= query ? highlight_all(desc, query) : desc -%>
-							<% else -%>
-								<span class="none_text">No description</span>
-							<% end -%>
-							</div>
-						</div>
-						
-						<p class="standout" style="margin-top: 0.4em;">
-							<%= pluralize network.shared_contributions.length, "shared item" -%>
-							&nbsp;&nbsp;|&nbsp;&nbsp;
-							<% # both private & public announcements -%>
-							<%= pluralize network.announcements.length, "announcements" -%>
-						</p>
-						
-						<% unless network.members.empty? -%>
-							<div class="desc" style="margin-top: 0.4em;">
-								<p style="font-size: 85%;"><b>Members (<%= network.members.length %>):</b></p>
-								<div style="font-size: 77%;"><%= render :partial => "networks/members", :locals => { :collection => network.members(true), :size => 40, :limit => 6 } %></div>
-							</div>
-						<% end -%>
-						
-						<% unless (tags = network.tags).empty? -%>
-							<a href="" network_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
-							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-					  <% else -%>
-							<p style="font-size: 85%;"><i>This Group has not been tagged yet!</i></p>
-					  <% end -%>
-				<% end -%>
-						<% latest_announcement = network.announcements_for_user(current_user).first -%>
-						<% unless latest_announcement.nil? -%>
-						  <p style="font-size: 85%; margin-top: 0.7em;">
-							  <b>Latest announcement:</b>:
-								<%= link_to latest_announcement.title, group_announcement_path(network, latest_announcement) -%>
-							</p>
-						<% end -%>
-					</td>
-					<td class="actions">
-						<%= icon "show", network_path(network), nil, nil, "View" %>
-						<% if mine? network -%>
-							<%= icon "manage", edit_network_path(network) %>
-						<% elsif logged_in? %> <!-- admins can't leave the group or request membership! -->
-						  <% if network.member?(current_user.id) %>
-							  <!-- user is not an admin, but a member already -->
-								<% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", network.id, current_user.id] ) %>
-			          <% if cur_membership %>
-			            <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + networks_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
-			          <% end %>
-							<% elsif !current_user.membership_pending?(network.id) && !network.invitation_only? %>
-							  <!-- not an admin, not a member yet and hasn't got pending request -->
-								<%= request_membership_link(current_user.id, network.id) %>
-							<% end %>
-						<% end -%>
-					</td>
-			</tr>
-		<% end -%>
-	</table>
-	<br/>
-<% end -%>
+
+<% collection.each do |network| -%>
+
+  <div class="resource_list_item">
+
+    <div class="avatar_panel" style="width: 7em">
+      <span class="owner">Owner</span>
+      <%= contributor(network.user_id, "User", true, 80) %>
+    </div>
+
+    <div class="main_panel" style="margin-left: 7.5em">
+
+      <div class="actions">
+        <%= icon "show", network_path(network), nil, nil, "View" %>
+        <% if mine? network -%>
+          <%= icon "manage", edit_network_path(network) %>
+        <% elsif logged_in? %> <!-- admins can't leave the group or request membership! -->
+          <% if network.member?(current_user.id) %>
+            <!-- user is not an admin, but a member already -->
+            <% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", network.id, current_user.id] ) %>
+            <% if cur_membership %>
+              <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + networks_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
+            <% end %>
+          <% elsif !current_user.membership_pending?(network.id) && !network.invitation_only? %>
+            <!-- not an admin, not a member yet and hasn't got pending request -->
+            <%= request_membership_link(current_user.id, network.id) %>
+          <% end %>
+        <% end -%>
+      </div>
+
+      <p class="title">
+        <% if (current_user != 0) && (network.user_id == current_user.id) %>
+          <%= icon "network-owned", nil, nil, nil, '' %>
+        <% else %>
+          <%= icon "network-member", nil, nil, nil, '' %>
+        <% end %>
+        <% truncated_title = truncate(network.title, :length => 45) %>
+        <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, network_path(network),
+                   :title => network.title) %>
+      </p>
+
+      <% cache(:controller => 'groups_cache', :action ="" 'listing', :id => network.id) do -%>
+        <p>
+          <% if network.unique_name and network.unique_name.length > 0 %>
+            <b>Unique name: </b><%=h network.unique_name -%>
+          <% end %>
+          <br/>
+          <b>Created: </b><%=datetime network.created_at, true -%>
+        </p>
+
+        <div class="desc">
+          <% if network.description and network.description.length > 0 -%>
+            <% desc = truncate(strip_html(network.description), :length => 400) -%>
+            <%= query ? highlight_all(desc, query) : desc -%>
+          <% else -%>
+            <span class="none_text">No description</span>
+          <% end -%>
+        </div>
+
+        <p class="standout">
+          <%= pluralize network.shared_contributions.length, "shared item" -%>
+          &nbsp;&nbsp;|&nbsp;&nbsp;
+          <% # both private & public announcements -%>
+          <%= pluralize network.announcements.length, "announcements" -%>
+        </p>
+
+        <% unless network.members.empty? -%>
+          <div class="desc">
+            <p><b>Members (<%= network.members.length %>):</b></p>
+            <div style="font-size: 77%;"><%= render :partial => "networks/members", :locals => { :collection => network.members(true), :size => 40, :limit => 6 } %></div>
+          </div>
+        <% end -%>
+
+        <% unless (tags = network.tags).empty? -%>
+          <a href="" network_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
+          <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+        <% else -%>
+          <p><i>This Group has not been tagged yet!</i></p>
+        <% end -%>
+      <% end -%>
+      <% latest_announcement = network.announcements_for_user(current_user).first -%>
+      <% unless latest_announcement.nil? -%>
+        <p style="margin-top: 0.7em;">
+          <b>Latest announcement:</b>:
+          <%= link_to latest_announcement.title, group_announcement_path(network, latest_announcement) -%>
+        </p>
+      <% end -%>
+    </div>
+  </div>
+<% end %>

Modified: trunk/app/views/packs/_table.rhtml (3347 => 3348)


--- trunk/app/views/packs/_table.rhtml	2013-01-24 15:17:07 UTC (rev 3347)
+++ trunk/app/views/packs/_table.rhtml	2013-01-25 09:44:56 UTC (rev 3348)
@@ -1,74 +1,80 @@
 <% query ||= false -%>
-<% odd_row = false -%>
-<% unless collection.empty? %>
 
-<table class="alt_table">
-	<% for pack in collection %>
-		<% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
-		<% if collection.size == 1 -%>
-			<% show ||= Authorization.check("view", pack, current_user) -%>
-		<% else -%>
-			<% show = Authorization.check("view", pack, current_user) -%>
-		<% end -%>
-	  <% if show -%>
-			<% cache(:controller => 'packs_cache', :action ="" 'listing', :id => pack.id) do -%>
-				<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
-					<td style="width: 100px;">
-						<p style="margin-top:0; padding-top:0; text-align: center;"><b><%= owner_text pack -%>:</b></p>
-						<center><%= contributor(pack.contribution.contributor_id, pack.contribution.contributor_type, true, 60) %></center>
-					</td>
-					<td style="text-align: left; max-width: 370px">
-						<a name="<%= pack.title.gsub(/ /, "_") %>"></a>
-						<p class="title">
-							<%= icon "pack", nil, nil, nil, '' %>
-							<% title = contributable_name(pack.id, 'Pack') %>
-							<%=link_to(query ? highlight_all(title, query) : title, pack_path(pack)) %>
-						</p>
-						
-						<p style="font-size: 85%; margin-top: 0; padding-top: 0;">
-							<b>Created:</b> <%=datetime pack.contribution.created_at, false %>
-							<% unless pack.contribution.created_at == pack.contribution.updated_at %>
-								|	<b>Last updated:</b> <%=datetime pack.contribution.updated_at, false %>
-							<% end %>
-						</p>
-						
-						<div class="desc" style="font-size: 85%;">
-							<% unless pack.description.blank? %>
-					  		<% desc = truncate(strip_html(pack.description), :length => 500) %>
-					    	<%= query ? highlight_all(desc, query) : desc %>
-						  <% else -%>
-								<span class="none_text">No description</span>
-							<% end %>
-						</div>
-						
-						<p class="standout" style="margin-top: 0.4em;">
-							<%= pluralize pack.items_count, "item" -%> in this pack
-						</p>
-						
-						<p style="font-size: 85%;">
-							<a href="" pack_path(pack) + '#comments' -%>"><b>Comments: </b><%= pack.comments.count %></a> |
-							<b>Viewed:</b> <%=pluralize pack.contribution.site_viewings_count, "time" %> |
-				      <b>Downloaded:</b> <%=pluralize pack.contribution.site_downloads_count, "time" %>
-						</p>
-						
-						<% unless (tags = pack.tags).empty? %>
-							<a href="" pack_path(pack) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
-							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-						<% else %>
-							<p style="font-size: 85%;"><i>This Pack has no tags!</i></p>
-						<% end %>	
-					</td>
-					
-					<td class="actions" style="width: 80px;">
-				    <%= icon "show", pack_path(pack), nil, nil, "View" %>
-						<% if Authorization.check("download", pack, current_user) -%><%= icon('download', download_pack_path(pack), nil, nil, 'Download') -%><% end -%>
-				    <% if mine?(pack) %><%= icon "manage", edit_pack_path(pack), nil, nil, "Manage" %><% end %>
-						<% if Authorization.check("edit", pack, current_user) -%><%= icon('new', new_item_pack_path(pack), nil, nil, 'Add New Item') -%><% end -%>
-				  </td>
-				</tr>
-			<% end %>
-		<% end %>
-	<% end %>
-</table>
+<% collection.each do |pack| %>
+  <% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
+  <% if collection.size == 1 -%>
+    <% show ||= Authorization.check("view", pack, current_user) -%>
+  <% else -%>
+    <% show = Authorization.check("view", pack, current_user) -%>
+  <% end -%>
+  <% if show -%>
 
+    <div class="resource_list_item <%= pack.contribution.policy.layout -%>">
+
+      <div class="avatar_panel">
+        <span class="owner"><%= owner_text pack -%></span>
+        <%= contributor(pack.contribution.contributor_id, pack.contribution.contributor_type, true, 60) %>
+        <% if layout = pack.contribution.policy.layout %>
+          <% begin %>
+            <%= render :partial => "skins/branding/#{layout}" %>
+          <% rescue ActionView::MissingTemplate %>
+          <% end %>
+        <% end %>
+      </div>
+
+      <div class="main_panel">
+
+        <div class="actions">
+          <%= icon "show", pack_path(pack), nil, nil, "View" %>
+          <% if Authorization.check("download", pack, current_user) -%><%= icon('download', download_pack_path(pack), nil, nil, 'Download') -%><% end -%>
+          <% if mine?(pack) %><%= icon "manage", edit_pack_path(pack), nil, nil, "Manage" %><% end %>
+          <% if Authorization.check("edit", pack, current_user) -%><%= icon('new', new_item_pack_path(pack), nil, nil, 'Add New Item') -%><% end -%>
+        </div>
+
+        <% cache(:controller => 'packs_cache', :action ="" 'listing', :id => pack.id) do -%>
+          <a name="<%= pack.title.gsub(/ /, "_") %>"></a>
+          <p class="title">
+            <%= icon "pack", nil, nil, nil, '' %>
+            <% truncated_title = truncate(pack.title, :length => 55) %>
+            <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, pack_path(pack),
+                       :title => pack.title) %>
+          </p>
+
+          <br/>
+          <p>
+            <b>Created:</b> <%=datetime pack.contribution.created_at, false %>
+            <% unless pack.contribution.created_at == pack.contribution.updated_at %>
+              |	<b>Last updated:</b> <%=datetime pack.contribution.updated_at, false %>
+            <% end %>
+          </p>
+
+          <div class="desc">
+            <% unless pack.description.blank? %>
+              <% desc = truncate(strip_html(pack.description), :length => 500) %>
+              <%= query ? highlight_all(desc, query) : desc %>
+            <% else -%>
+              <span class="none_text">No description</span>
+            <% end %>
+          </div>
+
+          <p class="standout">
+            <%= pluralize pack.items_count, "item" -%> in this pack
+          </p>
+
+          <p>
+            <a href="" pack_path(pack) + '#comments' -%>"><b>Comments: </b><%= pack.comments.count %></a> |
+            <b>Viewed:</b> <%=pluralize pack.contribution.site_viewings_count, "time" %> |
+            <b>Downloaded:</b> <%=pluralize pack.contribution.site_downloads_count, "time" %>
+          </p>
+
+          <% unless (tags = pack.tags).empty? %>
+            <a href="" pack_path(pack) + '#tags' -%>"><p><b>Tags:</b></p></a>
+            <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+          <% else %>
+            <p><i>This Pack has no tags!</i></p>
+          <% end %>
+        <% end %>
+      </div>
+    </div>
+  <% end %>
 <% end %>

Modified: trunk/app/views/workflows/_table.rhtml (3347 => 3348)


--- trunk/app/views/workflows/_table.rhtml	2013-01-24 15:17:07 UTC (rev 3347)
+++ trunk/app/views/workflows/_table.rhtml	2013-01-25 09:44:56 UTC (rev 3348)
@@ -1,137 +1,135 @@
 <% query ||= false -%>
 
-<% unless collection.empty? %>
-  <% collection.each do |workflow| %>
-    <% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
-    <% if collection.size == 1 -%>
-      <% show ||= Authorization.check("view", workflow, current_user) -%>
-    <% else -%>
-      <% show = Authorization.check("view", workflow, current_user) -%>
-    <% end -%>
-    <% if show -%>
-      <% cache(:controller => 'workflows_cache', :action ="" 'listing', :id => workflow.id) do -%>
-        <div class="resource_list_item <%= workflow.contribution.policy.layout -%>">
+<% collection.each do |workflow| %>
+  <% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
+  <% if collection.size == 1 -%>
+    <% show ||= Authorization.check("view", workflow, current_user) -%>
+  <% else -%>
+    <% show = Authorization.check("view", workflow, current_user) -%>
+  <% end -%>
+  <% if show -%>
 
-          <div class="avatar_panel">
-            <div class="workflow_type_box">
-              <%= link_to(h(workflow.content_type.title), content_type_path(workflow.content_type)) %>
-            </div>
-            <span class="owner"><%= owner_text workflow -%></span>
-            <%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, true, 60) %>
-            <% if layout = workflow.contribution.policy.layout %>
-              <% begin %>
-                <%= render :partial => "skins/branding/#{layout}" %>
-              <% rescue ActionView::MissingTemplate %>
-              <% end %>
-            <% end %>
-          </div>
+    <div class="resource_list_item <%= workflow.contribution.policy.layout -%>">
 
-          <div class="main_panel">
+      <div class="avatar_panel">
+        <div class="workflow_type_box">
+          <%= link_to(h(workflow.content_type.title), content_type_path(workflow.content_type)) %>
+        </div>
+        <span class="owner"><%= owner_text workflow -%></span>
+        <%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, true, 60) %>
+        <% if layout = workflow.contribution.policy.layout %>
+          <% begin %>
+            <%= render :partial => "skins/branding/#{layout}" %>
+          <% rescue ActionView::MissingTemplate %>
+          <% end %>
+        <% end %>
+      </div>
 
-            <div class="actions">
-              <%= icon "show", workflow_path(workflow), nil, nil, "View" %>
-              <% if Authorization.check("download", workflow, current_user) -%>
-                <%= icon "download", download_workflow_path(workflow), nil, nil, "Download (v#{workflow.versions.count})" %>
-                <% if ( session[:callback] && (session[:callback][:types].include?(workflow.content_type_id))) -%>
-                  <%= icon "download", callback_url(workflow).to_s, nil, {:rel => 'nofollow'}, session[:callback][:label] -%>
-                <% end %>
-              <% end %>
-              <% if mine?(workflow) %>
-                <%= icon "manage", edit_workflow_path(workflow), nil, nil, "Manage" %>
-              <% end %>
-            </div>
+      <div class="main_panel">
 
-            <a name="<%= workflow.title.gsub(/ /, "_") %>"></a>
+        <div class="actions">
+          <%= icon "show", workflow_path(workflow), nil, nil, "View" %>
+          <% if Authorization.check("download", workflow, current_user) -%>
+            <%= icon "download", download_workflow_path(workflow), nil, nil, "Download (v#{workflow.versions.count})" %>
+            <% if ( session[:callback] && (session[:callback][:types].include?(workflow.content_type_id))) -%>
+              <%= icon "download", callback_url(workflow).to_s, nil, {:rel => 'nofollow'}, session[:callback][:label] -%>
+            <% end %>
+          <% end %>
+          <% if mine?(workflow) %>
+            <%= icon "manage", edit_workflow_path(workflow), nil, nil, "Manage" %>
+          <% end %>
+        </div>
+        <% cache(:controller => 'workflows_cache', :action ="" 'listing', :id => workflow.id) do -%>
+          <a name="<%= workflow.title.gsub(/ /, "_") %>"></a>
 
-            <p class="title">
-              <%= icon "workflow", nil, nil, nil, '' %>
-              <% truncated_title = truncate(workflow.title, :length => 45) %>
-              <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, workflow_path(workflow),
-                         :title => workflow.title) %>
-              <span style="font-weight:normal;">
-                (<%= workflow.current_version %>)
-              </span>
-            </p>
+          <p class="title">
+            <%= icon "workflow", nil, nil, nil, '' %>
+            <% truncated_title = truncate(workflow.title, :length => 45) %>
+            <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, workflow_path(workflow),
+                       :title => workflow.title) %>
+            <span style="font-weight:normal;">
+              (<%= workflow.current_version %>)
+            </span>
+          </p>
 
+          <p>
+            <b>Created:</b> <%=datetime workflow.contribution.created_at, false -%>
+            <% unless workflow.contribution.created_at == workflow.contribution.updated_at %>
+              |	<b>Last updated:</b> <%=datetime workflow.contribution.updated_at, false -%>
+            <% end %>
+          </p>
+
+          <% unless (creditors = workflow.creditors).empty? %>
             <p>
-              <b>Created:</b> <%=datetime workflow.contribution.created_at, false -%>
-              <% unless workflow.contribution.created_at == workflow.contribution.updated_at %>
-                |	<b>Last updated:</b> <%=datetime workflow.contribution.updated_at, false -%>
+              <b>Credits:</b>
+              <% creditors.each do |c| %>
+                <% if c.creditor_type == 'User' %>
+                  <%= icon('user', nil, nil, nil, '') %>
+                <% elsif c.creditor_type == 'Network' %>
+                  <%= icon('network-member', nil, nil, nil, '') %>
+                <% end %>
+                <%= contributor(c.creditor_id, c.creditor_type) %>
               <% end %>
             </p>
+          <% end %>
 
-            <% unless (creditors = workflow.creditors).empty? %>
-              <p>
-                <b>Credits:</b>
-                <% creditors.each do |c| %>
-                  <% if c.creditor_type == 'User' %>
-                    <%= icon('user', nil, nil, nil, '') %>
-                  <% elsif c.creditor_type == 'Network' %>
-                    <%= icon('network-member', nil, nil, nil, '') %>
+          <% unless (attributors = workflow.attributors).empty? %>
+            <p>
+              <b>Attributions:</b>
+              <% attributors.each do |a| %>
+                <% if Authorization.check("view", a.attributor, current_user) -%>
+                  <% if a.attributor_type == 'Workflow' %>
+                    <%= icon('workflow', nil, nil, nil, '') %>
+                  <% elsif a.attributor_type == 'Blob' %>
+                    <%= icon('blob', nil, nil, nil, '') %>
                   <% end %>
-                  <%= contributor(c.creditor_id, c.creditor_type) %>
+                  <%= contributable(a.attributor_id, a.attributor_type) %>
                 <% end %>
-              </p>
-            <% end %>
+              <% end %>
+            </p>
+          <% end %>
 
-            <% unless (attributors = workflow.attributors).empty? %>
-              <p>
-                <b>Attributions:</b>
-                <% attributors.each do |a| %>
-                  <% if Authorization.check("view", a.attributor, current_user) -%>
-                    <% if a.attributor_type == 'Workflow' %>
-                      <%= icon('workflow', nil, nil, nil, '') %>
-                    <% elsif a.attributor_type == 'Blob' %>
-                      <%= icon('blob', nil, nil, nil, '') %>
-                    <% end %>
-                    <%= contributable(a.attributor_id, a.attributor_type) %>
-                  <% end %>
-                <% end %>
-              </p>
-            <% end %>
+          <% if workflow.license_id.nil? %>
+            <p><b>License: </b>No license</p>
+          <% else %>
+            <p><b>License: </b><% @license = License.find(workflow.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
+          <% end %>
 
-            <% if workflow.license_id.nil? %>
-              <p><b>License: </b>No license</p>
-            <% else %>
-              <p><b>License: </b><% @license = License.find(workflow.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
-            <% end %>
+          <div class="desc">
+            <% unless workflow.image.nil? && workflow.svg.nil? -%>
+              <div class="preview">
+                <%= link_to image_tag(workflow_preview_path(workflow, 'thumb'), :class => 'framed_nospace'), workflow_path(workflow) %>
+              </div>
+            <% end -%>
+            <% if workflow.body and workflow.body.length > 0 -%>
+              <% desc = truncate(strip_html(workflow.body), :length => 500) -%>
+              <%= query ? highlight_all(desc, query) : desc %>
+            <% else -%>
+              <span class="none_text">No description</span>
+            <% end -%>
+          </div>
 
-            <div class="desc">
-              <% unless workflow.image.nil? && workflow.svg.nil? -%>
-                <div class="preview">
-                  <%= link_to image_tag(workflow_preview_path(workflow, 'thumb'), :class => 'framed_nospace'), workflow_path(workflow) %>
-                </div>
-              <% end -%>
-              <% if workflow.body and workflow.body.length > 0 -%>
-                <% desc = truncate(strip_html(workflow.body), :length => 500) -%>
-                <%= query ? highlight_all(desc, query) : desc %>
-              <% else -%>
-                <span class="none_text">No description</span>
-              <% end -%>
-            </div>
+          <p>
+            <a href="" workflow_path(workflow) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(workflow.rating, :precision => 1) %> / 5 (<%= pluralize workflow.ratings.count, 'rating' %>)</a> |
+            <a href="" workflow_path(workflow) + '#versions' -%>"><b>Versions: </b><%= workflow.versions.count %></a> |
+            <a href="" workflow_path(workflow) + '#reviews' -%>"><b>Reviews: </b><%= workflow.reviews.count %></a> |
+            <a href="" workflow_path(workflow) + '#comments' -%>"><b>Comments: </b><%= workflow.comments.count %></a> |
+            <a href="" workflow_path(workflow) + '#citations' -%>"><b>Citations: </b><%= workflow.citations.count %></a>
+          </p>
 
-            <p>
-              <a href="" workflow_path(workflow) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(workflow.rating, :precision => 1) %> / 5 (<%= pluralize workflow.ratings.count, 'rating' %>)</a> |
-              <a href="" workflow_path(workflow) + '#versions' -%>"><b>Versions: </b><%= workflow.versions.count %></a> |
-              <a href="" workflow_path(workflow) + '#reviews' -%>"><b>Reviews: </b><%= workflow.reviews.count %></a> |
-              <a href="" workflow_path(workflow) + '#comments' -%>"><b>Comments: </b><%= workflow.comments.count %></a> |
-              <a href="" workflow_path(workflow) + '#citations' -%>"><b>Citations: </b><%= workflow.citations.count %></a>
-            </p>
+          <p>
+            <b>Viewed:</b> <%=pluralize workflow.contribution.site_viewings_count, "time" %> |
+            <b>Downloaded:</b> <%=pluralize workflow.contribution.site_downloads_count, "time" %>
+          </p>
 
-            <p>
-              <b>Viewed:</b> <%=pluralize workflow.contribution.site_viewings_count, "time" %> |
-              <b>Downloaded:</b> <%=pluralize workflow.contribution.site_downloads_count, "time" %>
-            </p>
-
-            <% unless (tags = workflow.tags).empty? %>
-              <a href="" workflow_path(workflow) + '#tags' -%>"><p><b>Tags</b> (<%=tags.count-%>):</p></a>
-              <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-            <% else %>
-              <p><i>This Workflow has no tags!</i></p>
-            <% end %>
-          </div>
-        </div>
-      <% end -%>
-    <% end -%>
+          <% unless (tags = workflow.tags).empty? %>
+            <a href="" workflow_path(workflow) + '#tags' -%>"><p><b>Tags</b> (<%=tags.count-%>):</p></a>
+            <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+          <% else %>
+            <p><i>This Workflow has no tags!</i></p>
+          <% end %>
+        <% end -%>
+      </div>
+    </div>
   <% end -%>
 <% end %>

Modified: trunk/public/stylesheets/styles.css (3347 => 3348)


--- trunk/public/stylesheets/styles.css	2013-01-24 15:17:07 UTC (rev 3347)
+++ trunk/public/stylesheets/styles.css	2013-01-25 09:44:56 UTC (rev 3348)
@@ -888,19 +888,6 @@
   width: 360px;
 }
 
-table.alt_table .standout {
-	border: 1px dotted #999999;
-	margin: 0.2em 0;
-	padding: 0.4em 0.6em;
-	background-color: #FFFFCC;
-	text-align: left;
-	line-height: 1;
-	font-size: 93%;
-	font-weight: bold;
-	color: #333333;
-	width: 360px;
-}
-
 table.alt_table tr td.contributable {
 	margin: 0.5em 0;
 	padding: 1em;
@@ -2433,8 +2420,9 @@
   text-align: left;
   border: 1px solid #ccc;
   background-color: #fff;
-  padding: 0.25em;
+  padding: 0.5em 0.25em 0.25em 0.25em;
   margin: 0 0 0.5em 0.5em;
+  min-width: 6em;
 }
 .resource_list_item .actions a {
   display: block;
@@ -2452,4 +2440,10 @@
   text-align:center;
   padding: 0.2em 0;
   margin: 0 auto;
+}
+
+.resource_list_item  p.standout {
+	font-weight: bold;
+	color: #333333;
+  font-size: 100%;
 }
\ No newline at end of file

reply via email to

[Prev in Thread] Current Thread [Next in Thread]