Permalink
Browse files

Cleaned up some more formatting. Allowed admins to click on minutes t…

…o see the transaction logs of just that user.
  • Loading branch information...
zombieCraig committed Sep 3, 2011
1 parent 525c237 commit dbeec0354cc77140d98ad62eb984f82592101705
@@ -50,6 +50,11 @@ ul.hmenu {
padding: 5px;
}
+.welcomecert {
+ position: relative;
+ top: 4px;
+}
+
#welcomecorner {
display:block; width:7px; height:16px; background:url(welcomecorner.png) 0 0 no-repeat; margin:0;
}
@@ -19,9 +19,9 @@
}
#bodyPanWide h1{
- width:352px; height:32px; display:block; background:url(images/welcomebg.gif) 0 100% repeat-x; font:28px/26px Georgia, "Times New Roman", Times, serif; padding:42px 0 0;}
+ width:752px; height:32px; display:block; background:url(images/welcomebg.gif) 0 100% repeat-x; font:28px/26px Georgia, "Times New Roman", Times, serif; padding:42px 0 0;}
#bodyPanWide h1 span{background:#F9F9F9; color:#9A0000; font-size:26px;}
-#bodyPanWide h2{width:450px; height:32px; display:block; background:url(dotline.gif) 0 100% repeat-x #fff; font:28px/26px Georgia, "Times New Roman", Times, serif; padding:42px 0 0; color:#9A0000;}
+#bodyPanWide h2{width:750px; height:32px; display:block; background:url(dotline.gif) 0 100% repeat-x #fff; font:28px/26px Georgia, "Times New Roman", Times, serif; padding:42px 0 0; color:#9A0000;}
@@ -14,3 +14,8 @@ tr.even
{
background-color:#ececec;
}
+
+td#minutes
+{
+ text-align:center;
+}
@@ -5,7 +5,12 @@ class TimeBalancesController < ApplicationController
# GET /time_balances.json
def index
if can? :manage, :all
- @time_balances = TimeBalance.order("created_at desc" ).page params[:page]
+ @target_id = params[:target_id]
+ if @target_id then
+ @time_balances = TimeBalance.where(:user_id => @target_id).order("created_at desc" ).page params[:page]
+ else
+ @time_balances = TimeBalance.order("created_at desc" ).page params[:page]
+ end
else
@time_balances = TimeBalance.where(:user_id => current_user.id).order("created_at desc").page params[:page]
end
@@ -22,7 +22,7 @@
%td=u.email
%td=u.username
%td=link_to u.member_level, :action => "edit_user", :id => u.id
- %td=u.balance
+ %td=link_to u.balance, :controller => "time_balances", :action => "index", :target_id => u.id
%td
- if u.last_seen
=time_ago_in_words(u.last_seen)
@@ -1,7 +1,7 @@
-if user_signed_in?
#welcome
- if current_user.certified
- =image_tag "lazercert.png", :alt=>"Certified", :title=>"Certified"
+ =image_tag "lazercert.png", :alt=>"Certified", :title=>"Certified", :class => "welcomecert"
="Welcome #{current_user.name} ("
=raw get_balance
)
@@ -3,7 +3,14 @@
<% end %>
<div id="bodyPanWide">
-<h2>Transaction logs</h2>
+<% if @target_id and can? :manage, :all %>
+ <% target = User.find(@target_id) %>
+ <% if target %>
+ <h2>Transaction logs for <%= target.name %></h2>
+ <% end %>
+<% else %>
+ <h2>Transaction logs</h2>
+<% end %>
<table id="wide">
<tr>
@@ -19,11 +26,11 @@
<% @time_balances.each do |time_balance| %>
<tr class="<%=cycle('odd', 'even') %>">
- <td><%= time_balance.user.email %></td>
- <td><%= time_balance.minutes %></td>
- <td><%= User.find(time_balance.submitted_by_id).name %></td>
- <td><%= time_tag time_balance.created_at %></td>
- <td><%= time_balance.notes %></td>
+ <td id=email><%= time_balance.user.email %></td>
+ <td id=minutes><%= time_balance.minutes %></td>
+ <td id=submitted_by><%= User.find(time_balance.submitted_by_id).name %></td>
+ <td id=created_at><%= time_tag time_balance.created_at %></td>
+ <td id=notes><%= time_balance.notes %></td>
</tr>
<% end %>
</table>

0 comments on commit dbeec03

Please sign in to comment.