diff options
Diffstat (limited to 'app/views/admin_user')
-rw-r--r-- | app/views/admin_user/_form.rhtml | 64 | ||||
-rw-r--r-- | app/views/admin_user/_user_table.rhtml | 52 | ||||
-rw-r--r-- | app/views/admin_user/edit.rhtml | 14 | ||||
-rw-r--r-- | app/views/admin_user/list.rhtml | 12 | ||||
-rw-r--r-- | app/views/admin_user/show.rhtml | 78 |
5 files changed, 154 insertions, 66 deletions
diff --git a/app/views/admin_user/_form.rhtml b/app/views/admin_user/_form.rhtml index be69d9a80..bb74ae38f 100644 --- a/app/views/admin_user/_form.rhtml +++ b/app/views/admin_user/_form.rhtml @@ -2,6 +2,7 @@ <!--[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> @@ -25,3 +26,66 @@ <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 d35c78594..16431b7ae 100644 --- a/app/views/admin_user/_user_table.rhtml +++ b/app/views/admin_user/_user_table.rhtml @@ -1,22 +1,36 @@ -<table> - <tr> - <th>Id</th> - <% for column in ['Name', 'Email', 'Created at', 'Updated at', 'Email confirmed', 'Admin'] + (banned_column ? ['Ban text'] : []) %> - <th><%= column %></th> +<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> <% end %> - </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> +</div> -<%= will_paginate(users) %> +<%= will_paginate(users, :class => "paginator") %> diff --git a/app/views/admin_user/edit.rhtml b/app/views/admin_user/edit.rhtml index 06ddc57d3..c3ee3012b 100644 --- a/app/views/admin_user/edit.rhtml +++ b/app/views/admin_user/edit.rhtml @@ -1,16 +1,14 @@ - - <h1><%=@title%></h1> -<% form_tag '../update/' + @admin_user.id.to_s do %> +<% form_tag "../update/#{@admin_user.id}", :class => "form form-horizontal" do %> <%= render :partial => 'form' %> - <p><%= submit_tag 'Save', :accesskey => 's' %></p> + <div class="form-actions"> + <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %> + </div> <% end %> -<p> -<%= link_to 'Show', '../show/' + @admin_user.id.to_s %> | -<%= link_to 'List all', '../list' %> -</p> +<%= link_to 'Show', "../show/#{@admin_user.id}", :class => "btn" %> +<%= link_to 'List all', '../list', :class => "btn" %> <% 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 9de381ecc..df3a1b276 100644 --- a/app/views/admin_user/list.rhtml +++ b/app/views/admin_user/list.rhtml @@ -1,13 +1,11 @@ -<% @title = 'Listing users' %> +<% @title = _('Listing users') %> <h1><%=@title%></h1> -<% 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> +<% 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" %> <% 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 4af79e45a..372fe23f2 100644 --- a/app/views/admin_user/show.rhtml +++ b/app/views/admin_user/show.rhtml @@ -1,42 +1,56 @@ -<% @title = "User - " + h(@admin_user.name) %> +<% @title = _("User - {{name}}", :name => 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.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> + <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> <% end %> - -<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 %> - <% 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> +<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> <% end %> - <br> -<% end %> -</div> + </tbody> +</table> -<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) +<%= 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> <h2>Track things</h2> @@ -51,7 +65,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> |