summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-01-14 12:39:59 -0800
committerjessib <jessib@leap.se>2013-01-14 12:39:59 -0800
commit8141876126aa25d713cf4b2c76c3ecff837c4ba7 (patch)
treedaa33640bd157a9ad080975bcc3e1dee686480f2 /users
parentc2f232d994b3ee01ff9d50da1e4f3798df2136f3 (diff)
Use partials for displaying details shown when viewing a user. Some of these partials have specific CSS for another use, so we will likely want to tweak this.
Diffstat (limited to 'users')
-rw-r--r--users/app/models/user.rb2
-rw-r--r--users/app/views/emails/_email.html.haml5
-rw-r--r--users/app/views/users/show.html.haml21
3 files changed, 12 insertions, 16 deletions
diff --git a/users/app/models/user.rb b/users/app/models/user.rb
index 42900ea..1e8ee0e 100644
--- a/users/app/models/user.rb
+++ b/users/app/models/user.rb
@@ -95,7 +95,7 @@ class User < CouchRest::Model::Base
end
def most_recent_tickets(count=3)
- Ticket.for_user(self).limit(count) #defaults to having most recent updated first
+ Ticket.for_user(self).limit(count).all #defaults to having most recent updated first
end
protected
diff --git a/users/app/views/emails/_email.html.haml b/users/app/views/emails/_email.html.haml
index 3feb6f0..948d847 100644
--- a/users/app/views/emails/_email.html.haml
+++ b/users/app/views/emails/_email.html.haml
@@ -1,6 +1,7 @@
- if email.valid?
%li.pull-right
%code= email
- = link_to(user_email_alias_path(@user, email), :method => :delete) do
- %i.icon-remove
+ - if params[:action] == 'edit'
+ = link_to(user_email_alias_path(@user, email), :method => :delete) do
+ %i.icon-remove
.clearfix
diff --git a/users/app/views/users/show.html.haml b/users/app/views/users/show.html.haml
index 9df029e..2b59c66 100644
--- a/users/app/views/users/show.html.haml
+++ b/users/app/views/users/show.html.haml
@@ -1,5 +1,7 @@
.span8.offset1
%h2= @user.login
+ .small
+ = link_to 'edit', edit_user_path(@user)
%dl.offset1
- fields = ['login', 'email', 'created_at', 'updated_at', 'email_forward']
- fields.each do |field|
@@ -14,19 +16,12 @@
- if aliases.empty?
none set
- else
- %ul.unstyled
- - aliases.each do |al|
- %li
- = al.email
+ .pull-left
+ = render aliases
+ .clearfix
%dt
=t :most_recently_updated_tickets
%dd
- %ul
- - @user.most_recent_tickets.each do |ticket|
- %li
- = link_to ticket.title, ticket
- %small
- updated:
- = ticket.updated_at.to_s(:long)
-
-
+ %table
+ %tbody
+ = render @user.most_recent_tickets \ No newline at end of file