journalduhacker/app/views/invitations/index.html.erb
joshua stein 9f5e04bbba use _path for most things instead of _url
Instead of hard-coding the scheme and host everywhere, use _path
methods to show relative URLs.

Except that our previous setting of
Rails.application.routes.default_url_options in
config.after_initialize made this moot because Rails inserts that
host into all _path helpers for some reason.  So revert that
setting.

But then anything that wants an absolute URL doesn't know the
hostname and the root_url helper throws an exception.  So make a
Rails.application.root_url shortcut to pass the per-app settings in
Rails.application to root_url.

Now we can just use _path helpers most places but still use _url
ones where we need them, such as in RSS views and e-mail templates.
2015-01-02 17:02:55 -06:00

55 lines
1.7 KiB
Plaintext

<div class="box wide">
<div class="legend">
Requested Invitations
</div>
<p>
These persons have requested invitations and confirmed their e-mail
addresses. If you recognize anyone, feel free to send them an invitation and
remove their request. Spam will be cleared out by a moderator.
</p>
<table class="data" width="100%" cellspacing=0>
<tr>
<th width="15%">Date/Time</th>
<th width="20%">Name</th>
<th width="40%">Memo</th>
<th width="15%"></th>
<% if @user.is_moderator? %>
<th></th>
<% end %>
</tr>
<% bit = 0 %>
<% @invitation_requests.each do |ir| %>
<tr class="row<%= bit %>">
<td><%= ir.created_at.strftime("%Y-%m-%d %H:%M:%S") %></td>
<td><%= ir.name %>
<% if @user.is_moderator? %>
<br>
<em><%= ir.email %></em>
<% end %></td>
<td><%= raw ir.markeddown_memo %></td>
<td><%= form_tag send_invitation_for_request_path do %>
<%= hidden_field_tag "code", ir.code %>
<%= submit_tag "Send Invitation", :data => { :confirm => "Are " <<
"you sure you want to invite this person and remove this request?" } %>
<% end %></td>
<% if @user.is_moderator? %>
<td><%= form_tag delete_invitation_request_path do %>
<%= hidden_field_tag "code", ir.code %>
<%= submit_tag "Delete", :data => { :confirm => "Are you sure " <<
"you want to delete this request?" } %>
<% end %></td>
<% end %>
</tr>
<% bit = (bit == 1 ? 0 : 1) %>
<% end %>
<% if @invitation_requests.count == 0 %>
<tr>
<td colspan=<%= @user.is_moderator?? 5 : 4 %> align="center"><span
class="na">No invitation requests</span></td>
</tr>
<% end %>
</table>
</div>