Changeset 4726
- Timestamp:
- 08/08/06 21:01:45 (2 years ago)
- Files:
-
- applications/plugins/app/helpers/application_helper.rb (modified) (1 diff)
- applications/plugins/app/views/ratings/_rating.rhtml (modified) (1 diff)
- applications/plugins/app/views/ratings/index.rhtml (modified) (1 diff)
- applications/plugins/public/stylesheets/plugins.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
applications/plugins/app/helpers/application_helper.rb
r4725 r4726 4 4 end 5 5 6 def icon_for(rating, points) 7 link_to_function image_tag("#{points > 0 ? :add : :subtract}.gif", :size => '12x12'), 8 "Plugin.setRating(#{rating.plugin_id}, #{rating.release_id}, #{points})", 9 :id => "release-#{rating.release_id}-#{points > 0 ? :add : :subtract}", :class => (rating.points == points ? 'selected-icon' : 'icon') 6 def rating_icon_for(plugin_id, release_id, points, icon_points) 7 link_to_function icon_for(icon_points), 8 "Plugin.setRating(#{plugin_id}, #{release_id}, #{icon_points})", 9 :id => "release-#{release_id}-#{icon_points > 0 ? :add : :subtract}", :class => (points == icon_points ? 'selected-icon' : 'icon') 10 end 11 12 def icon_for(points) 13 image_tag("#{points > 0 ? :add : :subtract}.gif", :size => '12x12', :class => 'icon') 10 14 end 11 15 end applications/plugins/app/views/ratings/_rating.rhtml
r4725 r4726 1 <li id="<%= rating.dom_id %>">(<%= rating.points %>) <%= link_to rating.plugin.name, plugin_path(rating.plugin_id) %> for <%= link_to rating.release.name, release_path(rating.release_id) %></li> 1 <li id="<%= rating.dom_id %>"> 2 <%= icon_for(rating.points) %> 3 <%= link_to rating.release.name, release_path(rating.release_id) %> by 4 <%= link_to rating.user.login, user_path(rating.user_id) %> 5 </li> applications/plugins/app/views/ratings/index.rhtml
r4725 r4726 7 7 <% @releases.each do |release| rating = @ratings.detect { |r| r.release_id == release.id } ; -%> 8 8 <li> 9 <%= icon_for(rating, 1) %>10 <%= icon_for(rating, -1) %>9 <%= rating_icon_for(@plugin.id, release.id, (rating && rating.points || 0), 1) %> 10 <%= rating_icon_for(@plugin.id, release.id, (rating && rating.points || 0), -1) %> 11 11 <%= link_to release.name, release_path(release) %> 12 12 <%= image_tag 'progress.gif', :size => '10x10', :id => "#{release.dom_id}-spinner", :style => 'display:none' %> applications/plugins/public/stylesheets/plugins.css
r4725 r4726 67 67 } 68 68 69 .selected-icon img { 69 .icon, 70 .selected-icon img.icon { 70 71 background-color: #390; 71 72 } 72 73 73 .icon img {74 .icon img.icon { 74 75 background-color: #555; 75 76 } 76 77 77 .busy-icon img {78 .busy-icon img.icon { 78 79 background-color: #999; 79 80 } 80 81 81 82 img { border-width:0; } 83 84 ul { 85 padding:0; 86 margin:0; 87 list-style-type:none; 88 }