aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/admin_user
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/admin_user')
-rw-r--r--app/views/admin_user/_form.rhtml64
-rw-r--r--app/views/admin_user/_user_table.rhtml52
-rw-r--r--app/views/admin_user/edit.rhtml14
-rw-r--r--app/views/admin_user/list.rhtml12
-rw-r--r--app/views/admin_user/show.rhtml78
5 files changed, 66 insertions, 154 deletions
diff --git a/app/views/admin_user/_form.rhtml b/app/views/admin_user/_form.rhtml
index bb74ae38f..be69d9a80 100644
--- a/app/views/admin_user/_form.rhtml
+++ b/app/views/admin_user/_form.rhtml
@@ -2,7 +2,6 @@
<!--[form:admin_user]-->
-<<<<<<< HEAD
<p><label for="admin_user_name">Name</label> (will change URL name and break URLs; unlike authorities, there is no history; you will need to rebuild the search index afterwards)<br/>
<%= text_field 'admin_user', 'name', :size => 60 %></p>
@@ -26,66 +25,3 @@
<p><%= check_box 'admin_user', 'no_limit' %>
<label for="admin_user_no_limit">No rate limit</label> (disable the limit on daily requests)</p>
-=======
-<div class="control-group">
- <label for="admin_user_name" class="control-label">Name</label>
- <div class="controls">
- <%= text_field 'admin_user', 'name', :class => "span3" %>
- <div class="help-block">
- will change URL name and break URLs; unlike authorities, there is no history; you will need to rebuild the search index afterwards
- </div>
- </div>
-</div>
-
-<div class="control-group">
- <label for="admin_user_email" class="control-label">Email</label>
- <div class="controls">
- <%= text_field 'admin_user', 'email', :class => "span3" %>
- <div class="help-block">
- <strong>you must</strong> first validate this
- </div>
- </div>
-</div>
-
-<div class="control-group">
- <label for="admin_level" class="control-label">Admin level</label>
- <div class="controls">
- <%= text_field 'admin_user', 'admin_level', :class => "span3" %>
- <div class="help-block">
- <strong>none</strong> or <strong>super</strong>; this is for admin features and links which are in the site proper
- </div>
- </div>
-</div>
-
-<div class="control-group">
- <label for="ban_text" class="control-label">Ban text</label>
- <div class="controls">
- <%= text_area 'admin_user', 'ban_text', :class => "span6", :rows => 3 %>
- <div class="help-block">
- if not blank will stop the
- user from filing new requests, making annotations or messaging other users;
- the text is shown in public on the user's page and when they try to do a
- forbidden action; write in the second person (you); see
- <%= link_to 'banned users', '../banned' %> for examples</small>
- </div>
- </div>
-</div>
-
-<div class="control-group">
- <label for="about_me" class="control-label">About me</label>
- <div class="controls">
- <%= text_area 'admin_user', 'about_me', :class => "span6", :rows => 3 %>
- <div class="help-block">
- user's own text on their profile, format like comments
- </div>
- </div>
-</div>
-<div class="control-group">
- <label for="admin_user_no_limit" class="control-label">No rate limit</label>
- <div class="controls">
- <%= check_box 'admin_user', 'no_limit' %>
- <div class="help-block">
- disable the limit on daily requests
- </div>
- </div>
-</div>
diff --git a/app/views/admin_user/_user_table.rhtml b/app/views/admin_user/_user_table.rhtml
index 16431b7ae..d35c78594 100644
--- a/app/views/admin_user/_user_table.rhtml
+++ b/app/views/admin_user/_user_table.rhtml
@@ -1,36 +1,22 @@
-<div class="accordion" id="users">
- <% for user in users %>
- <div class="accordion-group">
- <div class="accordion-heading">
- <%= link_to("admin", user_admin_url(user), :class => "btn btn-primary btn-mini")%>
- <a class="accordion-toggle" href="#user_<%=user.id%>" data-toggle="collapse" data-parent="users">
- <%=h user.name%> (<%=user.email%>)
- </a>
- </div>
- <div id="user_<%=user.id%>" class="accordion-body collapse">
- <table class="table table-striped">
- <tbody>
- <% user.for_admin_column do |name, value, type|%>
- <tr>
- <td>
- <b><%=h name%></b>
- </td>
- <td>
- <% if type == 'datetime' %>
- <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
- (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
- <% else %>
- <%= h value %>
- <% end %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </div>
+<table>
+ <tr>
+ <th>Id</th>
+ <% for column in ['Name', 'Email', 'Created at', 'Updated at', 'Email confirmed', 'Admin'] + (banned_column ? ['Ban text'] : []) %>
+ <th><%= column %></th>
<% end %>
-</div>
+ </tr>
+
+<% for user in users %>
+ <tr class="<%= cycle('odd', 'even') %>">
+ <td><%= user.id.to_s %></td>
+ <td><%= user_both_links(user) %></td>
+ <td><a href="mailto:<%=h user.email %>"><%=h user.email%></a></td>
+ <% for column in ['created_at', 'updated_at', 'email_confirmed', 'admin_level'] + (banned_column ? ['ban_text'] : []) %>
+ <td><%=h user.send(column) %></td>
+ <% end %>
+ </tr>
+<% end %>
+</table>
-<%= will_paginate(users, :class => "paginator") %>
+<%= will_paginate(users) %>
diff --git a/app/views/admin_user/edit.rhtml b/app/views/admin_user/edit.rhtml
index c3ee3012b..06ddc57d3 100644
--- a/app/views/admin_user/edit.rhtml
+++ b/app/views/admin_user/edit.rhtml
@@ -1,14 +1,16 @@
+
+
<h1><%=@title%></h1>
-<% form_tag "../update/#{@admin_user.id}", :class => "form form-horizontal" do %>
+<% form_tag '../update/' + @admin_user.id.to_s do %>
<%= render :partial => 'form' %>
- <div class="form-actions">
- <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %>
- </div>
+ <p><%= submit_tag 'Save', :accesskey => 's' %></p>
<% end %>
-<%= link_to 'Show', "../show/#{@admin_user.id}", :class => "btn" %>
-<%= link_to 'List all', '../list', :class => "btn" %>
+<p>
+<%= link_to 'Show', '../show/' + @admin_user.id.to_s %> |
+<%= link_to 'List all', '../list' %>
+</p>
<% if false #@admin_user.info_requests.size == 0 %>
<% form_tag('../destroy/' + @admin_user.id.to_s) do %>
diff --git a/app/views/admin_user/list.rhtml b/app/views/admin_user/list.rhtml
index df3a1b276..9de381ecc 100644
--- a/app/views/admin_user/list.rhtml
+++ b/app/views/admin_user/list.rhtml
@@ -1,11 +1,13 @@
-<% @title = _('Listing users') %>
+<% @title = 'Listing users' %>
<h1><%=@title%></h1>
-<% form_tag("", :method => "get", :class => "form form-search") do %>
- <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query"} %>
- <%= submit_tag "Search", :class => "btn" %> (substring search, names and emails)
- <%= link_to 'Banned users', 'banned', :class => "btn btn-info" %>
+<% form_tag("", :method => "get") do %>
+ <p>
+ <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= submit_tag "Search" %> (substring search, names and emails)
+ <%= link_to 'Banned users', 'banned' %>
+ </p>
<% end %>
<%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %>
diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml
index 372fe23f2..4af79e45a 100644
--- a/app/views/admin_user/show.rhtml
+++ b/app/views/admin_user/show.rhtml
@@ -1,56 +1,42 @@
-<% @title = _("User - {{name}}", :name => h(@admin_user.name)) %>
+<% @title = "User - " + h(@admin_user.name) %>
<h1><%=@title%></h1>
<% if @admin_user.profile_photo %>
- <div class="user_photo_on_admin">
- <% form_tag "../clear_profile_photo/#{@admin_user.id}", :multipart => true, :class => "form" do %>
- <img src="<%= main_url(get_profile_photo_url(:url_name => @admin_user.url_name, :only_path => true)) %>">
- <br>
- <%= submit_tag "Clear photo", :class => "btn btn-info" %>
- <% end %>
- </div>
+ <div class="user_photo_on_admin">
+ <% form_tag '../clear_profile_photo/' + @admin_user.id.to_s, :multipart => true do %>
+ <img src="<%= main_url(get_profile_photo_url(:url_name => @admin_user.url_name, :only_path => true)) %>">
+ <br>
+ <%= submit_tag "Clear photo" %>
+ <% end %>
+ </div>
<% end %>
-<table class="table table-striped">
- <tbody>
- <tr>
- <td>
- <b><%=_("Id")%></b>
- </td>
- <td>
- <%=@admin_user.id%>
- </td>
- </tr>
- <% @admin_user.for_admin_column(:complete => true) do |name, value, type, column_name| %>
- <tr>
- <td>
- <b><%=_(name)%></b>
- </td>
- <td>
- <% if column_name == 'email' %>
- <%=link_to @admin_user.email, "mailto:#{h @admin_user.email}"%>
- <% elsif column_name == 'email_bounce_message' %>
- <% unless @admin_user.email_bounce_message.empty? %>
- <%= link_to _("See bounce message"), "../show_bounce_message/#{@admin_user.id}"%>
- <% end %>
- <% else %>
- <%=h admin_value(value)%>
- <% end %>
- <% if column_name == 'email_bounced_at' && !@admin_user.email_bounced_at.nil? %>
- <% form_tag "../clear_bounce/#{@admin_user.id}", :class => "form form-inline" do %>
- <input type="submit" name="action" value="Clear bounce" class="btn btn-info">
- <% end %>
- <% end %>
- </td>
- </tr>
+
+<div>
+<strong>Id:</strong> <%= @admin_user.id%> <br>
+<% for column in User.content_columns %>
+ <strong><%= column.human_name %>:</strong>
+ <% if column.name == 'email' %>
+ <a href="mailto:<%=h @admin_user.email %>"><%=h @admin_user.email%></a>
+ <% elsif column.name == 'email_bounce_message' %>
+ <% if !@admin_user.email_bounce_message.empty? %>
+ <a href="../show_bounce_message/<%= @admin_user.id.to_s %>">See bounce message</a>
+ <% end %>
+ <% else %>
+ <%=h @admin_user.send(column.name) %>
<% end %>
- </tbody>
-</table>
+ <% if column.name == 'email_bounced_at' && !@admin_user.email_bounced_at.nil? %>
+ <form action="../clear_bounce/<%= @admin_user.id.to_s %>" style="display: inline;"><input type="submit" name="action" value="Clear bounce"></form>
+ <% end %>
+ <br>
+<% end %>
+</div>
-<%= link_to 'Edit', '../edit/' + @admin_user.id.to_s, :class => "btn btn-primary" %>
-<%= link_to 'Public page', main_url(user_url(@admin_user)), :class => "btn" %>
-<%= link_to "Log in as #{@admin_user.name}", "../login_as/#{@admin_user.id}", :class => "btn btn-info" %> <span class="label label-warning">also confirms their email</span>
+<p>
+ <%= link_to 'Public page', main_url(user_url(@admin_user)) %>
+ | <%= link_to 'Edit', '../edit/' + @admin_user.id.to_s %>
+ | <%= link_to 'Log in as this user', '../login_as/' + @admin_user.id.to_s %> (also confirms their email)
</p>
<h2>Track things</h2>
@@ -65,7 +51,7 @@
<th><%= column.human_name %></th>
<% end %>
</tr>
-
+
<% for post_redirect in @admin_user.post_redirects.find(:all, :order => 'created_at desc') %>
<tr class="<%= cycle('odd', 'even') %>">
<td><%=h post_redirect.id %></td>