myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2691] trunk: adjusted style of the topics index


From: noreply
Subject: [myexperiment-hackers] [2691] trunk: adjusted style of the topics index
Date: Tue, 6 Sep 2011 21:33:24 -0400 (EDT)

Revision
2691
Author
dgc
Date
2011-09-06 21:33:24 -0400 (Tue, 06 Sep 2011)

Log Message

adjusted style of the topics index

Modified Paths

Added Paths

Diff

Modified: trunk/app/controllers/topics_controller.rb (2690 => 2691)


--- trunk/app/controllers/topics_controller.rb	2011-09-06 15:55:11 UTC (rev 2690)
+++ trunk/app/controllers/topics_controller.rb	2011-09-07 01:33:24 UTC (rev 2691)
@@ -111,7 +111,13 @@
 
             topicLink = "<a href=""
 
-            page.replace_html "topic_feedback_#{params[:topic_id]}", "#{topicLink} &nbsp;&nbsp;&nbsp;Thanks for your feedback!"
+            if feedback.score == 1
+              img_url = 'images/thumbsup_grey.png'
+            else
+              img_url = 'images/thumbsdown_grey.png'
+            end
+
+            page.replace_html "topic_feedback_#{params[:topic_id]}", "<img src=''>"
           end
         }
       end

Modified: trunk/app/helpers/application_helper.rb (2690 => 2691)


--- trunk/app/helpers/application_helper.rb	2011-09-06 15:55:11 UTC (rev 2690)
+++ trunk/app/helpers/application_helper.rb	2011-09-07 01:33:24 UTC (rev 2691)
@@ -1588,4 +1588,21 @@
       return nil
     end
   end
+
+  def group_items(items, num)
+
+    result = []
+
+    while !items.empty? do
+      group = []
+
+      num.times do
+        group << items.shift unless items.empty?
+      end
+
+      result << group
+    end
+
+    result
+  end
 end

Added: trunk/app/models/topic_feedback.rb (0 => 2691)


--- trunk/app/models/topic_feedback.rb	                        (rev 0)
+++ trunk/app/models/topic_feedback.rb	2011-09-07 01:33:24 UTC (rev 2691)
@@ -0,0 +1,10 @@
+# myExperiment: app/helpers/application_helper.rb
+#
+# Copyright (c) 2007 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class TopicFeedback < ActiveRecord::Base
+  belongs_to :user
+  validates_inclusion_of :score, :in => [-1, 1]
+end
+

Added: trunk/app/views/topics/_tiles.rhtml (0 => 2691)


--- trunk/app/views/topics/_tiles.rhtml	                        (rev 0)
+++ trunk/app/views/topics/_tiles.rhtml	2011-09-07 01:33:24 UTC (rev 2691)
@@ -0,0 +1,27 @@
+<table style="border-spacing: 16px;" id="topic_container">
+  <% group_items(topics, 3).each do |group| %>
+    <tr>
+      <% group.each do |topic| %>
+        <td style="width: 210px; display: inline-block; margin: 4px; vertical-align: top; border: 2px solid gray; background: #e0e0e0; padding: 4px">
+          <% if logged_in? %>
+            <div style="float: right" id="<%= "topic_feedback_#{topic.id}" -%>" class="topic_feedback">
+              <% if topic.topic_feedback.exists?( :user_id => current_user ) %>
+                <% if topic.topic_feedback.find(:first, :conditions => ['user_id = ?', current_user.id]).score == 1 %>
+                  <img src=""
+                <% else %>
+                  <img src=""
+                <% end %>
+              <% else %>
+                <%= link_to_remote( "<img src="" { :url ="" { :controller => "topics", :action ="" "topic_feedback", :topic_id => topic.id, :user_id => current_user.id, :score => 1 } } ) %>
+                <%= link_to_remote( "<img src="" { :url ="" { :controller => "topics", :action ="" "topic_feedback", :topic_id => topic.id, :user_id => current_user.id, :score => -1 } } ) %>
+              <% end %>
+            </div>
+          <% end %>
+          <div style="margin: 8px;"><%= link_to("Explore (#{pluralize(topic.topic_workflow_map.count, 'workflow')})", topic_path(topic)) -%></div>
+          <%= render :partial => "topics/topic_tag_cloud", :locals => {:tags => topic.topic_tag_map, :topicname => "Explore" } -%>
+        </td> 
+      <% end %>
+    </tr>
+  <% end %>
+</table>
+

Modified: trunk/app/views/topics/index.rhtml (2690 => 2691)


--- trunk/app/views/topics/index.rhtml	2011-09-06 15:55:11 UTC (rev 2690)
+++ trunk/app/views/topics/index.rhtml	2011-09-07 01:33:24 UTC (rev 2691)
@@ -1,32 +1,4 @@
 <h1>Topics</h1>
 
-<div id="topic_container">
-	<% @curr_run.topics.each do |topic| -%>
-           <% topicName = (if topic.name.blank? then "Topic #{topic.id}" else "#{topic.name}" end) -%>
-	   <h2>
-		<% if logged_in? %>
+<%= render(:partial => 'topics/tiles', :locals => { :topics => @curr_run.topics }) -%>
 
-			<%= "<div id=\"topic_feedback_#{topic.id}\" class=\"topic_feedback\">" %>
-				<!-- <%= "<a href="" %> -->
-				<%= "<a href="" this topic</a>" %> 
-
-				<% if topic.topic_feedback.exists?( :user_id => current_user ) %>
-        				&nbsp;&nbsp;&nbsp;Thanks for your feedback!
-				<% else %>
-        				&nbsp;&nbsp;&nbsp;Please rate this topic&nbsp;&nbsp;
-        				<%= link_to_remote( "<img src="" {:url ="" { :controller => "topics", :action ="" "topic_feedback", :topic_id => topic.id, :user_id => current_user.id, :score => 1 } } ) %>
-        				<%= link_to_remote( "<img src="" {:url ="" { :controller => "topics", :action ="" "topic_feedback", :topic_id => topic.id, :user_id => current_user.id, :score => -1 } } ) %>
-				<% end %>
-			</div>
-		<% else %>
-			<!-- <%= "<a href="" %> -->
-			<%= "<a href="" this topic</a>" %>
-		<% end %>
-	   </h2>
-
-	   <%= "<div id=\"tag_cloud_container_#{topic.id}\">" %>
- 			<%= render :partial => "topics/topic_tag_cloud", :locals => {:tags => topic.topic_tag_map, :topicname => topicName } %>
-     </div> 
-	<% end -%>
-</div>
-

Modified: trunk/public/images/thumbsdown.png


(Binary files differ)

Added: trunk/public/images/thumbsdown_grey.png


(Binary files differ)
Property changes on: trunk/public/images/thumbsdown_grey.png ___________________________________________________________________

Added: svn:executable

Added: svn:mime-type

Modified: trunk/public/images/thumbsup.png


(Binary files differ)

Added: trunk/public/images/thumbsup_grey.png


(Binary files differ)
Property changes on: trunk/public/images/thumbsup_grey.png ___________________________________________________________________

Added: svn:executable

Added: svn:mime-type

Modified: trunk/public/stylesheets/styles.css (2690 => 2691)


--- trunk/public/stylesheets/styles.css	2011-09-06 15:55:11 UTC (rev 2690)
+++ trunk/public/stylesheets/styles.css	2011-09-07 01:33:24 UTC (rev 2691)
@@ -2051,7 +2051,8 @@
   background-color: #FFFFCC; 
 }
 
-table.topic div.topic_feedback{
+.topic_feedback{
+  float: right;
   text-align:center;
   margin-top:7px;
 }
@@ -2074,6 +2075,10 @@
 /*  width: 225px; */
 }
 
+#topic_container LI {
+}
+
+
 /* End syles related to topics */
 
 /* pivot */

reply via email to

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