summaryrefslogtreecommitdiff
path: root/app/views/users
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-10-20 21:21:37 +0200
committerhukl <contact@smyck.org>2009-10-20 21:21:37 +0200
commit324753b94474a18ffbc8cf243e502b71b67eab86 (patch)
tree095fdff9f6471b73505811396e7dab24d7eb80d6 /app/views/users
parentaa751d8740ceabf481afa3c0a6a3db79e30b0983 (diff)
cleaned up the user views a bit
Diffstat (limited to 'app/views/users')
-rw-r--r--app/views/users/_admin_user_item.html.erb12
-rw-r--r--app/views/users/_user.html.erb9
-rw-r--r--app/views/users/_user_item.html.erb4
-rw-r--r--app/views/users/index.html.erb19
4 files changed, 14 insertions, 30 deletions
diff --git a/app/views/users/_admin_user_item.html.erb b/app/views/users/_admin_user_item.html.erb
deleted file mode 100644
index d882dc4..0000000
--- a/app/views/users/_admin_user_item.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
1<tr>
2 <td><%= admin_user_item.login %></td>
3 <td>
4 <%= link_to "Show", user_path(admin_user_item) %>
5 <%= link_to(
6 "Destroy",
7 user_path(admin_user_item),
8 :method => "delete",
9 :confirm => "Are you sure to delete user: #{admin_user_item.login}?"
10 ) %>
11 </td>
12</tr> \ No newline at end of file
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb
new file mode 100644
index 0000000..90e8b88
--- /dev/null
+++ b/app/views/users/_user.html.erb
@@ -0,0 +1,9 @@
1<tr>
2 <td><%= user.login %></td>
3 <td><%= link_to "show", user_path(user) %></td>
4 <td>
5 <% if current_user.admin? || current_user == user %>
6 <%= link_to "edit", edit_user_path(user) %>
7 <% end %>
8 </td>
9</tr> \ No newline at end of file
diff --git a/app/views/users/_user_item.html.erb b/app/views/users/_user_item.html.erb
deleted file mode 100644
index c3389ba..0000000
--- a/app/views/users/_user_item.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
1<tr>
2 <td><%= user_item.login %></td>
3 <td></td>
4</tr> \ No newline at end of file
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 03085c1..8d931be 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -1,23 +1,14 @@
1<h1>Users</h1> 1<table class="user_list">
2
3<table id="user_list">
4 <tr> 2 <tr>
5 <th>login</th> 3 <td><h1>Admins</h1></td>
6 </tr> 4 </tr>
7 <% @users.each do |user| %> 5 <%= render :partial => "user", :collection => @users[:admin], :as => :user %>
8 <tr> 6 <tr>
9 <td><%= user.login %></td> 7 <td><h1>Users</h1></td>
10 <td><%= link_to "show", user_path(user) %></td>
11 <td>
12 <% if current_user == user || current_user.admin? %>
13 <%= link_to "Edit", edit_user_path(user) %>
14 <% end %>
15 </td>
16 </tr> 8 </tr>
17 <% end %> 9 <%= render :partial => "user", :collection => @users[:user], :as => :user %>
18</table> 10</table>
19 11
20
21<% content_for :subnavigation do %> 12<% content_for :subnavigation do %>
22 <%= link_to "create", new_user_path %> 13 <%= link_to "create", new_user_path %>
23<% end %> \ No newline at end of file 14<% end %> \ No newline at end of file