views
This commit is contained in:
8
app/views/bans/_form.html.erb
Normal file
8
app/views/bans/_form.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<%= simple_form_for(ban) do |f| %>
|
||||
<%= error_messages_for("ban") %>
|
||||
|
||||
<%= f.input :user_name, :as => :string %>
|
||||
<%= f.input :duration, :hint => "in days" %>
|
||||
<%= f.input :reason %>
|
||||
<%= f.button :submit, :value => "Ban" %>
|
||||
<% end %>
|
||||
6
app/views/bans/_secondary_links.html.erb
Normal file
6
app/views/bans/_secondary_links.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Listing", bans_path %></li>
|
||||
<li><%= link_to "Ban", new_ban_path %></li>
|
||||
</menu>
|
||||
<% end %>
|
||||
1
app/views/bans/destroy.js.erb
Normal file
1
app/views/bans/destroy.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#ban-<%= @ban.id %>").remove();
|
||||
8
app/views/bans/edit.html.erb
Normal file
8
app/views/bans/edit.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="bans">
|
||||
<div class="new">
|
||||
<h1>Edit Ban</h1>
|
||||
<%= render "form", :locals => {:ban => @ban} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
29
app/views/bans/index.html.erb
Normal file
29
app/views/bans/index.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="bans">
|
||||
<div class="index">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Expires</th>
|
||||
<th>Reason</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @bans.each do |ban| %>
|
||||
<tr id="ban-<%= ban.id %>">
|
||||
<td><%= ban.user_name %></td>
|
||||
<td><%= ban.expires_at %></td>
|
||||
<td><%= ban.reason %></td>
|
||||
<td>
|
||||
<%= link_to "Edit", edit_ban_path(ban) %>
|
||||
| <%= link_to "Delete", ban_path(ban), :method => :delete, :remote => true %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
8
app/views/bans/new.html.erb
Normal file
8
app/views/bans/new.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="bans">
|
||||
<div class="new">
|
||||
<h1>New Ban</h1>
|
||||
<%= render "form", :locals => {:ban => @ban} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
12
app/views/bans/show.html.erb
Normal file
12
app/views/bans/show.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="bans">
|
||||
<div class="show">
|
||||
<h1>Show Ban</h1>
|
||||
<ul>
|
||||
<li><strong>User</strong>: <%= @ban.user_name %></li>
|
||||
<li><strong>Expires</strong>: <%= @ban.expires_at %></li>
|
||||
<li><strong>Reason</strong>: <%= @ban.reason %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
Reference in New Issue
Block a user