Added nice front page stuff, fixing sqlite issues, adding user payments to profiles
This commit is contained in:
parent
ed75ea0e90
commit
cefd4b3878
|
@ -6,7 +6,7 @@ def index
|
||||||
@num_users = User.count
|
@num_users = User.count
|
||||||
@recent_users = User.where("created_at > ?", DateTime.now - 7.days).count
|
@recent_users = User.where("created_at > ?", DateTime.now - 7.days).count
|
||||||
if can? :read, User then
|
if can? :read, User then
|
||||||
@recent_user_names = User.where("created_at > ?", DateTime.now - 7.days)
|
@recent_user_names = User.where("member_level > 10").accessible_by(current_ability).order('created_at desc').limit(5)
|
||||||
end
|
end
|
||||||
@num_door_opens = DoorLog.where("key = 'G'").count
|
@num_door_opens = DoorLog.where("key = 'G'").count
|
||||||
@today_door_opens = DoorLog.where("key = 'G' AND created_at > ?", DateTime.now - 1.day).count
|
@today_door_opens = DoorLog.where("key = 'G' AND created_at > ?", DateTime.now - 1.day).count
|
||||||
|
|
|
@ -36,6 +36,7 @@ class UsersController < ApplicationController
|
||||||
# GET /users/1
|
# GET /users/1
|
||||||
# GET /users/1.json
|
# GET /users/1.json
|
||||||
def show
|
def show
|
||||||
|
@payments = Payment.where(:user_id => @user.id).order('date desc').limit(10)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.erb
|
format.html # show.html.erb
|
||||||
format.json { render :json => @user }
|
format.json { render :json => @user }
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
<%= link_to 'New Card', new_card_path if can? :create, Card %>
|
<%= link_to 'New Card', new_card_path if can? :create, Card %>
|
||||||
<%= link_to 'Upload all cards', upload_all_path if can? :upload_all, Card %>
|
<%= link_to 'Upload all cards', upload_all_path if can? :upload_all, Card %>
|
||||||
|
<%= link_to 'Door Logs', door_logs_path if can? :read, DoorLog %>
|
||||||
<p>
|
<p>
|
||||||
<b>Most Active Card Last 7 Days:</b> <%= @most_active_card.name %> (<%= @most_active_card.accesses_this_week %> times)
|
<b>Most Active Card Last 7 Days:</b> <%= @most_active_card.name %> (<%= @most_active_card.accesses_this_week %> times)
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
<h2>Edit Your Profile</h2>
|
<h2>Profile:</h2>
|
||||||
|
|
||||||
<%= devise_error_messages! %>
|
<%= devise_error_messages! %>
|
||||||
|
|
||||||
<div class="payment_links">
|
<div class="payment_links">
|
||||||
|
|
||||||
|
<% if can? :read, resource.payments then %>
|
||||||
|
<h3>Recorded Payments:</h3>
|
||||||
|
<ul>
|
||||||
|
<% resource.payments.each do |payment| %>
|
||||||
|
<li><%= payment.date %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<hr/>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if resource.payment_method == "Dwolla" %>
|
<% if resource.payment_method == "Dwolla" %>
|
||||||
<h3>Dwolla Payment Link</h3>
|
<h3>Dwolla Payment Link</h3>
|
||||||
<% if resource.member_level == "25" %>
|
<% if resource.member_level == "25" %>
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<% if ((can? :read, @recent_user_names) && (@recent_user_names.count > 1)) then %>
|
<% if ((can? :read, @recent_user_names) && (@recent_user_names.count > 1)) then %>
|
||||||
<h2>New People:</h2>
|
<h2>New People: <em>(say hi!)</em></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<% @recent_user_names.each do |user| %>
|
<% @recent_user_names.each do |user| %>
|
||||||
<li><%= link_to user.name, user %></li>
|
<li><%= link_to user.name, user %> <%= raw(user.member_status_symbol) %> <em>(Signed up <%= user.created_at.strftime("%b %d") %>)</em></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -45,7 +45,22 @@
|
||||||
<li><%= link_to "IRC", "irc://irc.freenode.net#heatsynclabs" %></li>
|
<li><%= link_to "IRC", "irc://irc.freenode.net#heatsynclabs" %></li>
|
||||||
<li><%= link_to "Live Webcams", "http://live.heatsynclabs.org/" %></li>
|
<li><%= link_to "Live Webcams", "http://live.heatsynclabs.org/" %></li>
|
||||||
<li>Lab Phone: (480) 751-1929</li>
|
<li>Lab Phone: (480) 751-1929</li>
|
||||||
|
<li>
|
||||||
|
<style type="text/css">
|
||||||
|
form input {font-family: 'Lucida Console', Monaco, monospace; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<b>Send a Message!</b>
|
||||||
|
<form method="post" action="http://tweet.zyphon.com/signage.php">
|
||||||
|
<em>Type here and your message will show up on the LED sign in the front window!</em><br/>
|
||||||
|
<em>(Please be nice!)</em><br/>
|
||||||
|
<input type="text" name="msg" id="msg" value=" Hello" size="9" /> (max 9 chars per line)<br/>
|
||||||
|
<input type="text" name="msg2" id="msg2" value=" World" size="9" /><br/>
|
||||||
|
<input type="submit" name="submitbutton" id="submitbutton" value="Go!" />
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
<%= link_to 'Certifications', certifications_path if can? :read, Certification %>
|
<%= link_to 'Certifications', certifications_path if can? :read, Certification %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to 'Payments', payments_path if can? :read, Payment %>
|
<%= link_to 'Payments', payments_path if can? :read, Payment %>
|
||||||
<%= link_to 'Door Logs', door_logs_path if can? :read, DoorLog %>
|
|
||||||
<%= link_to 'Computers', macs_path if user_signed_in? && (can? :read, Mac) %>
|
<%= link_to 'Computers', macs_path if user_signed_in? && (can? :read, Mac) %>
|
||||||
<% if user_signed_in? then %><%= link_to 'Profile', edit_user_registration_path %><% end %>
|
<% if user_signed_in? then %><%= link_to 'Profile', edit_user_registration_path %><% end %>
|
||||||
<%= link_to 'Logout', destroy_user_session_path, :method => :delete if user_signed_in? %>
|
<%= link_to 'Logout', destroy_user_session_path, :method => :delete if user_signed_in? %>
|
||||||
|
|
|
@ -92,6 +92,17 @@
|
||||||
<% if @user.certifications.blank? %><li>n/a</li><% end %>
|
<% if @user.certifications.blank? %><li>n/a</li><% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<% if current_user.admin? then %>
|
||||||
|
<p>
|
||||||
|
<b>Payments:</b>
|
||||||
|
<ul>
|
||||||
|
<% @payments.each do |payment| %>
|
||||||
|
<li><%= payment.date %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if current_user.admin? then %>
|
<% if current_user.admin? then %>
|
||||||
<p>
|
<p>
|
||||||
<b>Created:</b>
|
<b>Created:</b>
|
||||||
|
|
|
@ -22,4 +22,4 @@ production:
|
||||||
adapter: sqlite3
|
adapter: sqlite3
|
||||||
database: db/production.sqlite3
|
database: db/production.sqlite3
|
||||||
pool: 5
|
pool: 5
|
||||||
timeout: 300000
|
timeout: 5000
|
||||||
|
|
Loading…
Reference in New Issue
Block a user