Name changes: format processed requests more nicely.
This commit is contained in:
@@ -55,3 +55,11 @@ table.search {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.aligned-vertical {
|
||||||
|
@extend table.search;
|
||||||
|
|
||||||
|
tr {
|
||||||
|
height: 1.75em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,4 +28,4 @@
|
|||||||
section {
|
section {
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ class UserNameChangeRequest < ActiveRecord::Base
|
|||||||
def approved?
|
def approved?
|
||||||
status == "approved"
|
status == "approved"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pending?
|
||||||
|
status == "pending"
|
||||||
|
end
|
||||||
|
|
||||||
def normalize_name
|
def normalize_name
|
||||||
self.desired_name = desired_name.strip.gsub(/ /, "_")
|
self.desired_name = desired_name.strip.gsub(/ /, "_")
|
||||||
|
|||||||
@@ -1,14 +1,45 @@
|
|||||||
<div id="c-user-name-change-requests">
|
<div id="c-user-name-change-requests">
|
||||||
<h1>Name Change Request</h1>
|
<h1>Name Change Request</h1>
|
||||||
|
|
||||||
<section>
|
<table class="aligned-vertical">
|
||||||
<p><%= @change_request.original_name %> is requesting to change their name to <%= @change_request.desired_name %>.</p>
|
<tbody>
|
||||||
</section>
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
<section>
|
<td>
|
||||||
<h2>Reason</h2>
|
<%= compact_time @change_request.created_at %>
|
||||||
<p><%= @change_request.change_reason %></p>
|
<% if @change_request.updated_at - @change_request.created_at > 5.minutes %>
|
||||||
</section>
|
(updated <%= time_ago_in_words_tagged @change_request.updated_at %>)
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>User</th>
|
||||||
|
<td><%= link_to_user @change_request.user %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Request</th>
|
||||||
|
<td>
|
||||||
|
<strong><%= @change_request.original_name %></strong> ->
|
||||||
|
<strong><%= @change_request.desired_name %></strong>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Reason</th>
|
||||||
|
<td><%= @change_request.change_reason %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Status</th>
|
||||||
|
<td>
|
||||||
|
<%= @change_request.status %>
|
||||||
|
<% if @change_request.approved? %>
|
||||||
|
by <%= link_to_user @change_request.approver %>
|
||||||
|
<% elsif @change_request.rejected? %>
|
||||||
|
for reason: <%= link_to @change_request.rejection_reason %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Feedback</h2>
|
<h2>Feedback</h2>
|
||||||
@@ -16,7 +47,7 @@
|
|||||||
<% @change_request.feedback.each do |feedback| %>
|
<% @change_request.feedback.each do |feedback| %>
|
||||||
<li class="feedback-category-<%= feedback.category %>">
|
<li class="feedback-category-<%= feedback.category %>">
|
||||||
<p><%= feedback.body %></p>
|
<p><%= feedback.body %></p>
|
||||||
<p class="author">Submitted by <%= feedback.creator.name %> <%= time_ago_in_words_tagged feedback.created_at %></p>
|
<p class="author">Submitted by <%= link_to_user feedback.creator.name %> <%= time_ago_in_words_tagged feedback.created_at %></p>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -33,17 +64,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<% if @change_request.rejected? %>
|
<% if @change_request.pending? && CurrentUser.user.is_admin? %>
|
||||||
<section>
|
|
||||||
<h2>Request was rejected</h2>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<% elsif @change_request.approved? && @change_request.approver %>
|
|
||||||
<section>
|
|
||||||
<h2>Request was approved by <%= @change_request.approver.name %></h2>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<% elsif CurrentUser.user.is_admin? %>
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Options</h2>
|
<h2>Options</h2>
|
||||||
<%= form_tag(approve_user_name_change_request_path(@change_request)) do %>
|
<%= form_tag(approve_user_name_change_request_path(@change_request)) do %>
|
||||||
@@ -69,4 +90,3 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user