2019-12-13 18:14:34 +01:00
|
|
|
h1 User Bans
|
|
|
|
|
|
|
|
- route = fn p -> Routes.admin_user_ban_path(@conn, :index, p) end
|
2020-01-01 01:59:14 +01:00
|
|
|
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @user_bans, route: route, params: [q: @conn.params["q"]]
|
2019-12-13 18:14:34 +01:00
|
|
|
|
2019-12-13 20:26:43 +01:00
|
|
|
= form_for :user_ban, Routes.admin_user_ban_path(@conn, :index), [method: "get", class: "hform"], fn f ->
|
|
|
|
.field
|
|
|
|
= text_input f, :q, name: "q", class: "hform__text input", placeholder: "Search"
|
|
|
|
= submit "Search", class: "button hform__button"
|
|
|
|
|
2019-12-13 18:14:34 +01:00
|
|
|
.block
|
|
|
|
.block__header
|
2019-12-13 20:26:43 +01:00
|
|
|
a href=Routes.admin_user_ban_path(@conn, :new)
|
|
|
|
i.fa.fa-plus>
|
|
|
|
' New user ban
|
|
|
|
|
2019-12-13 18:14:34 +01:00
|
|
|
= pagination
|
|
|
|
|
|
|
|
.block__content
|
|
|
|
table.table
|
|
|
|
thead
|
|
|
|
tr
|
|
|
|
th User
|
|
|
|
th Created
|
|
|
|
th Expires
|
|
|
|
th Reason/Note
|
|
|
|
th Ban ID
|
|
|
|
th Options
|
|
|
|
|
|
|
|
tbody
|
|
|
|
= for ban <- @user_bans do
|
|
|
|
tr
|
|
|
|
td
|
|
|
|
= link ban.user.name, to: Routes.profile_path(@conn, :show, ban.user)
|
|
|
|
|
|
|
|
td
|
|
|
|
=> pretty_time ban.created_at
|
|
|
|
= user_abbrv @conn, ban.banning_user
|
|
|
|
|
|
|
|
td class=ban_row_class(ban)
|
|
|
|
= pretty_time ban.valid_until
|
|
|
|
|
|
|
|
td
|
|
|
|
= ban.reason
|
|
|
|
|
|
|
|
= if present?(ban.note) do
|
|
|
|
p.block.block--fixed
|
|
|
|
em
|
|
|
|
' Note:
|
|
|
|
= ban.note
|
|
|
|
|
|
|
|
td
|
|
|
|
= ban.generated_ban_id
|
|
|
|
|
|
|
|
td
|
|
|
|
=> link "Edit", to: Routes.admin_user_ban_path(@conn, :edit, ban)
|
|
|
|
' •
|
|
|
|
=> link "Destroy", to: Routes.admin_user_ban_path(@conn, :delete, ban), data: [confirm: "Are you really, really sure?", method: "delete"]
|
|
|
|
|
|
|
|
.block__header.block__header--light
|
|
|
|
= pagination
|