[deploy] Adding Crayons to Admin (#10015)
* layout * user * config * header * badges, badge_achievements, layout * broadcasts * chat channels * comments.. not much really * Events * growth * listings * mod actions * mods * orgs * pages * permissions * podcasts * reactions * profile fields * reports * response templates * tools * users * Secrets * webhooks * welcome threads * . * internal * css fix * . * main element elsewhere * scope * bring back some of the old styling * . * . * . * notice * Revert schema.db * add alert * little fixes * profile fields * Update schema.rb * closing span * another span * Fixed broken admin specs. Co-authored-by: Nick Taylor <nick@dev.to>
This commit is contained in:
parent
ce9ed24090
commit
8ec4044f3e
69 changed files with 1916 additions and 2040 deletions
|
|
@ -2,7 +2,6 @@
|
|||
//= link_tree ../images
|
||||
//= link_directory ../javascripts .js
|
||||
//= link_directory ../stylesheets .css
|
||||
//= link internal/layout.css
|
||||
//= link s3_direct_upload.js
|
||||
//= link administrate/application.css
|
||||
//= link administrate/application.js
|
||||
|
|
|
|||
63
app/assets/stylesheets/admin.scss
Normal file
63
app/assets/stylesheets/admin.scss
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
@import 'config/import';
|
||||
@import 'crayons';
|
||||
@import 'variables';
|
||||
@import 'scaffolds';
|
||||
@import 'top-bar';
|
||||
|
||||
.pagination {
|
||||
justify-content: right;
|
||||
|
||||
.page,
|
||||
.next,
|
||||
.last,
|
||||
.first,
|
||||
.prev {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-featured {
|
||||
background: #bbffd2;
|
||||
}
|
||||
|
||||
.bg-approved {
|
||||
background: #92e8ae;
|
||||
border: 12px solid #ff9900;
|
||||
}
|
||||
|
||||
.bg-highlighted {
|
||||
background: #2effa8 !important;
|
||||
border: 20px solid black;
|
||||
}
|
||||
|
||||
.border-highlighted {
|
||||
border: 20px solid black;
|
||||
}
|
||||
|
||||
.broadcast-wrapper {
|
||||
display: flex;
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
}
|
||||
|
||||
.site-config__required {
|
||||
background: #dc3545;
|
||||
border-radius: 19px;
|
||||
padding: 5px 15px;
|
||||
color: white;
|
||||
text-align: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.site-config__label {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.profile__group-toggle {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
color: grey;
|
||||
margin: 1em 0;
|
||||
text-align: end;
|
||||
}
|
||||
|
|
@ -24,4 +24,13 @@
|
|||
&--l {
|
||||
font-size: var(--fs-l);
|
||||
}
|
||||
|
||||
&--xl {
|
||||
font-size: var(--fs-xl);
|
||||
}
|
||||
|
||||
&--2xl {
|
||||
font-size: var(--fs-2xl);
|
||||
padding: var(--su-1) var(--su-2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,122 +0,0 @@
|
|||
@import '../crayons';
|
||||
@import '../scaffolds';
|
||||
@import '../variables';
|
||||
|
||||
#siteConfigBodyContainer {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
#siteConfig .card-header {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#siteConfig .card-header__toggle {
|
||||
font-size: 12px;
|
||||
color: var(--secondary);
|
||||
}
|
||||
|
||||
#siteConfig .notice {
|
||||
margin: 20px 0;
|
||||
font-weight: bold;
|
||||
color: $dark-purple;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
justify-content: right;
|
||||
|
||||
.page,
|
||||
.next,
|
||||
.last,
|
||||
.first,
|
||||
.prev {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.buffer-cell {
|
||||
/* Max-width derived from width of a Bootstrap container */
|
||||
max-width: 1140px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.bg-featured {
|
||||
background: #bbffd2;
|
||||
}
|
||||
|
||||
.bg-approved {
|
||||
background: #92e8ae;
|
||||
border: 12px solid #ff9900;
|
||||
}
|
||||
|
||||
.bg-highlighted {
|
||||
background: #2effa8 !important;
|
||||
border: 20px solid black;
|
||||
}
|
||||
|
||||
.border-highlighted {
|
||||
border: 20px solid black;
|
||||
}
|
||||
|
||||
.broadcast-wrapper {
|
||||
display: flex;
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
min-height: 100vh;
|
||||
background: $light-gray;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
align-self: flex-start;
|
||||
max-width: 135px;
|
||||
|
||||
.sidebar-nav-item {
|
||||
display: block;
|
||||
padding: 0.2em;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
background: $light-medium-gray;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-nav-item.active {
|
||||
background: $light-medium-gray;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.site-config__required {
|
||||
background: #dc3545;
|
||||
border-radius: 19px;
|
||||
padding: 5px 15px;
|
||||
color: white;
|
||||
text-align: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.site-config__label {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#profileFields .card-header {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.profile__group-toggle {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
color: grey;
|
||||
margin: 1em 0;
|
||||
text-align: end;
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<% if ENV["BUFFER_ACCESS_TOKEN"].blank? %>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<div class="crayons-notice crayons-notice--info mb-6" role="alert">
|
||||
<p><strong>All references to "Buffering" are legacy and social media functionality is not currently operational.</strong></p>
|
||||
<p>Buffer, the social media scheduling tool, has discontinued its API, so send-to-buffer functionality only works for legacy clients.</p>
|
||||
<p>We will replace this functionality in the future with a functional alternative.</p>
|
||||
</div>
|
||||
<% elsif @user_buffer_updates.any? %>
|
||||
<div class="alert alert-primary">
|
||||
<div class="crayons-notice crayons-notice--success mb-6" role="alert">
|
||||
You have sent <strong><%= @user_buffer_updates.size %></strong> buffers so far in the past 24 hours. Keep it up!
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<div class="crayons-notice crayons-notice--warning mb-6" role="alert">
|
||||
You haven't sent any buffers in the past 24 hours, let's get to work!
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
<main>
|
||||
<h2>Award Badges</h2>
|
||||
<div class="alert alert-warning"><strong>Warning: Usernames are case-sensitive and must be all lowercase! This task will fail silently when supplied with incorrect
|
||||
usernames.<strong></div>
|
||||
<%= form_with(url: admin_badge_achievements_award_badges_path, local: true) do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label :badge, "Badge:" %>
|
||||
<%= f.select("badge", @all_badges.map { |badge| [badge.title, badge.slug] }, include_blank: true, class: "form-control") %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :usernames, "Usernames (Comma Delimited, All Lowercase, No @ Symbol Required In Front Of Usernames)*" %>
|
||||
<%= f.text_area :usernames, placeholder: "username1, username2, username3", required: true, size: "40x10", class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :message_markdown, "Override Default Message (Supports Markdown)" %>
|
||||
<%= f.text_area :message_markdown, size: "40x10", class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Award Badges", class: "btn btn-primary mb-4" %>
|
||||
<%= link_to "Back to Badge Achievements", admin_badge_achievements_path, class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Award Badges</h2>
|
||||
<div class="crayons-card p-6">
|
||||
<div class="crayons-notice crayons-notice--warning mb-6">Warning: Usernames are case-sensitive and must be all lowercase! This task will fail silently when supplied with incorrect usernames.</div>
|
||||
|
||||
<%= form_with(url: admin_badge_achievements_award_badges_path, local: true) do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label :badge, "Badge:" %>
|
||||
<%= f.select("badge", @all_badges.map { |badge| [badge.title, badge.slug] }, include_blank: true, class: "form-control") %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :usernames, "Usernames (Comma Delimited, All Lowercase, No @ Symbol Required In Front Of Usernames)*" %>
|
||||
<%= f.text_area :usernames, placeholder: "username1, username2, username3", required: true, size: "40x10", class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :message_markdown, "Override Default Message (Supports Markdown)" %>
|
||||
<%= f.text_area :message_markdown, size: "40x10", class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Award Badges", class: "btn btn-primary mb-4" %>
|
||||
<%= link_to "Back to Badge Achievements", admin_badge_achievements_path, class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,23 @@
|
|||
<main>
|
||||
<br>
|
||||
<div class="alert alert-warning">
|
||||
<strong>Note: If you remove a badge that is automatically rewarded it will simply be re-awarded despite being removed.</strong>
|
||||
</div>
|
||||
<div class="row m-3">
|
||||
<div class="col">
|
||||
<div class="row justify-content-right">
|
||||
<%= link_to "Award Badge", admin_badge_achievements_award_badges_path, class: "btn btn-primary" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= search_form_for @q, url: admin_badge_achievements_path, class: "form-inline justify-content-end" do |f| %>
|
||||
<div class="alert alert-warning">
|
||||
<strong>Note: If you remove a badge that is automatically rewarded it will simply be re-awarded despite being removed.</strong>
|
||||
</div>
|
||||
|
||||
<%= f.label :user_id_eq, "User ID", class: "sr-only" %>
|
||||
<%= f.search_field :user_id_eq, placeholder: "User ID", class: "form-control mx-3" %>
|
||||
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div>
|
||||
<%= link_to "Award Badge", admin_badge_achievements_award_badges_path, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<table class="table">
|
||||
<div class="ml-auto">
|
||||
<%= search_form_for @q, url: admin_badge_achievements_path, class: "form-inline justify-content-end" do |f| %>
|
||||
|
||||
<%= f.label :user_id_eq, "User ID", class: "sr-only" %>
|
||||
<%= f.search_field :user_id_eq, placeholder: "User ID", class: "form-control mx-3" %>
|
||||
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">User ID</th>
|
||||
|
|
@ -28,7 +26,7 @@
|
|||
<th scope="col">Badge Image</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="crayons-card">
|
||||
<% @badge_achievements.each do |badge_achievement| %>
|
||||
<tr>
|
||||
<td><%= badge_achievement.user.id %></td>
|
||||
|
|
@ -44,4 +42,3 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,34 +1,35 @@
|
|||
<main class="row">
|
||||
<div class="col-12">
|
||||
<h2><%= "Edit Badge #{@badge.id}" %></h2>
|
||||
<%= form_for [:admin, @badge], method: :patch do |form| %>
|
||||
<header class="flex mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl"><%= "Edit Badge #{@badge.id}" %></h2>
|
||||
|
||||
<div class="ml-auto">
|
||||
<%= link_to "Back to All Badges", admin_badges_path, class: "btn btn-primary " %>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<%= form_for [:admin, @badge], method: :patch do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title, class: "form-control" %>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :slug, "Slug:" %>
|
||||
<%= form.text_field :slug, class: "form-control" %>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :description, "Description:" %>
|
||||
<%= form.text_field :description, class: "form-control" %>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :badge_image, "Badge Image:" %>
|
||||
<br>
|
||||
<% if @badge.badge_image %>
|
||||
<img class="mx-auto mt-3" width="60" height="60" src="<%= @badge.badge_image %>" alt="badge image">
|
||||
<img class="mx-auto mt-3" width="60" height="60" src="<%= @badge.badge_image %>" alt="badge image">
|
||||
<% end %>
|
||||
<%= form.file_field :badge_image, class: "form-control" %>
|
||||
<br>
|
||||
</div>
|
||||
<hr>
|
||||
<%= form.submit "Update Badge", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
<%= link_to "Back to All Badges", admin_badges_path, class: "btn btn-primary float-left" %>
|
||||
</div>
|
||||
</main>
|
||||
<%= submit_tag "Update Badge", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,28 +1,29 @@
|
|||
<main>
|
||||
<div class="col">
|
||||
<div class="row justify-content-end">
|
||||
<%= link_to "Create Badge", new_admin_badge_path, class: "btn btn-primary" %>
|
||||
<%= link_to "Award Badge", admin_badge_achievements_award_badges_path, style: "margin-left: 20px;", class: "btn btn-primary" %>
|
||||
</div>
|
||||
<header class="flex mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl">Badges</h2>
|
||||
|
||||
<div class="ml-auto">
|
||||
<%= link_to "Create Badge", new_admin_badge_path, class: "btn btn-primary" %>
|
||||
<%= link_to "Award Badge", admin_badge_achievements_award_badges_path, style: "margin-left: 20px;", class: "btn btn-primary" %>
|
||||
</div>
|
||||
<table class="table mt-2">
|
||||
<thead>
|
||||
</header>
|
||||
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Title</th>
|
||||
<th scope="col">Slug</th>
|
||||
<th scope="col">Badge Image</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @badges.each do |badge| %>
|
||||
<tr>
|
||||
<th scope="col">Title</th>
|
||||
<th scope="col">Slug</th>
|
||||
<th scope="col">Badge Image</th>
|
||||
<td><%= link_to badge.title, edit_admin_badge_path(badge.id) %></td>
|
||||
<td class="justify-content-center"><%= badge.slug %></td>
|
||||
<td class="justify-content-center">
|
||||
<img class="mx-auto mt-3" width="40" height="40" src="<%= badge.badge_image %>" alt="badge image">
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @badges.each do |badge| %>
|
||||
<tr>
|
||||
<td><%= link_to badge.title, edit_admin_badge_path(badge.id) %></td>
|
||||
<td class="justify-content-center"><%= badge.slug %></td>
|
||||
<td class="justify-content-center">
|
||||
<img class="mx-auto mt-3" width="40" height="40" src="<%= badge.badge_image %>" alt="badge image">
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,30 +1,26 @@
|
|||
<main class="row">
|
||||
<div class="col-12">
|
||||
<h2>Create a Badge:</h2>
|
||||
<%= form_for [:admin, @badge], method: :post do |form| %>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Create badge</h2>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<%= form_for [:admin, @badge], method: :post do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title, class: "form-control" %>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :slug, "Slug:" %>
|
||||
<%= form.text_field :slug, class: "form-control" %>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :description, "Description:" %>
|
||||
<%= form.text_field :description, class: "form-control" %>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :badge_image, "Badge Image:" %>
|
||||
<br>
|
||||
<%= form.file_field :badge_image, class: "form-control" %>
|
||||
<br>
|
||||
<%= form.file_field :badge_image, class: "form-control" %>
|
||||
</div>
|
||||
<hr>
|
||||
<%= submit_tag "Create Badge", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
<%= submit_tag "Create Badge", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
<%= label_tag :title, "Title:" %>
|
||||
<%= text_field_tag :title, @broadcast.title %>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<%= label_tag :title, "Title:" %>
|
||||
<%= text_field_tag :title, @broadcast.title, class: "form-control" %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= label_tag :processed_html, "HTML" %>
|
||||
<%= text_area_tag :processed_html, @broadcast.processed_html, size: "100x10", class: "form-control" %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= label_tag :type_of, "Type:" %>
|
||||
<%= select_tag :type_of, options_for_select(%w[Welcome Announcement], selected: @broadcast.type_of) %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= label_tag :banner_style, "Banner Style:" %>
|
||||
<%= select_tag :banner_style, options_for_select(%w[default brand success warning error], selected: @broadcast.banner_style), include_blank: true %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= label_tag :active, "Active:" %>
|
||||
<%= select_tag :active, options_for_select([false, true], selected: @broadcast.active) %>
|
||||
</div>
|
||||
<hr>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<main class="row">
|
||||
<div class="col-12">
|
||||
<h2>Edit broadcast:</h2>
|
||||
<%= form_for([:admin, @broadcast], method: :patch) do %>
|
||||
<%= render "form" %>
|
||||
<%= submit_tag "Update Broadcast", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Edit broadcast:</h2>
|
||||
<div class="crayons-card p-6">
|
||||
<%= form_for([:admin, @broadcast], method: :patch) do %>
|
||||
<%= render "form" %>
|
||||
<%= submit_tag "Update broadcast", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,36 +1,34 @@
|
|||
<nav class="row my-3" aria-label="Broadcasts navigation">
|
||||
<div class="col">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "All", admin_broadcasts_path, class: "nav-link #{'active' if params[:type_of].blank?}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Announcement", admin_broadcasts_path(type_of: :announcement), class: "nav-link #{'active' if params[:type_of] == 'announcement'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Welcome", admin_broadcasts_path(type_of: :welcome), class: "nav-link #{'active' if params[:type_of] == 'welcome'}" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row justify-content-end">
|
||||
<nav class="flex mb-4" aria-label="Broadcasts navigation">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "All", admin_broadcasts_path, class: "nav-link #{'active' if params[:type_of].blank?}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Announcement", admin_broadcasts_path(type_of: :announcement), class: "nav-link #{'active' if params[:type_of] == 'announcement'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Welcome", admin_broadcasts_path(type_of: :welcome), class: "nav-link #{'active' if params[:type_of] == 'welcome'}" %>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="ml-auto">
|
||||
<div class="justify-content-end">
|
||||
<%= link_to "Make A New Broadcast", new_admin_broadcast_path, class: "btn btn-primary" %>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<div class="alert alert-warning">
|
||||
<div class="crayons-card p-6 grid gap-6">
|
||||
<div class="crayons-notice crayons-notice--warning">
|
||||
<strong>Note: You must ensure that your Broadcast is active in order for it to be sent to users!</strong>
|
||||
</div>
|
||||
<table class="table">
|
||||
<table class="crayons-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Title</th>
|
||||
<th scope="col">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="crayons-card">
|
||||
<% @broadcasts.each do |broadcast| %>
|
||||
<tr>
|
||||
<td><%= link_to broadcast.title, admin_broadcast_path(broadcast.id) %></td>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<main class="row">
|
||||
<div class="col-12">
|
||||
<h2>Make a new broadcast:</h2>
|
||||
<%= form_for([:admin, @broadcast], method: :post) do %>
|
||||
<%= render "form" %>
|
||||
<%= submit_tag "Create Broadcast", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Make a new broadcast:</h2>
|
||||
<div class="crayons-card p-6">
|
||||
<%= form_for([:admin, @broadcast], method: :post) do %>
|
||||
<%= render "form" %>
|
||||
<%= submit_tag "Create broadcast", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,39 +1,47 @@
|
|||
<main class="row my-3">
|
||||
<div class="col">
|
||||
<div class="list-group-flush w-100">
|
||||
<a class="list-group-item flex-column align-items-start">
|
||||
<h3 class="mb-2">Title: <%= @broadcast.title %></h3>
|
||||
<h3>Broadcast Type: <%= @broadcast.type_of %></h3>
|
||||
<h3>Content:</h3>
|
||||
<p>
|
||||
<%= @broadcast.processed_html %>
|
||||
</p>
|
||||
<h3>Last Active On: <%= @broadcast.active_status_updated_at&.strftime("%b %d, %Y %H:%M UTC") %></h3>
|
||||
<h3>Status:</h3>
|
||||
<h3>
|
||||
<header class="flex">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6"><%= @broadcast.title %></h2>
|
||||
<div class="ml-auto">
|
||||
<%= link_to "Destroy", url_for(action: :destroy, id: @broadcast.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
|
||||
<%= link_to "Edit", edit_admin_broadcast_path, class: "btn btn-primary" %>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="crayons-card p-6 grid gap-4 mb-6">
|
||||
<div>
|
||||
<p class="fw-bold">Type</p>
|
||||
<p><%= @broadcast.type_of %></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="fw-bold">Content</p>
|
||||
<p><%= @broadcast.processed_html %></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="fw-bold">Last active</p>
|
||||
<p><%= @broadcast.active_status_updated_at&.strftime("%b %d, %Y %H:%M UTC") %></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="fw-bold">Status</p>
|
||||
<p>
|
||||
<span class="badge badge-<%= @broadcast.active? ? "success" : "warning" %>">
|
||||
<%= @broadcast.active? ? "Active" : "Inactive" %>
|
||||
</span>
|
||||
<span class="sr-only">Broadcast Status</span>
|
||||
</h3>
|
||||
</a>
|
||||
<hr>
|
||||
<% if @broadcast.processed_html %>
|
||||
<div>
|
||||
<p><strong>Preview</strong></p>
|
||||
<div class="broadcast-wrapper visible <%= banner_class(@broadcast) %>">
|
||||
<div class="broadcast-data">
|
||||
<%= sanitize @broadcast.processed_html, attributes: %w[href style src] %>
|
||||
</div>
|
||||
</div>
|
||||
<p><em>Please note: announcement broadcasts will render directly below the nav bar once activated.</em></p>
|
||||
<div>
|
||||
<% end %>
|
||||
<hr>
|
||||
<%= link_to "Destroy Broadcast", url_for(action: :destroy, id: @broadcast.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
|
||||
<%= link_to "Edit Broadcast", edit_admin_broadcast_path, class: "btn btn-primary float-right" %>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<% if @broadcast.processed_html %>
|
||||
<div class="crayons-card p-6">
|
||||
<p><strong>Preview</strong></p>
|
||||
<div class="broadcast-wrapper visible <%= banner_class(@broadcast) %>">
|
||||
<div class="broadcast-data">
|
||||
<%= sanitize @broadcast.processed_html, attributes: %w[href style src] %>
|
||||
</div>
|
||||
</div>
|
||||
<p><em>Please note: announcement broadcasts will render directly below the nav bar once activated.</em></p>
|
||||
<div>
|
||||
<% end %>
|
||||
|
||||
<%= csrf_meta_tags %>
|
||||
|
|
|
|||
|
|
@ -1,43 +1,31 @@
|
|||
<nav class="row">
|
||||
<div class="col-12">
|
||||
<h2>Create New Connect Channel</h2>
|
||||
</div>
|
||||
|
||||
<div class="row m-3">
|
||||
<div class="col">
|
||||
<%= form_for [:admin, ChatChannel.new], html: { class: "inline-form" } do |f| %>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<%= f.label :channel_name, "Channel Name", class: "sr-only" %>
|
||||
<%= f.text_field :channel_name, placeholder: "Channel Name", required: true %>
|
||||
<%= f.label :usernames_string, "Usernames", class: "sr-only" %>
|
||||
<%= f.text_field :usernames_string, placeholder: "Usernames to add" %>
|
||||
<%= f.submit "Create Chat Channel", class: "btn btn-secondary p-1" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="crayons-card p-6 mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Create Channel</h2>
|
||||
<%= form_for [:admin, ChatChannel.new], html: { class: "inline-form" } do |f| %>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<%= f.label :channel_name, "Channel Name", class: "sr-only" %>
|
||||
<%= f.text_field :channel_name, placeholder: "Channel Name", required: true %>
|
||||
<%= f.label :usernames_string, "Usernames", class: "sr-only" %>
|
||||
<%= f.text_field :usernames_string, placeholder: "Usernames to add" %>
|
||||
<%= f.submit "Create Chat Channel", class: "btn btn-secondary p-1" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<h2>Group Connect Channels</h2>
|
||||
|
||||
<div class="row m-3">
|
||||
<div class="col">
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= search_form_for @q, url: admin_chat_channels_path, class: "form-inline justify-content-end" do |f| %>
|
||||
<%= f.label :channel_name_cont, "Channel Name", class: "sr-only" %>
|
||||
<%= f.search_field :channel_name_cont, placeholder: "Channel Name", class: "form-control mx-3" %>
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="crayons-card p-6">
|
||||
<header class="flex mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Channels</h2>
|
||||
<%= search_form_for @q, url: admin_chat_channels_path, class: "form-inline ml-auto" do |f| %>
|
||||
<%= f.label :channel_name_cont, "Channel Name", class: "sr-only" %>
|
||||
<%= f.search_field :channel_name_cont, placeholder: "Channel Name", class: "form-control mx-3" %>
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</header>
|
||||
|
||||
<%= paginate @group_chat_channels %>
|
||||
|
||||
<table class="table">
|
||||
<table class="crayons-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Channel Name</th>
|
||||
|
|
@ -45,39 +33,39 @@
|
|||
<th scope="col">Add Users</th>
|
||||
<th scope="col">Remove User</th>
|
||||
<% if current_user.any_admin? %>
|
||||
<th scope="th">Delete Channel</th>
|
||||
<th scope="col">Delete Channel</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="crayons-card">
|
||||
<% @group_chat_channels.each do |channel| %>
|
||||
<tr>
|
||||
<td><a href="/connect/<%= channel.slug %>" target="_blank" rel="noopener"><%= channel.channel_name %></td>
|
||||
<td><%= channel.users.pluck(:username).join(", ") %></td>
|
||||
<td>
|
||||
<%= form_for [:admin, channel] do |f| %>
|
||||
<%= f.text_field :usernames_string, placeholder: "Usernames to add" %>
|
||||
<%= f.submit "Add users", class: "btn btn-secondary p-1 my-1" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= form_with url: remove_user_admin_chat_channel_url(channel), model: [:admin, channel], method: :delete, local: true do |f| %>
|
||||
<%= f.text_field :username_string, placeholder: "Username to remove" %>
|
||||
<%= f.submit "Remove user", data: { confirm: "Are you sure you want to remove this user?" }, class: "btn btn-secondary p-1 my-1" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% if current_user.any_admin? %>
|
||||
<td>
|
||||
<% if channel.users.count.zero? %>
|
||||
<%= button_to "Delete Channel", { action: "destroy", id: channel.id }, method: :delete, data: { confirm: "Are you sure?" }, class: "crayons-btn crayons-btn--danger" %>
|
||||
<% else %>
|
||||
Cannot delete a channel with users
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= channel.users.pluck(:username).join(", ") %></td>
|
||||
<td>
|
||||
<%= form_for [:admin, channel] do |f| %>
|
||||
<%= f.text_field :usernames_string, placeholder: "Usernames to add" %>
|
||||
<%= f.submit "Add users", class: "btn btn-secondary p-1 my-1" %>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= paginate @group_chat_channels %>
|
||||
</main>
|
||||
</td>
|
||||
<td>
|
||||
<%= form_with url: remove_user_admin_chat_channel_url(channel), model: [:admin, channel], method: :delete, local: true do |f| %>
|
||||
<%= f.text_field :username_string, placeholder: "Username to remove" %>
|
||||
<%= f.submit "Remove user", data: { confirm: "Are you sure you want to remove this user?" }, class: "btn btn-secondary p-1 my-1" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% if current_user.any_admin? %>
|
||||
<td>
|
||||
<% if channel.users.count.zero? %>
|
||||
<%= button_to "Delete Channel", { action: "destroy", id: channel.id }, method: :delete, data: { confirm: "Are you sure?" }, class: "crayons-btn crayons-btn--danger" %>
|
||||
<% else %>
|
||||
Cannot delete a channel with users
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= paginate @group_chat_channels %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,59 +1,57 @@
|
|||
<main>
|
||||
<%= paginate @comments %>
|
||||
<%= paginate @comments %>
|
||||
|
||||
<% @comments.each do |comment| %>
|
||||
<div class="row my-3">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<% if comment.commentable %>
|
||||
<a href="<%= comment.commentable.path %>">re: <%= comment.commentable.title %></a> (<%= comment.public_reactions_count %> ❤️)
|
||||
<% @comments.each do |comment| %>
|
||||
<div class="row my-3">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<% if comment.commentable %>
|
||||
<a href="<%= comment.commentable.path %>">re: <%= comment.commentable.title %></a> (<%= comment.public_reactions_count %> ❤️)
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text">
|
||||
<%= sanitize comment.processed_html,
|
||||
tags: %w[strong em p h1 h2 h3 h4 h5 h6 i u b code pre br ul ol li small sup img a span hr blockquote],
|
||||
attributes: %w[href strong em ref rel src title alt class] %>
|
||||
|
||||
</p>
|
||||
<h5 class="card-title text-center">
|
||||
<% if comment.user %>
|
||||
<a href="<%= comment.user.path %>" target="_blank" rel="noopener">
|
||||
<img class="rounded" height="30" src="<%= ProfileImage.new(comment.user).get(width: 50) %>" alt="<%= comment.user.username %> profile" /> <%= comment.user.username %>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text">
|
||||
<%= sanitize comment.processed_html,
|
||||
tags: %w[strong em p h1 h2 h3 h4 h5 h6 i u b code pre br ul ol li small sup img a span hr blockquote],
|
||||
attributes: %w[href strong em ref rel src title alt class] %>
|
||||
|
||||
</p>
|
||||
<h5 class="card-title text-center">
|
||||
<% if comment.user %>
|
||||
<a href="<%= comment.user.path %>" target="_blank" rel="noopener">
|
||||
<img class="rounded" height="30" src="<%= ProfileImage.new(comment.user).get(width: 50) %>" alt="<%= comment.user.username %> profile" /> <%= comment.user.username %>
|
||||
</a>
|
||||
<% if comment.user && comment.user.twitter_username.present? %>
|
||||
|
|
||||
<a href="https://twitter.com/<%= comment.user.twitter_username %>">
|
||||
<i class="fa fa-twitter" aria-hidden="true"></i> @<%= comment.user.twitter_username %>
|
||||
</a>
|
||||
<% end %>
|
||||
</h5>
|
||||
<div class="mt-3 d-flex justify-content-end">
|
||||
<a class="btn btn-primary" href="<%= comment.path %>" target="_blank" rel="noopener">View</a>
|
||||
<% if comment.reactions.where(user_id: current_user.id).empty? %>
|
||||
<%= form_tag(reactions_path, remote: true, class: "d-inline ml-2") do %>
|
||||
<%= hidden_field_tag(:reactable_type, "Comment") %>
|
||||
<%= hidden_field_tag(:reactable_id, comment.id) %>
|
||||
<button class="btn btn-danger">❤️ Like</button>
|
||||
<% end %>
|
||||
<% if comment.user && comment.user.twitter_username.present? %>
|
||||
|
|
||||
<a href="https://twitter.com/<%= comment.user.twitter_username %>">
|
||||
<i class="fa fa-twitter" aria-hidden="true"></i> @<%= comment.user.twitter_username %>
|
||||
</a>
|
||||
<% end %>
|
||||
</h5>
|
||||
<div class="mt-3 d-flex justify-content-end">
|
||||
<a class="btn btn-primary" href="<%= comment.path %>" target="_blank" rel="noopener">View</a>
|
||||
<% if comment.reactions.where(user_id: current_user.id).empty? %>
|
||||
<%= form_tag(reactions_path, remote: true, class: "d-inline ml-2") do %>
|
||||
<%= hidden_field_tag(:reactable_type, "Comment") %>
|
||||
<%= hidden_field_tag(:reactable_id, comment.id) %>
|
||||
<button class="btn btn-danger">❤️ Like</button>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= paginate @comments %>
|
||||
<%= paginate @comments %>
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
$("form").submit(function (e) {
|
||||
$(this).toggleClass("d-none");
|
||||
$(this).toggleClass("d-inline");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</main>
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
$("form").submit(function (e) {
|
||||
$(this).toggleClass("d-none");
|
||||
$(this).toggleClass("d-inline");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<div
|
||||
class="card-header"
|
||||
class="card-header flex items-center"
|
||||
data-toggle="<%= state %>"
|
||||
data-target="#<%= target %>"
|
||||
aria-expanded="<%= expanded %>"
|
||||
aria-controls="<%= target %>">
|
||||
<span><%= header %></span>
|
||||
<div class="card-header__toggle float-right">
|
||||
<h6 class="mb-0"><%= header %></h6>
|
||||
<button type="button" class="card-header__toggle btn btn-secondary ml-auto">
|
||||
Toggle
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,92 +1,92 @@
|
|||
<div class="alert alert-warning" role="alert">
|
||||
<p>
|
||||
Only admins with explicit <strong>single resource admin</strong> role may make changes to site config. Even super admins require this permission.
|
||||
</p>
|
||||
<h2>
|
||||
<% if current_user.has_role?(:single_resource_admin, Config) %>
|
||||
<div class="alert alert-primary">You have permission to make config changes. Do so with care.</div>
|
||||
<% else %>
|
||||
You do not have permission to make config changes. (Read Only)
|
||||
<% end %>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="grid gap-6">
|
||||
<div class="crayons-notice crayons-notice--info" role="alert">
|
||||
<p class="mb-1">
|
||||
Only admins with explicit <strong>single resource admin</strong> role may make changes to site config. Even super admins require this permission.
|
||||
</p>
|
||||
<% if current_user.has_role?(:single_resource_admin, Config) %>
|
||||
<p class="fw-bold">You have permission to make config changes. Do so with care.</p>
|
||||
<% else %>
|
||||
<p>You do not have permission to make config changes. (Read Only)</p>
|
||||
<% end %>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="row my-3" id="getStarted">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="getStartedHeader" data-toggle="collapse"
|
||||
data-target="#getStartedBodyContainer" aria-expanded="true" aria-controls="getStartedBodyContainer">
|
||||
<h2 class="d-inline">Get Started</h2>
|
||||
<button class="btn btn-secondary float-right" type="button">
|
||||
Toggle Get Started
|
||||
</button>
|
||||
</div>
|
||||
<div id="getStarted">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="getStartedHeader" data-toggle="collapse"
|
||||
data-target="#getStartedBodyContainer" aria-expanded="true" aria-controls="getStartedBodyContainer">
|
||||
<h2 class="d-inline">Get Started</h2>
|
||||
<button class="btn btn-secondary float-right" type="button">
|
||||
Toggle Get Started
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="getStartedBodyContainer" class="<%= VerifySetupCompleted.setup_completed? ? "hide collapse" : "show expand" %> p-3" aria-labelledby="siteConfigHeader">
|
||||
<%= form_for(SiteConfig.new, url: admin_config_path) do |f| %>
|
||||
<div id="getStartedBodyContainer" class="<%= VerifySetupCompleted.setup_completed? ? "hide collapse" : "show expand" %> p-3" aria-labelledby="siteConfigHeader">
|
||||
<%= form_for(SiteConfig.new, url: admin_config_path) do |f| %>
|
||||
|
||||
<% VerifySetupCompleted::MANDATORY_CONFIGS.each do |config_key| %>
|
||||
<!-- we need to list the config as separate fields if the data structure is a Hash -->
|
||||
<% if SiteConfig.public_send(config_key).is_a?(Hash) %>
|
||||
<%= admin_config_label config_key.to_s %>
|
||||
<div class="form-group">
|
||||
<%= f.fields_for config_key do |a_field| %>
|
||||
<% SiteConfig.public_send(config_key).each do |key, value| %>
|
||||
<div>
|
||||
<%= admin_config_label key.to_s %>
|
||||
<%= a_field.text_field key,
|
||||
class: "form-control",
|
||||
value: SiteConfig.public_send(config_key)[key],
|
||||
placeholder: Constants::SiteConfig::DETAILS[config_key][:placeholder] %>
|
||||
<div class="alert alert-info"><%= "#{key} #{config_key.to_s.tr! '_', ' '}" %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% elsif SiteConfig.public_send(config_key).is_a?(Array) %>
|
||||
<div class="form-group">
|
||||
<%= admin_config_label config_key %>
|
||||
<%= f.text_field config_key,
|
||||
class: "form-control",
|
||||
value: SiteConfig.public_send(config_key).join(","),
|
||||
placeholder: Constants::SiteConfig::DETAILS[config_key][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[config_key][:description] %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="form-group">
|
||||
<%= admin_config_label config_key %>
|
||||
<%= f.text_field config_key,
|
||||
class: "form-control",
|
||||
value: SiteConfig.public_send(config_key),
|
||||
placeholder: Constants::SiteConfig::DETAILS[config_key][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[config_key][:description] %></div>
|
||||
</div>
|
||||
<% VerifySetupCompleted::MANDATORY_CONFIGS.each do |config_key| %>
|
||||
<!-- we need to list the config as separate fields if the data structure is a Hash -->
|
||||
<% if SiteConfig.public_send(config_key).is_a?(Hash) %>
|
||||
<%= admin_config_label config_key.to_s %>
|
||||
<div class="form-group">
|
||||
<%= f.fields_for config_key do |a_field| %>
|
||||
<% SiteConfig.public_send(config_key).each do |key, value| %>
|
||||
<div>
|
||||
<%= admin_config_label key.to_s %>
|
||||
<%= a_field.text_field key,
|
||||
class: "form-control",
|
||||
value: SiteConfig.public_send(config_key)[key],
|
||||
placeholder: Constants::SiteConfig::DETAILS[config_key][:placeholder] %>
|
||||
<div class="alert alert-info"><%= "#{key} #{config_key.to_s.tr! '_', ' '}" %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% elsif SiteConfig.public_send(config_key).is_a?(Array) %>
|
||||
<div class="form-group">
|
||||
<%= admin_config_label config_key %>
|
||||
<%= f.text_field config_key,
|
||||
class: "form-control",
|
||||
value: SiteConfig.public_send(config_key).join(","),
|
||||
placeholder: Constants::SiteConfig::DETAILS[config_key][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[config_key][:description] %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="form-group">
|
||||
<%= admin_config_label config_key %>
|
||||
<%= f.text_field config_key,
|
||||
class: "form-control",
|
||||
value: SiteConfig.public_send(config_key),
|
||||
placeholder: Constants::SiteConfig::DETAILS[config_key][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[config_key][:description] %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if current_user.has_role?(:single_resource_admin, Config) %>
|
||||
<div class="form-group">
|
||||
<%= label_tag "Please type out the sentence below to submit:" %>
|
||||
<%= text_field_tag :confirmation, nil, class: "form-control", placeholder: "Confirmation text", autocomplete: "off", required: true, pattern: @confirmation_text %>
|
||||
<div class="alert alert-info">Type the sentence: <%= @confirmation_text %></div>
|
||||
<%= f.submit "Update Site Configuration", class: "btn btn-danger btn-lg" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if current_user.has_role?(:single_resource_admin, Config) %>
|
||||
<div class="form-group">
|
||||
<%= label_tag "Please type out the sentence below to submit:" %>
|
||||
<%= text_field_tag :confirmation, nil, class: "form-control", placeholder: "Confirmation text", autocomplete: "off", required: true, pattern: @confirmation_text %>
|
||||
<div class="alert alert-info">Type the sentence: <%= @confirmation_text %></div>
|
||||
<%= f.submit "Update Site Configuration", class: "btn btn-danger btn-lg" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-3" id="siteConfig">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="siteConfigHeader" data-toggle="collapse"
|
||||
data-target="#siteConfigBodyContainer" aria-expanded="false" aria-controls="siteConfigBodyContainer">
|
||||
<h2 class="d-inline">All Site Configuration</h2>
|
||||
<button class="btn btn-secondary float-right" type="button">
|
||||
Toggle Site Configuration
|
||||
</button>
|
||||
</div>
|
||||
<div id="siteConfigBodyContainer" class="collapse hide hide p-3" aria-labelledby="siteConfigHeader">
|
||||
<%= form_for(SiteConfig.new, url: admin_config_path) do |f| %>
|
||||
<div id="siteConfig">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="siteConfigHeader" data-toggle="collapse"
|
||||
data-target="#siteConfigBodyContainer" aria-expanded="false" aria-controls="siteConfigBodyContainer">
|
||||
<h2 class="d-inline">All Site Configuration</h2>
|
||||
<button class="btn btn-secondary float-right" type="button">
|
||||
Toggle Site Configuration
|
||||
</button>
|
||||
</div>
|
||||
<div id="siteConfigBodyContainer" class="collapse hide hide p-3" aria-labelledby="siteConfigHeader">
|
||||
<%= form_for(SiteConfig.new, url: admin_config_path) do |f| %>
|
||||
|
||||
<div class="card mt-3">
|
||||
<%= render partial: "card_header",
|
||||
|
|
@ -135,7 +135,7 @@
|
|||
class: "form-control selectpicker" %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:authentication_providers][:description] %></div>
|
||||
</div>
|
||||
<div class="notice">
|
||||
<div class="crayons-notice crayons-notice--info mb-4">
|
||||
Notice: Changing authentication keys will not take affect until devops restarts the app (about once per day). This will soon be instant.
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -978,12 +978,11 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if current_user.has_role?(:single_resource_admin, Config) && current_user.has_role?(:super_admin) %>
|
||||
<div class="row my-3" id="siteConfig">
|
||||
<% if current_user.has_role?(:single_resource_admin, Config) && current_user.has_role?(:super_admin) %>
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="appConfigHeader" data-toggle="collapse"
|
||||
data-target="#appConfigBodyContainer" aria-expanded="false" aria-controls="appConfigBodyContainer">
|
||||
|
|
@ -996,8 +995,8 @@
|
|||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
<th>Value</th>
|
||||
<th scope="col">Variable</th>
|
||||
<th scope="col">Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -1011,5 +1010,6 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
<hr>
|
||||
<div class="form-group">
|
||||
<%= f.label :cover_image %>:
|
||||
<%= f.file_field :cover_image, class: "form-control" %>
|
||||
|
|
@ -48,4 +47,4 @@
|
|||
<%= f.label :live_now %>
|
||||
<%= f.check_box :live_now %>
|
||||
</div>
|
||||
<%= f.submit class: "btn btn-primary float-right my-3" %>
|
||||
<%= f.submit class: "btn btn-primary" %>
|
||||
|
|
|
|||
|
|
@ -1,32 +1,31 @@
|
|||
<main class="row">
|
||||
<div class="col-12">
|
||||
<h2>Create New Event</h2>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<%= form_for @event, url: { controller: "events", action: "create" } do |f| %>
|
||||
<%= render "event_form", f: f, event: @event %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<h2> Upcoming Events </h2>
|
||||
<% @events.each do |event| %>
|
||||
<% if event.starts_at.future? %>
|
||||
<img src="<%= event.cover_image_url %>" alt="event cover image">
|
||||
<%= form_for [:admin, event] do |f| %>
|
||||
<%= render "event_form", f: f, event: event %>
|
||||
<% end %>
|
||||
<div class="crayons-card p-6 mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Create New Event</h2>
|
||||
|
||||
<%= form_for @event, url: { controller: "events", action: "create" } do |f| %>
|
||||
<%= render "event_form", f: f, event: @event %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="crayons-card p-6 mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Upcoming Events</h2>
|
||||
<% @events.each do |event| %>
|
||||
<% if event.starts_at.future? %>
|
||||
<img src="<%= event.cover_image_url %>" alt="event cover image">
|
||||
<%= form_for [:admin, event] do |f| %>
|
||||
<%= render "event_form", f: f, event: event %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<h2> Past Events </h2>
|
||||
<% @events.each do |event| %>
|
||||
<% if !event.starts_at.future? %>
|
||||
<img src="<%= event.cover_image_url %>" alt="event cover image">
|
||||
<%= form_for [:admin, event] do |f| %>
|
||||
<%= render "event_form", f: f, event: event %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="crayons-card p-6 mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Past Events</h2>
|
||||
<% @events.each do |event| %>
|
||||
<% if !event.starts_at.future? %>
|
||||
<img src="<%= event.cover_image_url %>" alt="event cover image">
|
||||
<%= form_for [:admin, event] do |f| %>
|
||||
<%= render "event_form", f: f, event: event %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,101 +1,98 @@
|
|||
<h2>Abuse Reports</h2>
|
||||
<div>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-4">Abuse reports</h2>
|
||||
<ul class="nav nav-pills mb-4">
|
||||
<li class="nav-item">
|
||||
<a href="<%= admin_reports_path(state: @feedback_type, status: "Open") %>" class="nav-link <%= "active" if @status == "Open" %>">Open/Unresolved</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="<%= admin_reports_path(state: @feedback_type, status: "Resolved") %>" class="nav-link <%= "active" if @status == "Resolved" %>">Resolved</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="<%= admin_reports_path(state: @feedback_type, status: "Invalid") %>" class="nav-link <%= "active" if @status == "Invalid" %>">Invalid</a>
|
||||
</ul>
|
||||
|
||||
<div class="row my-3">
|
||||
<div class="col">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<a href="<%= admin_reports_path(state: @feedback_type, status: "Open") %>" class="nav-link <%= "active" if @status == "Open" %>">Open/Unresolved</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="<%= admin_reports_path(state: @feedback_type, status: "Resolved") %>" class="nav-link <%= "active" if @status == "Resolved" %>">Resolved</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="<%= admin_reports_path(state: @feedback_type, status: "Invalid") %>" class="nav-link <%= "active" if @status == "Invalid" %>">Invalid</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-3" id="vomitReactions">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="vomitReactionsHeader">
|
||||
<h2 class="d-inline">Vomit Reactions</h2>
|
||||
<button class="btn btn-secondary float-right" type="button" data-toggle="collapse" data-target="#vomitReactionsBodyContainer" aria-expanded="false" aria-controls="vomitReactionsBodyContainer">
|
||||
Toggle
|
||||
</button>
|
||||
</div>
|
||||
<div id="vomitReactionsBodyContainer" class="collapse hide" aria-labelledby="vomitReactionsHeader" data-parent="#vomitReactions">
|
||||
<div class="card-body" style="overflow: scroll; max-height: 500px;">
|
||||
<% @vomits.each do |reaction| %>
|
||||
<% next if (reaction.reactable_type == "Article" && !reaction.reactable.published) || (reaction.reactable_type == "User" && reaction.reactable&.banished?) %>
|
||||
<div class="d-flex justify-content-between" data-controller="reaction" data-reaction-id="<%= reaction.id %>">
|
||||
<span>
|
||||
🤢 <a href="<%= reaction.user.path %>">@<%= reaction.user.username %></a>
|
||||
</span>
|
||||
<span>
|
||||
<strong><%= reaction.reactable_type %>:</strong>
|
||||
<a href="<%= reaction.reactable.path %>"><%= reaction.reactable_type == "User" ? reaction.reactable.username : reaction.reactable.title %></a>
|
||||
<% if reaction.reactable_type == "User" && reaction.reactable.banned %>
|
||||
<span class="badge badge-danger">Suspended</span>
|
||||
<% end %>
|
||||
<% if reaction.reactable_type == "User" && reaction.reactable.vomitted_on? %>
|
||||
<span class="badge badge-warning">Vomitted</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<span>
|
||||
<% if params[:status] == "Open" || params[:status].blank? %>
|
||||
<% if reaction.reactable_type == "User" %>
|
||||
<div id="vomitReactions">
|
||||
<div class="crayons-card">
|
||||
<div class="card-header flex items-center" id="vomitReactionsHeader">
|
||||
<h4>Vomit Reactions</h4>
|
||||
<button class="btn btn-secondary ml-auto" type="button" data-toggle="collapse" data-target="#vomitReactionsBodyContainer" aria-expanded="false" aria-controls="vomitReactionsBodyContainer">
|
||||
Toggle
|
||||
</button>
|
||||
</div>
|
||||
<div id="vomitReactionsBodyContainer" class="collapse hide" aria-labelledby="vomitReactionsHeader" data-parent="#vomitReactions">
|
||||
<div class="card-body" style="overflow: scroll; max-height: 500px;">
|
||||
<% @vomits.each do |reaction| %>
|
||||
<% next if (reaction.reactable_type == "Article" && !reaction.reactable.published) || (reaction.reactable_type == "User" && reaction.reactable&.banished?) %>
|
||||
<div class="d-flex justify-content-between" data-controller="reaction" data-reaction-id="<%= reaction.id %>">
|
||||
<span>
|
||||
🤢 <a href="<%= reaction.user.path %>">@<%= reaction.user.username %></a>
|
||||
</span>
|
||||
<span>
|
||||
<strong><%= reaction.reactable_type %>:</strong>
|
||||
<a href="<%= reaction.reactable.path %>"><%= reaction.reactable_type == "User" ? reaction.reactable.username : reaction.reactable.title %></a>
|
||||
<% if reaction.reactable_type == "User" && reaction.reactable.banned %>
|
||||
<span class="badge badge-danger">Suspended</span>
|
||||
<% end %>
|
||||
<% if reaction.reactable_type == "User" && reaction.reactable.vomitted_on? %>
|
||||
<span class="badge badge-warning">Vomitted</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<span>
|
||||
<% if params[:status] == "Open" || params[:status].blank? %>
|
||||
<% if reaction.reactable_type == "User" %>
|
||||
<button
|
||||
class="btn btn-success btn-sm"
|
||||
type="button"
|
||||
data-reactable="user"
|
||||
data-status="confirmed"
|
||||
data-target="reaction.confirmed"
|
||||
data-action="reaction#reactableUserCheck">
|
||||
CONFIRM
|
||||
</button>
|
||||
<% else %>
|
||||
<button
|
||||
class="btn btn-success btn-sm"
|
||||
type="button"
|
||||
data-reactable="non-user"
|
||||
data-status="confirmed"
|
||||
data-target="reaction.confirmed"
|
||||
data-action="reaction#reactableUserCheck">
|
||||
CONFIRM
|
||||
</button>
|
||||
<% end %>
|
||||
<button
|
||||
class="btn btn-success btn-sm"
|
||||
class="btn btn-danger btn-sm"
|
||||
type="button"
|
||||
data-reactable="user"
|
||||
data-status="confirmed"
|
||||
data-target="reaction.confirmed"
|
||||
data-action="reaction#reactableUserCheck">
|
||||
CONFIRM
|
||||
</button>
|
||||
<% else %>
|
||||
<button
|
||||
class="btn btn-success btn-sm"
|
||||
type="button"
|
||||
data-reactable="non-user"
|
||||
data-status="confirmed"
|
||||
data-target="reaction.confirmed"
|
||||
data-action="reaction#reactableUserCheck">
|
||||
CONFIRM
|
||||
data-altstatus="invalid"
|
||||
data-target="reaction.invalid"
|
||||
data-action="reaction#updateReactionInvalid">
|
||||
INVALID
|
||||
</button>
|
||||
<% end %>
|
||||
<button
|
||||
class="btn btn-danger btn-sm"
|
||||
type="button"
|
||||
data-altstatus="invalid"
|
||||
data-target="reaction.invalid"
|
||||
data-action="reaction#updateReactionInvalid">
|
||||
INVALID
|
||||
</button>
|
||||
<% end %>
|
||||
<% if params[:status] == "Resolved" %>
|
||||
<button
|
||||
class="btn btn-warning text-white btn-sm"
|
||||
type="button"
|
||||
data-altstatus="invalid"
|
||||
data-target="reaction.invalid"
|
||||
data-action="reaction#updateReactionInvalid">
|
||||
INVALIDATE
|
||||
</button>
|
||||
<% elsif params[:status] == "Invalid" %>
|
||||
<button
|
||||
class="btn btn-success btn-sm"
|
||||
type="button"
|
||||
data-status="confirmed"
|
||||
data-target="reaction.confirmed"
|
||||
data-action="reaction#updateReactionConfirmed">
|
||||
MARK AS VALID
|
||||
</button>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<hr id="js__reaction__div__hr__<%= reaction.id %>">
|
||||
<% end %>
|
||||
<% if params[:status] == "Resolved" %>
|
||||
<button
|
||||
class="btn btn-warning text-white btn-sm"
|
||||
type="button"
|
||||
data-altstatus="invalid"
|
||||
data-target="reaction.invalid"
|
||||
data-action="reaction#updateReactionInvalid">
|
||||
INVALIDATE
|
||||
</button>
|
||||
<% elsif params[:status] == "Invalid" %>
|
||||
<button
|
||||
class="btn btn-success btn-sm"
|
||||
type="button"
|
||||
data-status="confirmed"
|
||||
data-target="reaction.confirmed"
|
||||
data-action="reaction#updateReactionConfirmed">
|
||||
MARK AS VALID
|
||||
</button>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<hr id="js__reaction__div__hr__<%= reaction.id %>">
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,170 +4,168 @@
|
|||
<% feedback_message_emails = @email_messages.select { |email| email.feedback_message_id == feedback_message.id } %>
|
||||
<% end %>
|
||||
|
||||
<div class="row my-3" id="accordion-<%= feedback_message.id %>">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="header<%= feedback_message.id %>">
|
||||
<a href="#" id="collapse__header__link-<%= feedback_message.id %>" data-toggle="collapse" data-target="#collapse<%= feedback_message.id %>" aria-expanded="true" aria-controls="collapse<%= feedback_message.id %>">
|
||||
Report #<%= feedback_message.id %> - Submitted: <%= time_ago_in_words feedback_message.created_at %> ago
|
||||
</a>
|
||||
<div class="float-right">
|
||||
✉️ Emails Sent: <%= feedback_message_emails.size %> |
|
||||
<a href="/admin/reports/<%= feedback_message.id %>">Link to Report #<%= feedback_message.id %></a>
|
||||
</div>
|
||||
<div class="crayons-card" id="accordion-<%= feedback_message.id %>">
|
||||
<div class="card-header" id="header<%= feedback_message.id %>">
|
||||
<a href="#" id="collapse__header__link-<%= feedback_message.id %>" data-toggle="collapse" data-target="#collapse<%= feedback_message.id %>" aria-expanded="true" aria-controls="collapse<%= feedback_message.id %>">
|
||||
Report #<%= feedback_message.id %> - Submitted: <%= time_ago_in_words feedback_message.created_at %> ago
|
||||
</a>
|
||||
<div class="float-right">
|
||||
✉️ Emails Sent: <%= feedback_message_emails.size %> |
|
||||
<a href="/admin/reports/<%= feedback_message.id %>">Link to Report #<%= feedback_message.id %></a>
|
||||
</div>
|
||||
<div id="collapse<%= feedback_message.id %>" class="collapse show" aria-labelledby="header<%= feedback_message.id %>" data-parent="#accordion-<%= feedback_message.id %>">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
<h2>
|
||||
Reporter:
|
||||
</h2>
|
||||
<h5>
|
||||
<% if feedback_message.reporter_id? %>
|
||||
<%= feedback_message.reporter.name %>
|
||||
<a href="<%= feedback_message.reporter.path %>">@<%= feedback_message.reporter.username %></a>
|
||||
<% else %>
|
||||
Anonymous
|
||||
<% end %>
|
||||
</h5>
|
||||
<h2>
|
||||
Reported URL (new tab):
|
||||
</h2>
|
||||
<h5>
|
||||
<a href="<%= feedback_message.reported_url %>" target="_blank" rel="noopener"><%= feedback_message.reported_url %></a>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<h3>
|
||||
<span class="badge badge-warning float-right"><%= feedback_message.category.titleize %></span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<h2>
|
||||
Message:
|
||||
</h2>
|
||||
<p>
|
||||
<% if feedback_message.message.blank? %>
|
||||
<span class="font-italic">No message was left.</span>
|
||||
<% else %>
|
||||
<%= feedback_message.message %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="collapse<%= feedback_message.id %>" class="collapse show" aria-labelledby="header<%= feedback_message.id %>" data-parent="#accordion-<%= feedback_message.id %>">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
<h5 class="fw-bold">
|
||||
Reporter:
|
||||
</h5>
|
||||
<h5>
|
||||
<% if feedback_message.reporter_id? %>
|
||||
<%= feedback_message.reporter.name %>
|
||||
<a href="<%= feedback_message.reporter.path %>">@<%= feedback_message.reporter.username %></a>
|
||||
<% else %>
|
||||
Anonymous
|
||||
<% end %>
|
||||
</h5>
|
||||
<h5 class="fw-bold">
|
||||
Reported URL (new tab):
|
||||
</h5>
|
||||
<h5>
|
||||
<a href="<%= feedback_message.reported_url %>" target="_blank" rel="noopener"><%= feedback_message.reported_url %></a>
|
||||
</h5>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Previous Emails:</h2>
|
||||
<div class="previous__emails__container">
|
||||
<% if feedback_message_emails.any? %>
|
||||
<% feedback_message_emails.each do |email| %>
|
||||
<div class="email__container">
|
||||
<p class="to__subject">Type: <%= email.utm_campaign.capitalize %></p>
|
||||
<p class="to__subject">To: <%= email.to %></p>
|
||||
<p class="to__subject">Subject: <%= email.subject %></p>
|
||||
<%= email.body_html_content.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<h5>No Email Records</h5>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<h3>
|
||||
<span class="badge badge-warning float-right"><%= feedback_message.category.titleize %></span>
|
||||
</h3>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Email Form:</h2>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="nav-item">
|
||||
<a class="nav-link active" href="#reporter-<%= feedback_message.id %>" aria-controls="reporter-<%= feedback_message.id %>" role="tab" data-toggle="tab">Reporter</a>
|
||||
</li>
|
||||
<li role="presentation" class="nav-item">
|
||||
<a class="nav-link" href="#offender-<%= feedback_message.id %>" aria-controls="offender-<%= feedback_message.id %>" role="tab" data-toggle="tab">Offender</a>
|
||||
</li>
|
||||
<li role="presentation" class="nav-item">
|
||||
<a class="nav-link" href="#affected-<%= feedback_message.id %>" aria-controls="affected-<%= feedback_message.id %>" role="tab" data-toggle="tab">Affected</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content my-3">
|
||||
<div role="tabcard" class="tab-pane fade active show" data-id="<%= feedback_message.id %>" data-userType="reporter" id="reporter-<%= feedback_message.id %>">
|
||||
<h3>Send To:</h3>
|
||||
<%= email_field_tag :reporter_email_to, feedback_message.reporter&.email, class: "form-control my-1", id: "reporter__emailto__#{feedback_message.id}", required: true %>
|
||||
<h3>Subject:</h3>
|
||||
<%= text_field_tag :reporter_email_subject, reporter_email_details[:subject], class: "form-control my-1", id: "reporter__subject__#{feedback_message.id}" %>
|
||||
<h3>Body:</h3>
|
||||
<%= text_area_tag :reporter_email_body, reporter_email_details[:body], class: "form-control my-1", style: "height: 300px;", id: "reporter__body__#{feedback_message.id}" %>
|
||||
</div>
|
||||
<div role="tabcard" class="tab-pane fade" data-id="<%= feedback_message.id %>" data-userType="offender" id="offender-<%= feedback_message.id %>">
|
||||
<h3>Send To:</h3>
|
||||
<%= email_field_tag :offender_email_to, feedback_message.offender&.email, class: "form-control my-1", id: "offender__emailto__#{feedback_message.id}", required: true %>
|
||||
<h3>Subject:</h3>
|
||||
<%= text_field_tag :offender_email_subject, offender_email_details[:subject], class: "form-control my-1", id: "offender__subject__#{feedback_message.id}" %>
|
||||
<h3>Body:</h3>
|
||||
<%= text_area_tag :offender_email_body, offender_email_details[:body], class: "form-control my-1", style: "height: 300px;", id: "offender__body__#{feedback_message.id}" %>
|
||||
</div>
|
||||
<div role="tabcard" class="tab-pane fade" data-id="<%= feedback_message.id %>" data-userType="affected" id="affected-<%= feedback_message.id %>">
|
||||
<h3>Send To:</h3>
|
||||
<%= email_field_tag :affected_email_to, feedback_message.affected&.email, class: "form-control my-1", id: "affected__emailto__#{feedback_message.id}", required: true %>
|
||||
<h3>Subject:</h3>
|
||||
<%= text_field_tag :affected_email_subject, affected_email_details[:subject], class: "form-control my-1", id: "affected__subject__#{feedback_message.id}" %>
|
||||
<h3>Body:</h3>
|
||||
<%= text_area_tag :affected_email_body, affected_email_details[:body], class: "form-control my-1", style: "height: 300px;", id: "affected__body__#{feedback_message.id}" %>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="button" id="send__email__btn__<%= feedback_message.id %>">Send Email ✉️</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<h5 class="fw-bold">
|
||||
Message:
|
||||
</h5>
|
||||
<p>
|
||||
<% if feedback_message.message.blank? %>
|
||||
<span class="font-italic">No message was left.</span>
|
||||
<% else %>
|
||||
<%= feedback_message.message %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="email__alert alert w-100 mt-2 d-none" id="email__alert__<%= feedback_message.id %>">
|
||||
</div>
|
||||
<div class="row my-3">
|
||||
<div class="col-12">
|
||||
<h3>Status:</h3>
|
||||
<%= f.select :status, %w[Open Invalid Resolved], {}, id: "status__#{feedback_message.id}" %>
|
||||
<button class="btn btn-primary d-block mt-3" type="button" id="save__status__<%= feedback_message.id %>">Save Status</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row my-3">
|
||||
<div class="col-12">
|
||||
<h3>Notes:</h3>
|
||||
<div class="notes__container" id="notes__<%= feedback_message.id %>">
|
||||
<% feedback_message.notes&.order(:created_at)&.each do |note| %>
|
||||
<div class="border border-info bg-light rounded my-2 p-2">
|
||||
<span class="badge badge-info float-right">
|
||||
<%= time_ago_in_words note.created_at %> ago
|
||||
</span>
|
||||
<h5 class="font-weight-bold">
|
||||
<%= note.author.name %>:
|
||||
</h5>
|
||||
<p>
|
||||
<%= note.content %>
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h5 class="fw-bold">Previous Emails:</h5>
|
||||
<div class="previous__emails__container">
|
||||
<% if feedback_message_emails.any? %>
|
||||
<% feedback_message_emails.each do |email| %>
|
||||
<div class="email__container">
|
||||
<p class="to__subject">Type: <%= email.utm_campaign.capitalize %></p>
|
||||
<p class="to__subject">To: <%= email.to %></p>
|
||||
<p class="to__subject">Subject: <%= email.subject %></p>
|
||||
<%= email.body_html_content.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div>
|
||||
<input type="hidden" name="reason" value="<%= feedback_message.feedback_type %>" id="note__reason__<%= feedback_message.id %>">
|
||||
<input type="hidden" name="noteable_id" value="<%= feedback_message.id %>" id="note__noteable-id__<%= feedback_message.id %>">
|
||||
<input type="hidden" name="noteable_type" value="FeedbackMessage" id="note__noteable-type__<%= feedback_message.id %>">
|
||||
<input type="hidden" name="author_id" value="<%= current_user.id %>" id="note__author-id__<%= feedback_message.id %>">
|
||||
<input
|
||||
type="textarea"
|
||||
name="content"
|
||||
placeholder="Leave some notes about the status and context of this report."
|
||||
class="notefield"
|
||||
id="note__content__<%= feedback_message.id %>"
|
||||
required>
|
||||
<button class="btn btn-primary" type="button" id="note__submit__<%= feedback_message.id %>">Submit Note 📝</button>
|
||||
</div>
|
||||
<% else %>
|
||||
<h5>No Email Records</h5>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="button" id="minimize__report__button__<%= feedback_message.id %>">
|
||||
Minimize Report
|
||||
</button>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h4 class="fw-bold">Email Form:</h4>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="nav-item">
|
||||
<a class="nav-link active" href="#reporter-<%= feedback_message.id %>" aria-controls="reporter-<%= feedback_message.id %>" role="tab" data-toggle="tab">Reporter</a>
|
||||
</li>
|
||||
<li role="presentation" class="nav-item">
|
||||
<a class="nav-link" href="#offender-<%= feedback_message.id %>" aria-controls="offender-<%= feedback_message.id %>" role="tab" data-toggle="tab">Offender</a>
|
||||
</li>
|
||||
<li role="presentation" class="nav-item">
|
||||
<a class="nav-link" href="#affected-<%= feedback_message.id %>" aria-controls="affected-<%= feedback_message.id %>" role="tab" data-toggle="tab">Affected</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content my-3">
|
||||
<div role="tabcard" class="tab-pane fade active show" data-id="<%= feedback_message.id %>" data-userType="reporter" id="reporter-<%= feedback_message.id %>">
|
||||
<h5 class="fw-bold">Send To:</h5>
|
||||
<%= email_field_tag :reporter_email_to, feedback_message.reporter&.email, class: "form-control my-1", id: "reporter__emailto__#{feedback_message.id}", required: true %>
|
||||
<h5 class="fw-bold">Subject:</h5>
|
||||
<%= text_field_tag :reporter_email_subject, reporter_email_details[:subject], class: "form-control my-1", id: "reporter__subject__#{feedback_message.id}" %>
|
||||
<h5 class="fw-bold">Body:</h5>
|
||||
<%= text_area_tag :reporter_email_body, reporter_email_details[:body], class: "form-control my-1", style: "height: 300px;", id: "reporter__body__#{feedback_message.id}" %>
|
||||
</div>
|
||||
<div role="tabcard" class="tab-pane fade" data-id="<%= feedback_message.id %>" data-userType="offender" id="offender-<%= feedback_message.id %>">
|
||||
<h5 class="fw-bold">Send To:</h5>
|
||||
<%= email_field_tag :offender_email_to, feedback_message.offender&.email, class: "form-control my-1", id: "offender__emailto__#{feedback_message.id}", required: true %>
|
||||
<h5 class="fw-bold">Subject:</h5>
|
||||
<%= text_field_tag :offender_email_subject, offender_email_details[:subject], class: "form-control my-1", id: "offender__subject__#{feedback_message.id}" %>
|
||||
<h5 class="fw-bold">Body:</h5>
|
||||
<%= text_area_tag :offender_email_body, offender_email_details[:body], class: "form-control my-1", style: "height: 300px;", id: "offender__body__#{feedback_message.id}" %>
|
||||
</div>
|
||||
<div role="tabcard" class="tab-pane fade" data-id="<%= feedback_message.id %>" data-userType="affected" id="affected-<%= feedback_message.id %>">
|
||||
<h5 class="fw-bold">Send To:</h5>
|
||||
<%= email_field_tag :affected_email_to, feedback_message.affected&.email, class: "form-control my-1", id: "affected__emailto__#{feedback_message.id}", required: true %>
|
||||
<h5 class="fw-bold">Subject:</h5>
|
||||
<%= text_field_tag :affected_email_subject, affected_email_details[:subject], class: "form-control my-1", id: "affected__subject__#{feedback_message.id}" %>
|
||||
<h5 class="fw-bold">Body:</h5>
|
||||
<%= text_area_tag :affected_email_body, affected_email_details[:body], class: "form-control my-1", style: "height: 300px;", id: "affected__body__#{feedback_message.id}" %>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="button" id="send__email__btn__<%= feedback_message.id %>">Send Email ✉️</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="email__alert alert w-100 mt-2 d-none" id="email__alert__<%= feedback_message.id %>">
|
||||
</div>
|
||||
<div class="row my-3">
|
||||
<div class="col-12">
|
||||
<h3>Status:</h3>
|
||||
<%= f.select :status, %w[Open Invalid Resolved], {}, id: "status__#{feedback_message.id}" %>
|
||||
<button class="btn btn-primary d-block mt-3" type="button" id="save__status__<%= feedback_message.id %>">Save Status</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row my-3">
|
||||
<div class="col-12">
|
||||
<h3>Notes:</h3>
|
||||
<div class="notes__container" id="notes__<%= feedback_message.id %>">
|
||||
<% feedback_message.notes&.order(:created_at)&.each do |note| %>
|
||||
<div class="border border-info bg-light rounded my-2 p-2">
|
||||
<span class="badge badge-info float-right">
|
||||
<%= time_ago_in_words note.created_at %> ago
|
||||
</span>
|
||||
<h5 class="font-weight-bold">
|
||||
<%= note.author.name %>:
|
||||
</h5>
|
||||
<p>
|
||||
<%= note.content %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div>
|
||||
<input type="hidden" name="reason" value="<%= feedback_message.feedback_type %>" id="note__reason__<%= feedback_message.id %>">
|
||||
<input type="hidden" name="noteable_id" value="<%= feedback_message.id %>" id="note__noteable-id__<%= feedback_message.id %>">
|
||||
<input type="hidden" name="noteable_type" value="FeedbackMessage" id="note__noteable-type__<%= feedback_message.id %>">
|
||||
<input type="hidden" name="author_id" value="<%= current_user.id %>" id="note__author-id__<%= feedback_message.id %>">
|
||||
<input
|
||||
type="textarea"
|
||||
name="content"
|
||||
placeholder="Leave some notes about the status and context of this report."
|
||||
class="notefield"
|
||||
id="note__content__<%= feedback_message.id %>"
|
||||
required>
|
||||
<button class="btn btn-primary" type="button" id="note__submit__<%= feedback_message.id %>">Submit Note 📝</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex justify-content-end">
|
||||
<button class="btn btn-primary" type="button" id="minimize__report__button__<%= feedback_message.id %>">
|
||||
Minimize Report
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,26 @@
|
|||
<div class="row my-3" id="latestArticles">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="articlesHeader">
|
||||
<h2 class="d-inline">Latest Articles</h2>
|
||||
<button class="btn btn-secondary float-right" type="button" data-toggle="collapse" data-target="#articlesBodyContainer" aria-expanded="false" aria-controls="articlesBodyContainer">
|
||||
<div id="latestArticles">
|
||||
<div class="crayons-card">
|
||||
<div class="card-header flex items-center" id="articlesHeader">
|
||||
<h4>Latest Articles</h4>
|
||||
<button class="btn btn-secondary ml-auto" type="button" data-toggle="collapse" data-target="#articlesBodyContainer" aria-expanded="false" aria-controls="articlesBodyContainer">
|
||||
Toggle
|
||||
</button>
|
||||
</div>
|
||||
<div id="articlesBodyContainer" class="collapse hide" aria-labelledby="articleHeader" data-parent="#latestArticles">
|
||||
<div class="card-body" style="overflow: scroll; max-height: 500px;">
|
||||
<% @new_articles.each do |article| %>
|
||||
<% next if article.user.badge_achievements_count > 2 %>
|
||||
<a href="<%= article.path %>"><%= article.title %></a>
|
||||
<span class="float-right">
|
||||
<a href="<%= article.path %>/mod" class="btn btn-secondary btn-sm">Mod</a>
|
||||
<a href="<%= article.path %>/moderate" class="btn btn-secondary btn-sm">admin</a>
|
||||
<a href="<%= article.user.path %>" class="btn btn-secondary btn-sm">Profile</a>
|
||||
<a href="/admin/users/<%= article.user_id %>" class="btn btn-secondary btn-sm">admin User</a>
|
||||
<a href="/admin/users/<%= article.user_id %>/edit" class="btn btn-danger btn-sm">Destructive Actions</a>
|
||||
</span>
|
||||
<hr>
|
||||
<div class="flex py-2">
|
||||
<% next if article.user.badge_achievements_count > 2 %>
|
||||
<a href="<%= article.path %>"><%= article.title %></a>
|
||||
|
||||
<div class="ml-auto shrink-0">
|
||||
<a href="<%= article.path %>/mod" class="btn btn-secondary btn-sm">Mod</a>
|
||||
<a href="<%= article.path %>/moderate" class="btn btn-secondary btn-sm">admin</a>
|
||||
<a href="<%= article.user.path %>" class="btn btn-secondary btn-sm">Profile</a>
|
||||
<a href="/admin/users/<%= article.user_id %>" class="btn btn-secondary btn-sm">admin User</a>
|
||||
<a href="/admin/users/<%= article.user_id %>/edit" class="btn btn-danger btn-sm">Destructive Actions</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
<div class="row my-3" id="possibleSpamUsers">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="possibleSpamUsersHeader">
|
||||
<h2 class="d-inline">Possible Spam/Abuse Users</h2>
|
||||
<button class="btn btn-secondary float-right" type="button" data-toggle="collapse" data-target="#possibleSpamUsersBodyContainer" aria-expanded="false" aria-controls="possibleSpamUsersBodyContainer">
|
||||
<div id="possibleSpamUsers">
|
||||
<div class="crayons-card">
|
||||
<div class="card-header flex items-center" id="possibleSpamUsersHeader">
|
||||
<h4>Possible Spam/Abuse Users</h4>
|
||||
<button class="btn btn-secondary ml-auto" type="button" data-toggle="collapse" data-target="#possibleSpamUsersBodyContainer" aria-expanded="false" aria-controls="possibleSpamUsersBodyContainer">
|
||||
Toggle
|
||||
</button>
|
||||
</div>
|
||||
<div id="possibleSpamUsersBodyContainer" class="collapse hide" aria-labelledby="possibleSpamUsersHeader" data-parent="#possibleSpamUsers">
|
||||
<div class="card-body" style="overflow: scroll; max-height: 500px;">
|
||||
<% @possible_spam_users.each do |user| %>
|
||||
<a href="<%= user.path %>">@<%= user.username %></a> - <%= user.name %>
|
||||
<span class="float-right">
|
||||
<a href="/admin/users/<%= user.id %>" class="btn btn-secondary btn-sm">admin User</a>
|
||||
<a href="/admin/users/<%= user.id %>/edit" class="btn btn-danger btn-sm">Destructive Actions</a>
|
||||
</span>
|
||||
<hr>
|
||||
<div class="py-2 flex">
|
||||
<a href="<%= user.path %>">@<%= user.username %></a> - <%= user.name %>
|
||||
<div class="ml-auto shrink-0">
|
||||
<a href="/admin/users/<%= user.id %>" class="btn btn-secondary btn-sm">admin User</a>
|
||||
<a href="/admin/users/<%= user.id %>/edit" class="btn btn-danger btn-sm">Destructive Actions</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,38 +1,45 @@
|
|||
<%= render "style" %>
|
||||
|
||||
<h2>Suspicious Activity</h2>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Suspicious activity</h2>
|
||||
|
||||
<%= render "latest_articles" %>
|
||||
<div class="grid gap-6">
|
||||
<%= render "latest_articles" %>
|
||||
|
||||
<%= render "potential_spam_users" %>
|
||||
<%= render "potential_spam_users" %>
|
||||
|
||||
<%= render "abuse_reports" %>
|
||||
<%= render "abuse_reports" %>
|
||||
|
||||
<%= search_form_for @q, url: admin_feedback_messages_path, class: "form-inline justify-content-end" do |f| %>
|
||||
<div class="crayons-card p-4">
|
||||
<%= search_form_for @q, url: admin_feedback_messages_path, class: "form-inline crayons-card crayons-card--secondary p-4" do |f| %>
|
||||
|
||||
<%= f.label :reported_url_cont, "Reported URL", class: "sr-only" %>
|
||||
<%= f.search_field :reported_url_cont, placeholder: "Reported URL", class: "form-control mx-3" %>
|
||||
<%= f.label :reported_url_cont, "Reported URL", class: "sr-only" %>
|
||||
<%= f.search_field :reported_url_cont, placeholder: "Reported URL", class: "form-control mr-2" %>
|
||||
|
||||
<%= f.label :reporter_username_cont, "Reporter", class: "sr-only" %>
|
||||
<%= f.search_field :reporter_username_cont, placeholder: "Reporter", class: "form-control mx-3" %>
|
||||
<%= f.label :reporter_username_cont, "Reporter", class: "sr-only" %>
|
||||
<%= f.search_field :reporter_username_cont, placeholder: "Reporter", class: "form-control mr-2" %>
|
||||
|
||||
<%= f.select(:status_eq, options_for_select(%w[Open Invalid Resolved], @q.status_eq), { include_blank: true }, class: "custom-select mx-3") %>
|
||||
<%= f.select(:status_eq, options_for_select(%w[Open Invalid Resolved], @q.status_eq), { include_blank: true }, class: "custom-select mr-2") %>
|
||||
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
|
||||
<div class="row mt-4 justify-content-center">
|
||||
<%= tag.span(sort_link(@q, :reporter_username, "Reporter"), class: "mx-2") %>
|
||||
<%= tag.span(sort_link(@q, :reported_url, "Reported URL"), class: "mx-2") %>
|
||||
<%= tag.span(sort_link(@q, :created_at, "Creation Date"), class: "ml-2") %>
|
||||
<div class="pt-4 px-2 pb-4">
|
||||
<strong>Sort:</strong>
|
||||
<%= tag.span(sort_link(@q, :reporter_username, "Reporter"), class: "mx-2") %>
|
||||
<%= tag.span(sort_link(@q, :reported_url, "Reported URL"), class: "mx-2") %>
|
||||
<%= tag.span(sort_link(@q, :created_at, "Creation Date"), class: "ml-2") %>
|
||||
</div>
|
||||
|
||||
<%= paginate @feedback_messages %>
|
||||
|
||||
<div class="grid gap-4">
|
||||
<% @feedback_messages.each do |feedback_message| %>
|
||||
<%= form_for [:admin, feedback_message] do |f| %>
|
||||
<%= render "feedback_message", f: f, feedback_message: feedback_message %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= paginate @feedback_messages %>
|
||||
|
||||
<% @feedback_messages.each do |feedback_message| %>
|
||||
<%= form_for [:admin, feedback_message] do |f| %>
|
||||
<%= render "feedback_message", f: f, feedback_message: feedback_message %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= paginate @feedback_messages %>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<article class="row">
|
||||
<div class="col">
|
||||
<h3 class="m-4">Past <%= num_days %> day new users (<%= User.where("registered_at > ?", num_days.day.ago).count %>)</h3>
|
||||
<div class="crayons-card mb-6 p-6">
|
||||
<h4 class="mb-4">Past <%= num_days %> day new users (<%= User.where("registered_at > ?", num_days.day.ago).count %>)</h4>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong>Overall data:</strong>
|
||||
|
|
@ -17,5 +16,4 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<main>
|
||||
<h2>Onboarding</h2>
|
||||
<%= render "results", num_days: 7 %>
|
||||
<%= render "results", num_days: 1 %>
|
||||
</main>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Onboarding</h2>
|
||||
|
||||
<%= render "results", num_days: 7 %>
|
||||
|
||||
<%= render "results", num_days: 1 %>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
<div class="row my-3">
|
||||
<div class="col">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "Registered Users", admin_users_path, class: "nav-link" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "New", new_admin_invitation_path, class: "nav-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mb-6">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "Registered Users", admin_users_path, class: "nav-link" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "New", new_admin_invitation_path, class: "nav-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table class="table table-hover">
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">User</th>
|
||||
|
|
@ -20,7 +18,7 @@
|
|||
<th scope="col">Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="crayons-card">
|
||||
<% @invitations.each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to user.username, admin_user_path(user) %></td>
|
||||
|
|
|
|||
|
|
@ -1,36 +1,42 @@
|
|||
<%= link_to "Back to All Listings", admin_listings_path, class: "btn btn-primary float-right" %>
|
||||
<header class="mb-6 flex items-center">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-4">Edit</h2>
|
||||
|
||||
<h2>Edit <%= link_to @listing.title, "/listings/#{@listing.category}/#{@listing.slug}", target: "_blank", rel: "noopener" %></h2>
|
||||
<div class="ml-auto flex">
|
||||
<%= link_to "Remove", url_for(action: :destroy, id: @listing.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger mr-2" %>
|
||||
|
||||
<%= form_with model: [:admin, @listing], method: :patch do |f| %>
|
||||
<input type="hidden" name="listing[action]" value="bump" />
|
||||
<%= f.submit "Bump Listing ⏫", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "View", "/listings/#{@listing.category}/#{@listing.slug}", target: "_blank", rel: "noopener", class: "btn btn-primary ml-2" %>
|
||||
|
||||
<%= form_with model: [:admin, @listing], method: :patch do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title, size: 100, maxlength: 128, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :body_markdown %>
|
||||
<%= form.text_area :body_markdown, cols: 40, rows: 15, maxlength: 400, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :tag_list %>
|
||||
<i style="font-size: 15px;">Comma separated, one space, 8 tags max</i>
|
||||
<%= form.text_field :tag_list, value: @listing.cached_tag_list, size: 100, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :listing_category_id %>
|
||||
<%= form.select :listing_category_id, select_options_for_categories %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box :published, checked: @listing.published? %>
|
||||
<%= form.label :published %>
|
||||
</div>
|
||||
<%= form.submit "Update Listing", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
<hr class="mt-5">
|
||||
<div class="d-flex justify-content-start">
|
||||
<%= form_with model: [:admin, @listing], method: :patch do |f| %>
|
||||
<input type="hidden" name="listing[action]" value="bump" />
|
||||
<%= f.submit "Bump Listing ⏫", class: "btn btn-secondary" %>
|
||||
</header>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<%= form_with model: [:admin, @listing], method: :patch do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title, size: 100, maxlength: 128, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :body_markdown %>
|
||||
<%= form.text_area :body_markdown, cols: 40, rows: 15, maxlength: 400, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :tag_list %>
|
||||
<i class="fs-s">Comma separated, one space, 8 tags max</i>
|
||||
<%= form.text_field :tag_list, value: @listing.cached_tag_list, size: 100, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :listing_category_id %>
|
||||
<%= form.select :listing_category_id, select_options_for_categories %>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<%= form.check_box :published, checked: @listing.published? %>
|
||||
<%= form.label :published %>
|
||||
</div>
|
||||
<%= form.submit "Update Listing", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<%= link_to "Destroy Listing", url_for(action: :destroy, id: @listing.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger ml-2" %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,88 +1,85 @@
|
|||
<main>
|
||||
<section class="row m-3" role="search">
|
||||
<div class="col justify-content-end">
|
||||
<%= form_tag(admin_listings_path, method: "get") do %>
|
||||
<div class="form-row align-items-end flex-column">
|
||||
<div class="form-group">
|
||||
<%= label_tag(:search, "Keyword") %>
|
||||
<%= text_field_tag(:search, params[:search]) %>
|
||||
<% if params[:state].present? %>
|
||||
<%= hidden_field_tag(:state, params[:state]) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= label_tag(:filter, "Category") %>
|
||||
<%= select_tag(:filter, options_for_select(categories_available.keys, params[:filter]), include_blank: true) %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= label_tag(:include_unpublished, "Include unpublished listings") %>
|
||||
<%= hidden_field_tag(:include_unpublished, 0) %>
|
||||
<%= check_box_tag(:include_unpublished, 1, params[:include_unpublished] == "1") %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= submit_tag("Filter") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
<header class="mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-4">Listings</h2>
|
||||
</header>
|
||||
|
||||
<%= paginate @listings %>
|
||||
<%= form_tag(admin_listings_path, method: "get", role: "search", class: "crayons-card crayons-card--secondary p-4 flex items-center") do %>
|
||||
<div class="mr-4">
|
||||
<%= label_tag(:search, "Keyword", class: "mb-0") %>
|
||||
<%= text_field_tag(:search, params[:search]) %>
|
||||
<% if params[:state].present? %>
|
||||
<%= hidden_field_tag(:state, params[:state]) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<div class="mr-4">
|
||||
<%= label_tag(:filter, "Category", class: "mb-0") %>
|
||||
<%= select_tag(:filter, options_for_select(categories_available.keys, params[:filter]), include_blank: true) %>
|
||||
</div>
|
||||
|
||||
<div class="mr-4">
|
||||
<%= label_tag(:include_unpublished, "Include unpublished listings", class: "mb-0") %>
|
||||
<%= hidden_field_tag(:include_unpublished, 0) %>
|
||||
<%= check_box_tag(:include_unpublished, 1, params[:include_unpublished] == "1") %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag("Filter") %>
|
||||
<% end %>
|
||||
|
||||
<%= paginate @listings %>
|
||||
|
||||
<table class="crayons-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Title Link</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Org</th>
|
||||
<th scope="col">Category</th>
|
||||
<th scope="col">Cached Tags</th>
|
||||
<th scope="col">Published?</th>
|
||||
<th scope="col">Last Bumped</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @listings.each do |listing| %>
|
||||
<tr>
|
||||
<th scope="col">Title Link</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Org</th>
|
||||
<th scope="col">Category</th>
|
||||
<th scope="col">Cached Tags</th>
|
||||
<th scope="col">Published?</th>
|
||||
<th scope="col">Last Bumped</th>
|
||||
<td><%= link_to listing.title, edit_admin_listing_path(listing.id), rel: "noopener" %></td>
|
||||
<td><%= link_to listing.user.username, edit_admin_user_path(listing.user.id) %></td>
|
||||
<td><%= link_to listing.organization.name, admin_organization_path(listing.organization_id) if listing.organization_id.present? %></td>
|
||||
<td><%= listing.category %></td>
|
||||
<td><%= listing.cached_tag_list %></td>
|
||||
<td><%= listing.published ? "Yes" : "No" %></td>
|
||||
<td><%= listing.bumped_at ? "#{time_ago_in_words(listing.bumped_at)} ago" : "Draft" %></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @listings.each do |listing| %>
|
||||
<tr>
|
||||
<td><%= link_to listing.title, edit_admin_listing_path(listing.id), target: "_blank", rel: "noopener" %></td>
|
||||
<td><%= link_to listing.user.username, edit_admin_user_path(listing.user.id) %></td>
|
||||
<td><%= link_to listing.organization.name, admin_organization_path(listing.organization_id) if listing.organization_id.present? %></td>
|
||||
<td><%= listing.category %></td>
|
||||
<td><%= listing.cached_tag_list %></td>
|
||||
<td><%= listing.published ? "Yes" : "No" %></td>
|
||||
<td><%= listing.bumped_at ? "#{time_ago_in_words(listing.bumped_at)} ago" : "Draft" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="buffer-cell border-0" colspan="7" data-controller="buffer" data-action="load@window->buffer#autosizeBodyText">
|
||||
<button class="btn btn-secondary" data-toggle="collapse" data-target="#buffering-area-for-listing-<%= listing.id %>" aria-expanded="false" aria-controls="buffering-area-for-listing-<%= listing.id %>">
|
||||
Share to Buffer
|
||||
</button>
|
||||
<tr>
|
||||
<td class="buffer-cell border-0" colspan="7" data-controller="buffer" data-action="load@window->buffer#autosizeBodyText">
|
||||
<button class="btn btn-secondary" data-toggle="collapse" data-target="#buffering-area-for-listing-<%= listing.id %>" aria-expanded="false" aria-controls="buffering-area-for-listing-<%= listing.id %>">
|
||||
Share to Buffer
|
||||
</button>
|
||||
|
||||
<% if listing.last_buffered.present? %>
|
||||
<em class="ml-1">
|
||||
Last shared: <%= listing.last_buffered.strftime("%d %B %Y") %>
|
||||
</em>
|
||||
<% if listing.last_buffered.present? %>
|
||||
<em class="ml-1">
|
||||
Last shared: <%= listing.last_buffered.strftime("%d %B %Y") %>
|
||||
</em>
|
||||
<% end %>
|
||||
<div id="buffering-area-for-listing-<%= listing.id %>" class="collapse buffer-area mt-3">
|
||||
<p><strong><%= listing.title %></strong></p>
|
||||
<p><%= listing.processed_html&.html_safe %></p>
|
||||
<%= form_with url: admin_buffer_updates_path, html: { data: { action: "submit->buffer#highlightElement" } } do %>
|
||||
<input type="hidden" name="social_channel" value="listings_twitter" />
|
||||
<input type="hidden" name="listing_id" value="<%= listing.id %>" />
|
||||
<textarea class="form-control" wrap="hard" name="tweet" maxlength="255" data-target="buffer.bodyText">
|
||||
📋 New <%= community_name %> Listing!

Category: <%= listing.category %>

<%= listing.title %>

|
||||
<% if listing.user.twitter_username? %>
|
||||
Posted by @<%= listing.user.twitter_username %>
|
||||
<% end %>
|
||||
</textarea>
|
||||
<button class="btn btn-primary mt-2">🐦 Tweet 🐦</button>
|
||||
<% end %>
|
||||
<div id="buffering-area-for-listing-<%= listing.id %>" class="collapse buffer-area mt-3">
|
||||
<p><strong><%= listing.title %></strong></p>
|
||||
<p><%= listing.processed_html&.html_safe %></p>
|
||||
<%= form_with url: admin_buffer_updates_path, html: { data: { action: "submit->buffer#highlightElement" } } do %>
|
||||
<input type="hidden" name="social_channel" value="listings_twitter" />
|
||||
<input type="hidden" name="listing_id" value="<%= listing.id %>" />
|
||||
<textarea class="form-control" wrap="hard" name="tweet" maxlength="255" data-target="buffer.bodyText">
|
||||
📋 New <%= community_name %> Listing!

Category: <%= listing.category %>

<%= listing.title %>

|
||||
<% if listing.user.twitter_username? %>
|
||||
Posted by @<%= listing.user.twitter_username %>
|
||||
<% end %>
|
||||
</textarea>
|
||||
<button class="btn btn-primary mt-2">🐦 Tweet 🐦</button>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @listings %>
|
||||
</main>
|
||||
<%= paginate @listings %>
|
||||
|
|
|
|||
|
|
@ -1,42 +1,36 @@
|
|||
<main>
|
||||
<section class="row m-3" role="search">
|
||||
<div class="col justify-content-end">
|
||||
<%= search_form_for @q, url: admin_moderator_actions_path, class: "form-inline justify-content-end" do |f| %>
|
||||
<div class="mb-6">
|
||||
<%= search_form_for @q, url: admin_moderator_actions_path, class: "form-inline" do |f| %>
|
||||
<%= f.label :user_username_cont, "User", class: "sr-only" %>
|
||||
<%= f.search_field :user_username_cont, placeholder: "User", class: "form-control mr-2" %>
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.label :user_username_cont, "User", class: "sr-only" %>
|
||||
<%= f.search_field :user_username_cont, placeholder: "User", class: "form-control mx-3" %>
|
||||
<%= paginate @moderator_actions %>
|
||||
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @moderator_actions %>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<table class="crayons-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Action</th>
|
||||
<th scope="col">Data</th>
|
||||
<th scope="col">
|
||||
<%= tag.span(sort_link(@q, :created_at, "Date")) %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @moderator_actions.each do |action| %>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Action</th>
|
||||
<th scope="col">Data</th>
|
||||
<th scope="col">
|
||||
<%= tag.span(sort_link(@q, :created_at, "Date"), class: "mx-2") %>
|
||||
</th>
|
||||
<td><%= action.id %></td>
|
||||
<td><%= link_to(action.user.username, admin_user_path(action.user_id)) if action.user %></td>
|
||||
<td><%= "#{action.data['action'].humanize} #{action.data['controller'].humanize.singularize.titleize}" if action.data.present? %></td>
|
||||
<td><%= action.data %></td>
|
||||
<td><%= action.created_at %></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @moderator_actions.each do |action| %>
|
||||
<tr>
|
||||
<td><%= action.id %></td>
|
||||
<td><%= link_to(action.user.username, admin_user_path(action.user_id)) if action.user %></td>
|
||||
<td><%= "#{action.data['action'].humanize} #{action.data['controller'].humanize.singularize.titleize}" if action.data.present? %></td>
|
||||
<td><%= action.data %></td>
|
||||
<td><%= action.created_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @moderator_actions %>
|
||||
</main>
|
||||
<%= paginate @moderator_actions %>
|
||||
|
|
|
|||
|
|
@ -1,63 +1,58 @@
|
|||
<main>
|
||||
<section class="row my-3" role="search">
|
||||
<div class="col">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "General Community", admin_mods_path, class: "nav-link #{'active' if params[:state].blank?}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Tag Mods", admin_mods_path(state: :tag_moderator), class: "nav-link #{'active' if params[:state] == 'tag_moderator'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Potential Mods", admin_mods_path(state: :potential), class: "nav-link #{'active' if params[:state] == 'potential'}" %>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="mb-6 flex items-center">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "General Community", admin_mods_path, class: "nav-link #{'active' if params[:state].blank?}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Tag Mods", admin_mods_path(state: :tag_moderator), class: "nav-link #{'active' if params[:state] == 'tag_moderator'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Potential Mods", admin_mods_path(state: :potential), class: "nav-link #{'active' if params[:state] == 'potential'}" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<%= form_with url: admin_mods_path, method: :get, local: true, class: "form-inline ml-auto" do |f| %>
|
||||
<div class="form-group mx-sm-3">
|
||||
<%= f.text_field :search, value: params[:search], class: "form-control", aria: { label: "Search" } %>
|
||||
<%= f.hidden_field :state, value: params[:state] if params[:state].present? %>
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= form_with url: admin_mods_path, method: :get, local: true, class: "form-inline justify-content-end" do |f| %>
|
||||
<div class="form-group mx-sm-3">
|
||||
<%= f.text_field :search, value: params[:search], class: "form-control", aria: { label: "Search" } %>
|
||||
<%= f.hidden_field :state, value: params[:state] if params[:state].present? %>
|
||||
</div>
|
||||
<%= f.submit "Search", class: "btn btn-light" %>
|
||||
<%= f.submit "Search", class: "btn btn-light" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Profile</th>
|
||||
<th scope="col">Comments</th>
|
||||
<th scope="col">Badges</th>
|
||||
<th scope="col">Last Comment</th>
|
||||
<% if params[:state] == "potential" %>
|
||||
<th scope="col">Action</th>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @mods.each do |mod| %>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Profile</th>
|
||||
<th scope="col">Comments</th>
|
||||
<th scope="col">Badges</th>
|
||||
<th scope="col">Last Comment</th>
|
||||
<td><%= mod.id %></td>
|
||||
<td><%= link_to mod.username, admin_user_path(mod.id) %></td>
|
||||
<td><%= mod.comments_count %></td>
|
||||
<td><%= mod.badge_achievements_count %></td>
|
||||
<td><%= time_ago_in_words mod.last_comment_at %> ago</td>
|
||||
<% if params[:state] == "potential" %>
|
||||
<th scope="col">Action</th>
|
||||
<td>
|
||||
<%= form_with model: [:admin, mod], url: admin_mod_path(mod.id), method: :patch, local: true do |f| %>
|
||||
<%= f.submit "Make Trusted Mod", class: "btn btn-light js-add-to-mod-channel" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @mods.each do |mod| %>
|
||||
<tr>
|
||||
<td><%= mod.id %></td>
|
||||
<td><%= link_to mod.username, admin_user_path(mod.id) %></td>
|
||||
<td><%= mod.comments_count %></td>
|
||||
<td><%= mod.badge_achievements_count %></td>
|
||||
<td><%= time_ago_in_words mod.last_comment_at %> ago</td>
|
||||
<% if params[:state] == "potential" %>
|
||||
<td>
|
||||
<%= form_with model: [:admin, mod], url: admin_mod_path(mod.id), method: :patch, local: true do |f| %>
|
||||
<%= f.submit "Make Trusted Mod", class: "btn btn-light js-add-to-mod-channel" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
</main>
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<article class="row">
|
||||
<div class="col-sm-6">
|
||||
<h2>Activity</h2>
|
||||
<ul>
|
||||
<li><%= @organization.articles.size %> articles</li>
|
||||
<li><%= @organization.followers.size %> followers</li>
|
||||
</ul>
|
||||
</div>
|
||||
</article>
|
||||
<div class="crayons-card p-6">
|
||||
<h3 class="mb-4">Activity</h2>
|
||||
<ul>
|
||||
<li><%= @organization.articles.size %> articles</li>
|
||||
<li><%= @organization.followers.size %> followers</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,53 +1,47 @@
|
|||
<main>
|
||||
<section class="row m-3" role="search">
|
||||
<div class="col justify-content-end">
|
||||
<%= form_tag(admin_organizations_path, method: "get") do %>
|
||||
<div class="form-row justify-content-end">
|
||||
<div class="form-group">
|
||||
<%= text_field_tag(:search, params[:search], aria: { label: "Search" }) %>
|
||||
<%= submit_tag("Search") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= form_tag(admin_organizations_path, method: "get") do %>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<%= text_field_tag(:search, params[:search], aria: { label: "Search" }) %>
|
||||
<%= submit_tag("Search") %>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= paginate @organizations %>
|
||||
<%= paginate @organizations %>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Twitter</th>
|
||||
<th scope="col">GitHub</th>
|
||||
<th scope="col">URL</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @organizations.each do |organization| %>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Twitter</th>
|
||||
<th scope="col">GitHub</th>
|
||||
<th scope="col">URL</th>
|
||||
<td><%= link_to "@#{organization.name}", admin_organization_path(organization.id) %></td>
|
||||
<td><%= organization.id %></td>
|
||||
<% if organization.twitter_username %>
|
||||
<td><%= link_to organization.twitter_username, "https://twitter.com/#{organization.twitter_username}" %></td>
|
||||
<% else %>
|
||||
<td>N/A</td>
|
||||
<% end %>
|
||||
<% if organization.github_username %>
|
||||
<td><%= link_to organization.github_username, "https://github.com/#{organization.github_username}" %></td>
|
||||
<% else %>
|
||||
<td>N/A</td>
|
||||
<% end %>
|
||||
<% if organization.url %>
|
||||
<td><%= link_to organization.url, organization.url %></td>
|
||||
<% else %>
|
||||
<td>N/A</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @organizations.each do |organization| %>
|
||||
<tr>
|
||||
<td><%= link_to "@#{organization.name}", admin_organization_path(organization.id) %></td>
|
||||
<td><%= organization.id %></td>
|
||||
<% if organization.twitter_username %>
|
||||
<td><%= link_to organization.twitter_username, "https://twitter.com/#{organization.twitter_username}" %></td>
|
||||
<% else %>
|
||||
<td>N/A</td>
|
||||
<% end %>
|
||||
<% if organization.github_username %>
|
||||
<td><%= link_to organization.github_username, "https://github.com/#{organization.github_username}" %></td>
|
||||
<% else %>
|
||||
<td>N/A</td>
|
||||
<% end %>
|
||||
<% if organization.url %>
|
||||
<td><%= link_to organization.url, organization.url %></td>
|
||||
<% else %>
|
||||
<td>N/A</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @organizations %>
|
||||
</main>
|
||||
<%= paginate @organizations %>
|
||||
|
|
|
|||
|
|
@ -1,58 +1,61 @@
|
|||
<main>
|
||||
<article class="row">
|
||||
<div class="col-12">
|
||||
<h2 class="d-inline">
|
||||
<%= @organization.name %><%= link_to "@#{@organization.name}", "/#{@organization.slug}", class: "ml-2", target: "_blank", rel: "noopener" %>
|
||||
</h2>
|
||||
<p class="font-italic">Created <%= @organization.created_at.strftime("%b %e '%y") %></p>
|
||||
<header class="flex items-center mb-6">
|
||||
<div>
|
||||
<h2 class="fs-2xl s:fs-3xl"><%= @organization.name %></h2>
|
||||
<p class="color-base-60">Created <%= @organization.created_at.strftime("%b %e '%y") %></p>
|
||||
</div>
|
||||
|
||||
<div class="ml-auto">
|
||||
<%= link_to "View @#{@organization.name}", "/#{@organization.slug}", class: "btn btn-primary", target: "_blank", rel: "noopener" %>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="crayons-card p-6 mb-6">
|
||||
<h3 class="mb-4">General Info</h3>
|
||||
<dl>
|
||||
<dt>ID:</dt>
|
||||
<dd><%= @organization.id %></dd>
|
||||
<dt>Name:</dt>
|
||||
<dd><%= @organization.name %></dd>
|
||||
<dt>Membership Count:</dt>
|
||||
<dd><%= @organization.organization_memberships.size %></dd>
|
||||
<dt>Email:</dt>
|
||||
<dd><%= @organization.email || "N/A" %></dd>
|
||||
<dt>Twitter:</dt>
|
||||
<% if @organization.twitter_username %>
|
||||
<dd><%= link_to @organization.twitter_username, "https://twitter.com/#{@organization.twitter_username}" %></dd>
|
||||
<% else %>
|
||||
<dd>N/A</dd>
|
||||
<% end %>
|
||||
<dt>GitHub:</dt>
|
||||
<% if @organization.github_username %>
|
||||
<dd><%= link_to @organization.github_username, "https://github.com/#{@organization.github_username}" %></dd>
|
||||
<% else %>
|
||||
<dd>N/A</dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="crayons-card p-6 mb-6">
|
||||
<% current_credits = @organization.unspent_credits_count %>
|
||||
<h3 class="mb-4">Credits (currrent: <%= current_credits %>)</h3>
|
||||
<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
|
||||
<div class="form-group">
|
||||
<%= hidden_field_tag :credit_action, :add %>
|
||||
<%= number_field_tag :credits, nil, in: 1...100_000, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %>
|
||||
<%= text_field_tag :note, "", placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<h2>General Info</h2>
|
||||
<dl>
|
||||
<dt>ID:</dt>
|
||||
<dd><%= @organization.id %></span></dd>
|
||||
<dt>Name:</dt>
|
||||
<dd><%= @organization.name %></dd>
|
||||
<dt>Membership Count:</dt>
|
||||
<dd><%= @organization.organization_memberships.size %></dd>
|
||||
<dt>Email:</dt>
|
||||
<dd><%= @organization.email || "N/A" %></dd>
|
||||
<dt>Twitter:</dt>
|
||||
<% if @organization.twitter_username %>
|
||||
<dd><%= link_to @organization.twitter_username, "https://twitter.com/#{@organization.twitter_username}" %></dd>
|
||||
<% else %>
|
||||
<dd>N/A</dd>
|
||||
<% end %>
|
||||
<dt>GitHub:</dt>
|
||||
<% if @organization.github_username %>
|
||||
<dd><%= link_to @organization.github_username, "https://github.com/#{@organization.github_username}" %></dd>
|
||||
<% else %>
|
||||
<dd>N/A</dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<% current_credits = @organization.unspent_credits_count %>
|
||||
<h2>Credits (currrent: <%= current_credits %>)</h2>
|
||||
<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
|
||||
<div class="form-group">
|
||||
<%= hidden_field_tag :credit_action, :add %>
|
||||
<%= number_field_tag :credits, nil, in: 1...100_000, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %>
|
||||
<%= text_field_tag :note, "", placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %>
|
||||
</div>
|
||||
<%= submit_tag "Add Org Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<% if current_credits.positive? %>
|
||||
<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
|
||||
<div class="form-group">
|
||||
<%= hidden_field_tag :credit_action, :remove %>
|
||||
<%= number_field_tag :credits, nil, in: 1..current_credits, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %>
|
||||
<%= text_field_tag :note, "", placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %>
|
||||
</div>
|
||||
<%= submit_tag "Remove Org Credits", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</article>
|
||||
<%= render "activity" %>
|
||||
</main>
|
||||
<%= submit_tag "Add Org Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<% if current_credits.positive? %>
|
||||
<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
|
||||
<div class="form-group">
|
||||
<%= hidden_field_tag :credit_action, :remove %>
|
||||
<%= number_field_tag :credits, nil, in: 1..current_credits, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %>
|
||||
<%= text_field_tag :note, "", placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %>
|
||||
</div>
|
||||
<%= submit_tag "Remove Org Credits", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render "activity" %>
|
||||
|
|
|
|||
|
|
@ -1,67 +1,65 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<%= form_for [:admin, @page] do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :slug %>
|
||||
<%= form.text_field :slug, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :description %>
|
||||
<%= form.text_field :description, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :template %>
|
||||
<%= form.select :template, Page::TEMPLATE_OPTIONS, class: "form-control" %>
|
||||
<p>(Determines the way page's body will be embedded in the layout)</p>
|
||||
</div>
|
||||
<div class="form-group optional html">
|
||||
<%= form.label :body_markdown %>
|
||||
<%= form.text_area :body_markdown, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group optional html">
|
||||
<%= form.label :body_html %> (Only if not using markdown. HTML is dangerous ⚠️)
|
||||
<%= form.text_area :body_html, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group optional json">
|
||||
<%= form.label :body_json %> (For use with template type <code>json</code>)
|
||||
<%= form.text_area :body_json, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<% if @page.social_image_url %>
|
||||
<img src="<%= @page.social_image_url %>" style="max-width:500px;display:block" />
|
||||
<div class="crayons-card p-6">
|
||||
<%= form_for [:admin, @page] do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :slug %>
|
||||
<%= form.text_field :slug, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :description %>
|
||||
<%= form.text_field :description, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :template %>
|
||||
<%= form.select :template, Page::TEMPLATE_OPTIONS, class: "form-control" %>
|
||||
<p>(Determines the way page's body will be embedded in the layout)</p>
|
||||
</div>
|
||||
<div class="form-group optional html">
|
||||
<%= form.label :body_markdown %>
|
||||
<%= form.text_area :body_markdown, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group optional html">
|
||||
<%= form.label :body_html %> (Only if not using markdown. HTML is dangerous ⚠️)
|
||||
<%= form.text_area :body_html, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group optional json">
|
||||
<%= form.label :body_json %> (For use with template type <code>json</code>)
|
||||
<%= form.text_area :body_json, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<% if @page.social_image_url %>
|
||||
<img src="<%= @page.social_image_url %>" style="max-width:500px;display:block" />
|
||||
<% end %>
|
||||
<%= form.label :social_image %>
|
||||
<%= form.file_field :social_image, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :is_top_level_path %>
|
||||
<%= form.check_box :is_top_level_path %>
|
||||
<p>(Determines if it is accessible by <code>/page-slug</code> vs <code>/page/page-slug</code>) Be careful! ⚠️</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<p>
|
||||
<b><%= link_to "Feature Flag", "/admin/feature_flags" %></b>
|
||||
<span class="badge badge-<%= FeatureFlag.exist?(@page.feature_flag_name) ? "success" : "warning" %>">
|
||||
<%= FeatureFlag.exist?(@page.feature_flag_name) ? "Present" : "Not Present" %>
|
||||
</span>
|
||||
<br>
|
||||
<% if FeatureFlag.exist?(@page.feature_flag_name) %>
|
||||
Access to this page is being guarded by the feature flag <code><%= @page.feature_flag_name %></code>.
|
||||
<%= link_to "Modify flag here", "/admin/feature_flags/features/#{@page.feature_flag_name}" %>
|
||||
<% else %>
|
||||
Everyone has access. Optionally guard access to this page by creating feature <code><%= @page.feature_flag_name %></code>
|
||||
<%= link_to "here", "/admin/feature_flags/features" %>
|
||||
<% end %>
|
||||
<%= form.label :social_image %>
|
||||
<%= form.file_field :social_image, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :is_top_level_path %>
|
||||
<%= form.check_box :is_top_level_path %>
|
||||
<p>(Determines if it is accessible by <code>/page-slug</code> vs <code>/page/page-slug</code>) Be careful! ⚠️</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<p>
|
||||
<b><%= link_to "Feature Flag", "/admin/feature_flags" %></b>
|
||||
<span class="badge badge-<%= FeatureFlag.exist?(@page.feature_flag_name) ? "success" : "warning" %>">
|
||||
<%= FeatureFlag.exist?(@page.feature_flag_name) ? "Present" : "Not Present" %>
|
||||
</span>
|
||||
<br>
|
||||
<% if FeatureFlag.exist?(@page.feature_flag_name) %>
|
||||
Access to this page is being guarded by the feature flag <code><%= @page.feature_flag_name %></code>.
|
||||
<%= link_to "Modify flag here", "/admin/feature_flags/features/#{@page.feature_flag_name}" %>
|
||||
<% else %>
|
||||
Everyone has access. Optionally guard access to this page by creating feature <code><%= @page.feature_flag_name %></code>
|
||||
<%= link_to "here", "/admin/feature_flags/features" %>
|
||||
<% end %>
|
||||
<br>
|
||||
</p>
|
||||
</div>
|
||||
<%= form.submit class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<br>
|
||||
</p>
|
||||
</div>
|
||||
<%= form.submit class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,2 @@
|
|||
<main>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Edit <%= @page.title %></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
</main>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Edit <%= @page.title %></h2>
|
||||
<%= render "form" %>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,15 @@
|
|||
<%= csrf_meta_tags %>
|
||||
|
||||
<main>
|
||||
<div class="row justify-content-end">
|
||||
<%= link_to "New Page", new_admin_page_path, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<header class="flex items-center mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl">Pages</h2>
|
||||
<%= link_to "New page", new_admin_page_path, class: "btn btn-primary ml-auto" %>
|
||||
</header>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="list-group-flush w-100">
|
||||
<% @pages.each do |page| %>
|
||||
<div class="list-group-item d-flex justify-content-between">
|
||||
<%= link_to page.title, edit_admin_page_path(page.id) %>
|
||||
<%= link_to "View", page.path %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="crayons-card p-6">
|
||||
<% @pages.each do |page| %>
|
||||
<div class="flex py-2 items-center">
|
||||
<%= link_to page.title, edit_admin_page_path(page.id) %>
|
||||
<%= link_to "View", page.path, class: "ml-auto btn btn-secondary" %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,2 @@
|
|||
<main>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>New Page</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
</main>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">New page</h2>
|
||||
<%= render "form" %>
|
||||
|
|
|
|||
|
|
@ -1,37 +1,30 @@
|
|||
<main>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Admin Roles</h2>
|
||||
<%= paginate @users %>
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Admin roles</h2>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Profile</th>
|
||||
<th scope="col">Roles</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= user.id %></td>
|
||||
<td><%= link_to "@#{user.username}", user.path %></td>
|
||||
<td>
|
||||
<ul>
|
||||
<% user.roles.pluck(:name, :resource_type, :resource_id).each do |role| %>
|
||||
<li><%= role[0] %><%= ": #{role[1]}" if role[1] %><%= "/#{role[2]}" if role[2] %></li>
|
||||
<% end %>
|
||||
<li><a href="<%= edit_admin_user_path(user) %>">Add new permission</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= paginate @users %>
|
||||
|
||||
<%= paginate @users %>
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Profile</th>
|
||||
<th scope="col">Roles</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td class="align-top"><%= user.id %></td>
|
||||
<td class="align-top"><%= link_to "@#{user.username}", user.path %></td>
|
||||
<td>
|
||||
<ul>
|
||||
<% user.roles.pluck(:name, :resource_type, :resource_id).each do |role| %>
|
||||
<li><%= role[0] %><%= ": #{role[1]}" if role[1] %><%= "/#{role[2]}" if role[2] %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<%= paginate @users %>
|
||||
|
|
|
|||
|
|
@ -1,79 +1,70 @@
|
|||
<hr />
|
||||
<h2 class="m-0 mb-3"><%= link_to @podcast.title, "/#{@podcast.slug}" %></h2>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h3>Fetch episodes</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<%= form_with(url: fetch_admin_podcast_path(@podcast.id), method: :post, local: true) do %>
|
||||
<div class="form-group">
|
||||
<%= check_box_tag :force %>
|
||||
<%= label_tag :force %>
|
||||
<small>(When checked, the existing episodes' urls will be re-checked and episodes reachable and https fields will be updated accordingly if needed.)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= text_field_tag :limit, 5, size: 2 %>
|
||||
<%= label_tag :limit %>
|
||||
<small>(The number of episodes to fetch. When set to an empty string, last 1_000 episodes will be fetched.)</small>
|
||||
</div>
|
||||
<%= submit_tag "Fetch episodes", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h3>Manage Admins</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<% if @podcast.admins.present? %>
|
||||
<ul class="list-group list-group-flush mb-3">
|
||||
<% @podcast.admins.each do |admin| %>
|
||||
<%= form_for @podcast, url: remove_admin_admin_podcast_path(@podcast.id), html: { method: :delete, class: "form-inline" } do |f| %>
|
||||
<li class="list-group-item w-100">
|
||||
<%= link_to "@#{admin.username}", "/#{admin.username}" %>
|
||||
<%= f.hidden_field :user_id, value: admin.id %>
|
||||
<%= f.submit "Remove", class: "btn btn-danger btn-sm float-right" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p>There are no admins for this podcast.</p>
|
||||
<% end %>
|
||||
<header class="flex items-center mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6"><%= @podcast.title %></h2>
|
||||
<div class="ml-auto">
|
||||
<%= link_to "View", "/#{@podcast.slug}", class: "btn btn-primary" %>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<% if @podcast.creator.present? %>
|
||||
<p>Created by <%= link_to "@#{@podcast.creator.username}", "/#{@podcast.creator.username}" %></p>
|
||||
<div class="grid gap-6">
|
||||
<div class="crayons-card p-6">
|
||||
<h4 class="mb-4">Fetch episodes</h4>
|
||||
<%= form_with(url: fetch_admin_podcast_path(@podcast.id), method: :post, local: true) do %>
|
||||
<div class="form-group">
|
||||
<%= check_box_tag :force %>
|
||||
<%= label_tag :force %>
|
||||
<small>(When checked, the existing episodes' urls will be re-checked and episodes reachable and https fields will be updated accordingly if needed.)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= text_field_tag :limit, 5, size: 2 %>
|
||||
<%= label_tag :limit %>
|
||||
<small>(The number of episodes to fetch. When set to an empty string, last 1_000 episodes will be fetched.)</small>
|
||||
</div>
|
||||
<%= submit_tag "Fetch episodes", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="crayons-card p-6">
|
||||
<h4 class="mb-4">Manage Admins</h4>
|
||||
<% if @podcast.admins.present? %>
|
||||
<ul class="list-group list-group-flush mb-3">
|
||||
<% @podcast.admins.each do |admin| %>
|
||||
<%= form_for @podcast, url: remove_admin_admin_podcast_path(@podcast.id), html: { method: :delete, class: "form-inline" } do |f| %>
|
||||
<li class="list-group-item w-100">
|
||||
<%= link_to "@#{admin.username}", "/#{admin.username}" %>
|
||||
<%= f.hidden_field :user_id, value: admin.id %>
|
||||
<%= f.submit "Remove", class: "btn btn-danger btn-sm float-right" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p>There are no admins for this podcast.</p>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @podcast, url: add_admin_admin_podcast_path(@podcast.id), html: { method: :post } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Add Admin (by user_id)", for: "podcast_user_id" %>
|
||||
<%= f.text_field :user_id, value: "", class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Add Admin", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<% if @podcast.creator.present? %>
|
||||
<p>Created by <%= link_to "@#{@podcast.creator.username}", "/#{@podcast.creator.username}" %></p>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @podcast, url: add_admin_admin_podcast_path(@podcast.id), html: { method: :post } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Add Admin (by user_id)", for: "podcast_user_id" %>
|
||||
<%= f.text_field :user_id, value: "", class: "form-control" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h3>Edit Podcast</h3>
|
||||
<%= f.submit "Add Admin", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<h4 class="mb-4">Edit Podcast</h4>
|
||||
<%= form_for [:admin, @podcast] do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label :title, for: "podcast_title" %>
|
||||
<%= f.text_field :title, class: "form-control" %>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<%= form_for [:admin, @podcast] do |f| %>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<%= f.label :title, for: "podcast_title" %>
|
||||
<%= f.text_field :title, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :feed_url, for: "podcast_feed_url" %>
|
||||
<%= f.text_field :feed_url, class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<div class="form-group">
|
||||
<%= f.label :feed_url, for: "podcast_feed_url" %>
|
||||
<%= f.text_field :feed_url, class: "form-control" %>
|
||||
</div>
|
||||
</div>
|
||||
<%= f.submit class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,51 +1,43 @@
|
|||
<main>
|
||||
<section class="row m-3" role="search">
|
||||
<div class="col">
|
||||
<%= form_tag("/admin/podcasts", method: "get") do %>
|
||||
<div class="form-row justify-content-end">
|
||||
<div class="form-group">
|
||||
<%= text_field_tag(:search, params[:search], aria: { label: "Search" }) %>
|
||||
<%= submit_tag("Search") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
<%= form_tag("/admin/podcasts", method: "get", class: "mb-6") do %>
|
||||
<div class="form-group">
|
||||
<%= text_field_tag(:search, params[:search], aria: { label: "Search" }) %>
|
||||
<%= submit_tag("Search") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= paginate @podcasts %>
|
||||
<%= paginate @podcasts %>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Title</th>
|
||||
<th scope="col">Feed URL</th>
|
||||
<th scope="col">Eps</th>
|
||||
<th scope="col">Reach</th>
|
||||
<th scope="col">Pub</th>
|
||||
<th scope="col">Status Notice</th>
|
||||
<th scope="col">Admin</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @podcasts.each do |podcast| %>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Title</th>
|
||||
<th scope="col">Feed URL</th>
|
||||
<th scope="col">Eps</th>
|
||||
<th scope="col">Reach</th>
|
||||
<th scope="col">Pub</th>
|
||||
<th scope="col">Status Notice</th>
|
||||
<th scope="col">Admin</th>
|
||||
<td><%= podcast.id %></td>
|
||||
<td><%= link_to podcast.title, edit_admin_podcast_path(podcast) %></td>
|
||||
<td><%= link_to podcast.feed_url, podcast.feed_url %></td>
|
||||
<td><%= podcast.episodes_count %></td>
|
||||
<td><%= podcast.reachable %></td>
|
||||
<td><%= podcast.published %></td>
|
||||
<td><%= podcast.status_notice %></td>
|
||||
<td>
|
||||
<% podcast.admins.pluck(:username).each do |username| %>
|
||||
<%= link_to "@#{username}", "/#{username}" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @podcasts.each do |podcast| %>
|
||||
<tr>
|
||||
<td><%= podcast.id %></td>
|
||||
<td><%= link_to podcast.title, edit_admin_podcast_path(podcast) %></td>
|
||||
<td><%= link_to podcast.feed_url, podcast.feed_url %></td>
|
||||
<td><%= podcast.episodes_count %></td>
|
||||
<td><%= podcast.reachable %></td>
|
||||
<td><%= podcast.published %></td>
|
||||
<td><%= podcast.status_notice %></td>
|
||||
<td>
|
||||
<% podcast.admins.pluck(:username).each do |username| %>
|
||||
<%= link_to "@#{username}", "/#{username}" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @podcasts %>
|
||||
</main>
|
||||
<%= paginate @podcasts %>
|
||||
|
|
|
|||
|
|
@ -1,58 +1,54 @@
|
|||
<main>
|
||||
<section class="row m-3" role="search">
|
||||
<div class="col justify-content-end">
|
||||
<%= search_form_for @q, url: admin_privileged_reactions_path, class: "form-inline justify-content-end" do |f| %>
|
||||
<div class="mb-6">
|
||||
<%= search_form_for @q, url: admin_privileged_reactions_path, class: "form-inline" do |f| %>
|
||||
|
||||
<%= f.label :user_username_cont, "User", class: "sr-only" %>
|
||||
<%= f.search_field :user_username_cont, placeholder: "User", class: "form-control mx-3" %>
|
||||
<%= f.label :user_username_cont, "User", class: "sr-only" %>
|
||||
<%= f.search_field :user_username_cont, placeholder: "User", class: "form-control" %>
|
||||
|
||||
<%= f.select(
|
||||
:category_eq,
|
||||
options_for_select(["", "thumbsup", "thumbsdown", "vomit"], @q.category_eq),
|
||||
{},
|
||||
class: "custom-select mx-3",
|
||||
aria: { label: "Action" },
|
||||
) %>
|
||||
<%= f.select(
|
||||
:category_eq,
|
||||
options_for_select(["", "thumbsup", "thumbsdown", "vomit"], @q.category_eq),
|
||||
{},
|
||||
class: "custom-select mx-3",
|
||||
aria: { label: "Action" },
|
||||
) %>
|
||||
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= paginate @privileged_reactions %>
|
||||
<%= paginate @privileged_reactions %>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Action</th>
|
||||
<th scope="col">Content</th>
|
||||
<th scope="col">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @privileged_reactions.each do |reaction| %>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Action</th>
|
||||
<th scope="col">Content</th>
|
||||
<th scope="col">Date</th>
|
||||
<td><%= reaction.id %></td>
|
||||
<td><%= link_to reaction.user.username, admin_user_path(reaction.user_id) %></td>
|
||||
<td><%= reaction.reactable_type %></td>
|
||||
<td><%= reaction.category %></td>
|
||||
<td>
|
||||
<% if reaction.reactable_type == "Article" %>
|
||||
<%= link_to reaction.reactable.title, reaction.reactable.path %>
|
||||
<% elsif reaction.reactable_type == "User" %>
|
||||
<%= link_to reaction.reactable.username, reaction.reactable.path %>
|
||||
<% elsif reaction.reactable_type == "Comment" %>
|
||||
<%= link_to "#{reaction.reactable.user.username}'s Comment", reaction.reactable.path %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= reaction.created_at %></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @privileged_reactions.each do |reaction| %>
|
||||
<tr>
|
||||
<td><%= reaction.id %></td>
|
||||
<td><%= link_to reaction.user.username, admin_user_path(reaction.user_id) %></td>
|
||||
<td><%= reaction.reactable_type %></td>
|
||||
<td><%= reaction.category %></td>
|
||||
<td>
|
||||
<% if reaction.reactable_type == "Article" %>
|
||||
<%= link_to reaction.reactable.title, reaction.reactable.path %>
|
||||
<% elsif reaction.reactable_type == "User" %>
|
||||
<%= link_to reaction.reactable.username, reaction.reactable.path %>
|
||||
<% elsif reaction.reactable_type == "Comment" %>
|
||||
<%= link_to "#{reaction.reactable.user.username}'s Comment", reaction.reactable.path %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= reaction.created_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @privileged_reactions %>
|
||||
</main>
|
||||
<%= paginate @privileged_reactions %>
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
<main id="profileFields">
|
||||
<% @grouped_profile_fields.each do |group| %>
|
||||
<% group_name = group.name.gsub(/\s+/, "_") %>
|
||||
<article class="row my-3">
|
||||
<div class="card w-100">
|
||||
<div class="card-header" id="<%= group_name %>Header" data-toggle="collapse"
|
||||
data-target="#<%= group_name %>BodyContainer" aria-expanded="false" aria-controls="<%= group_name %>BodyContainer">
|
||||
<div>
|
||||
<h2 class="d-inline"><%= group_name %></h2>
|
||||
<% if group.description %>
|
||||
<div><%= group.description %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div> Toggle <%= group_name %></div>
|
||||
</div>
|
||||
<div id="<%= group_name %>BodyContainer" class="collapse hide hide p-3" aria-labelledby="<%= group %>Header">
|
||||
<% group.profile_fields.each do |field| %>
|
||||
<div class="card mt-3">
|
||||
<%= render partial: "admin/configs/card_header",
|
||||
locals: {
|
||||
header: field.label,
|
||||
state: "collapse",
|
||||
target: "#{field.attribute_name}_container",
|
||||
expanded: "false"
|
||||
} %>
|
||||
<div id="<%= field.attribute_name %>_container" class="card-body collapse hide" aria-labelledby="<%= field.attribute_name %>_container">
|
||||
<div class="form-group grid p-6 mb-6 gap-1">
|
||||
<%= form_for [:admin, field] do |form| %>
|
||||
<%= render "form", form: form %>
|
||||
<%= form.submit class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<%= button_to "Delete Profile Field", admin_profile_field_path(field), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-secondary" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<header class="mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl">Profile fields</h2>
|
||||
</header>
|
||||
|
||||
<% @grouped_profile_fields.each do |group| %>
|
||||
<% group_name = group.name.gsub(/\s+/, "_") %>
|
||||
<div class="crayons-card">
|
||||
<div class="card-header flex" id="<%= group_name %>Header" data-toggle="collapse"
|
||||
data-target="#<%= group_name %>BodyContainer" aria-expanded="false" aria-controls="<%= group_name %>BodyContainer">
|
||||
<div>
|
||||
<h2 class="d-inline"><%= group_name %></h2>
|
||||
<% if group.description %>
|
||||
<div><%= group.description %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</article>
|
||||
<% end %>
|
||||
</div>
|
||||
<button class="btn btn-secondary ml-auto" type="button">Toggle <%= group_name %></button>
|
||||
</div>
|
||||
<div id="<%= group_name %>BodyContainer" class="collapse hide p-3" aria-labelledby="<%= group %>Header">
|
||||
<% group.profile_fields.each do |field| %>
|
||||
<div class="card mb-3">
|
||||
<%= render partial: "admin/configs/card_header",
|
||||
locals: {
|
||||
header: field.label,
|
||||
state: "collapse",
|
||||
target: "#{field.attribute_name}_container",
|
||||
expanded: "false"
|
||||
} %>
|
||||
<div id="<%= field.attribute_name %>_container" class="collapse hide" aria-labelledby="<%= field.attribute_name %>_container">
|
||||
<div class="form-group grid p-6 mb-6 gap-1">
|
||||
<%= form_for [:admin, field] do |form| %>
|
||||
<%= render "form", form: form %>
|
||||
<%= form.submit class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<%= button_to "Delete Profile Field", admin_profile_field_path(field), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-secondary" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<%= form_with(model: [:admin, response_template], local: true, html: { class: "mb-5" }) do |f| %>
|
||||
<%= form_with(model: [:admin, response_template], local: true, html: { class: "crayons-card p-6" }) do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label :type_of, "Type of Response Template" %>
|
||||
<% type_of_options = [["Mod Comment", "mod_comment"], ["Personal Comment", "personal_comment"], %w[Email email_reply], ["Abuse Report Email", "abuse_report_email_reply"]] %>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<h2>Editing <%= @response_template.title %></h2>
|
||||
<header class="flex items-center mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl">Edit: <%= @response_template.title %></h2>
|
||||
<%= form_with(model: [:admin, @response_template], local: true, class: "ml-auto", method: :delete, html: { onsubmit: "return confirm('Are you sure you want to delete this response template?')" }) do |f| %>
|
||||
<%= f.submit "Delete", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
</header>
|
||||
|
||||
<%= render "form", response_template: @response_template %>
|
||||
<%= form_with(model: [:admin, @response_template], local: true, method: :delete, html: { onsubmit: "return confirm('Are you sure you want to delete this response template?')" }) do |f| %>
|
||||
<%= f.submit "Delete Response Template", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
<header class="flex items-center mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl">Response templates</h2>
|
||||
<a href="<%= new_admin_response_template_path %>" class="btn btn-primary ml-auto" role="button">Create new template</a>
|
||||
</header>
|
||||
|
||||
<%= paginate @response_templates %>
|
||||
<table class="table">
|
||||
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Title</th>
|
||||
|
|
@ -7,7 +13,7 @@
|
|||
<th scope="col">User ID</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="crayons-card">
|
||||
<% @response_templates.each do |response_template| %>
|
||||
<tr>
|
||||
<td>
|
||||
|
|
@ -26,5 +32,3 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<%= paginate @response_templates %>
|
||||
|
||||
<a href="<%= new_admin_response_template_path %>" class="btn btn-primary" role="button">Create a New Response Template</a>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
<h2>Create a New Response Template</h2>
|
||||
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6">Create template</h2>
|
||||
|
||||
<%= render "form", response_template: @response_template %>
|
||||
|
|
|
|||
|
|
@ -1,31 +1,29 @@
|
|||
<main>
|
||||
|
||||
<% if !@vault_enabled %>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<div class="crayons-notice crayons-notice--info mb-6" role="alert">
|
||||
<p>
|
||||
Vault is not currently setup for your application. This means your secrets are being stored as ENV variables and cannot be updated here. To update them you will need to update the appropriate files in your environment.
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Secret Name</th>
|
||||
<th scope="col">Secret Value</th>
|
||||
<th scope="col">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @secrets.each do |key, partial_value| %>
|
||||
<tr>
|
||||
<th scope="col">Secret Name</th>
|
||||
<th scope="col">Secret Value</th>
|
||||
<th scope="col">Action</th>
|
||||
<%= form_with(url: "/admin/secrets", method: "PUT", local: true) do %>
|
||||
<td><%= label_tag key, key %></td>
|
||||
<td><%= text_field_tag key, partial_value %></td>
|
||||
<td><%= submit_tag("Update", data: { confirm: "My username is @#{current_user.username} and I want to update this Vault Secret." }, disabled: !@vault_enabled) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @secrets.each do |key, partial_value| %>
|
||||
<tr>
|
||||
<%= form_with(url: "/admin/secrets", method: "PUT", local: true) do %>
|
||||
<td><%= label_tag key, key %></td>
|
||||
<td><%= text_field_tag key, partial_value %></td>
|
||||
<td>
|
||||
<%= submit_tag("Update", data: { confirm: "My username is @#{current_user.username} and I want to update this Vault Secret." }, disabled: !@vault_enabled) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</main
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="mt-4">
|
||||
<% Admin::ApplicationController::MENU_ITEMS.each do |menu_item| %>
|
||||
<a class="sidebar-nav-item px-2 <%= "active" if request.path.include?(menu_item[:controller]) %>" href="/admin/<%= menu_item[:controller] %>"><%= menu_item[:name].to_s.titleize %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% Admin::ApplicationController::MENU_ITEMS.each do |menu_item| %>
|
||||
<a class="crayons-link crayons-link--block <%= "crayons-link--current" if request.path.include?(menu_item[:controller]) %>" href="/admin/<%= menu_item[:controller] %>">
|
||||
<%= menu_item[:name].to_s.titleize %>
|
||||
</a>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,55 +1,57 @@
|
|||
<h3><%= "Edit Sponsorship ##{@sponsorship.id}" %></h3>
|
||||
<%= form_for [:admin, @sponsorship] do |f| %>
|
||||
<div class="form-group">
|
||||
Creator: <%= link_to "@#{@sponsorship.user.username}", "/#{@sponsorship.user.username}" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Organization: <%= link_to "@#{@sponsorship.organization.username}", "/#{@sponsorship.organization.username}" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Created at: <%= f.object.created_at.strftime("%d %B %Y %H:%M UTC") %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Level: <%= @sponsorship.level %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<% if @sponsorship.sponsorable.is_a?(ActsAsTaggableOn::Tag) %>
|
||||
Sponsorable: <%= link_to @sponsorship.sponsorable.name, "/t/#{@sponsorship.sponsorable.name}" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :status %>
|
||||
<%= f.select :status, Sponsorship::STATUSES %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :expires_at %>
|
||||
<%= f.datetime_select :expires_at, required: true, start_year: Time.current.year, end_year: Time.current.year + 2, class: "form-control" %> UTC Time
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :tagline %>
|
||||
<%= f.text_field :tagline, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :url %>
|
||||
<%= f.text_field :url, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :blurb_html %>
|
||||
<%= f.text_area :blurb_html, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :featured_number %>
|
||||
<%= f.text_field :featured_number, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :instructions %>
|
||||
<%= f.text_field :instructions, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :instructions_updated_at %>
|
||||
<%= f.datetime_select :instructions_updated_at, required: true, start_year: Time.current.year, end_year: Time.current.year + 2, class: "form-control" %> UTC Time
|
||||
</div>
|
||||
<%= f.submit "Update Sponsorship", class: "btn btn-primary" %>
|
||||
<%= link_to "Destroy Sponsorship", url_for(action: :destroy, id: @sponsorship.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger float-right" %>
|
||||
<% end %>
|
||||
<hr />
|
||||
<h2 class="fs-2xl s:fs-3xl mb-6"><%= "Edit Sponsorship ##{@sponsorship.id}" %></h2>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<%= form_for [:admin, @sponsorship] do |f| %>
|
||||
<div class="form-group">
|
||||
Creator: <%= link_to "@#{@sponsorship.user.username}", "/#{@sponsorship.user.username}" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Organization: <%= link_to "@#{@sponsorship.organization.username}", "/#{@sponsorship.organization.username}" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Created at: <%= f.object.created_at.strftime("%d %B %Y %H:%M UTC") %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Level: <%= @sponsorship.level %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<% if @sponsorship.sponsorable.is_a?(ActsAsTaggableOn::Tag) %>
|
||||
Sponsorable: <%= link_to @sponsorship.sponsorable.name, "/t/#{@sponsorship.sponsorable.name}" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :status %>
|
||||
<%= f.select :status, Sponsorship::STATUSES %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :expires_at %>
|
||||
<%= f.datetime_select :expires_at, required: true, start_year: Time.current.year, end_year: Time.current.year + 2, class: "form-control" %> UTC Time
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :tagline %>
|
||||
<%= f.text_field :tagline, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :url %>
|
||||
<%= f.text_field :url, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :blurb_html %>
|
||||
<%= f.text_area :blurb_html, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :featured_number %>
|
||||
<%= f.text_field :featured_number, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :instructions %>
|
||||
<%= f.text_field :instructions, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :instructions_updated_at %>
|
||||
<%= f.datetime_select :instructions_updated_at, required: true, start_year: Time.current.year, end_year: Time.current.year + 2, class: "form-control" %> UTC Time
|
||||
</div>
|
||||
<%= f.submit "Update Sponsorship", class: "btn btn-primary" %>
|
||||
<%= link_to "Destroy Sponsorship", url_for(action: :destroy, id: @sponsorship.id), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<%= paginate @sponsorships %>
|
||||
|
||||
<table class="table">
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="crayons-card">
|
||||
<% @sponsorships.each do |sponsorship| %>
|
||||
<tr>
|
||||
<td><%= link_to sponsorship.id, edit_admin_sponsorship_path(sponsorship) %></td>
|
||||
|
|
|
|||
|
|
@ -1,59 +1,54 @@
|
|||
<main>
|
||||
<section class="row m-3" role="search">
|
||||
<div class="col">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<a href="/admin/tags" class="nav-link <%= "active" if params[:state].blank? %>">All</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/admin/tags?state=supported" class="nav-link <%= "active" if params[:state] == "supported" %>">Supported</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/admin/tags?state=unsupported" class="nav-link <%= "active" if params[:state] == "unsupported" %>">Unsupported</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= form_tag(admin_tags_path, method: "get") do %>
|
||||
<div class="form-row justify-content-end">
|
||||
<div class="form-group">
|
||||
<%= text_field_tag(:search, params[:search], aria: { label: "Search" }) %>
|
||||
<% if params[:state].present? %>
|
||||
<%= hidden_field_tag(:state, params[:state]) %>
|
||||
<% end %>
|
||||
<%= submit_tag("Search") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
<div class="flex items-center mb-6">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<a href="/admin/tags" class="nav-link <%= "active" if params[:state].blank? %>">All</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/admin/tags?state=supported" class="nav-link <%= "active" if params[:state] == "supported" %>">Supported</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/admin/tags?state=unsupported" class="nav-link <%= "active" if params[:state] == "unsupported" %>">Unsupported</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<%= paginate @tags %>
|
||||
<div class="ml-auto">
|
||||
<%= form_tag(admin_tags_path, method: "get") do %>
|
||||
<div class="form-group">
|
||||
<%= text_field_tag(:search, params[:search], aria: { label: "Search" }) %>
|
||||
<% if params[:state].present? %>
|
||||
<%= hidden_field_tag(:state, params[:state]) %>
|
||||
<% end %>
|
||||
<%= submit_tag("Search") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<%= paginate @tags %>
|
||||
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Tag</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Alias For</th>
|
||||
<th scope="col">Taggings Count</th>
|
||||
<th scope="col">Category</th>
|
||||
<th scope="col">Is Moderated?</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @tags.each do |tag| %>
|
||||
<tr>
|
||||
<th scope="col">Tag</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Alias For</th>
|
||||
<th scope="col">Taggings Count</th>
|
||||
<th scope="col">Category</th>
|
||||
<th scope="col">Is Moderated?</th>
|
||||
<td><%= link_to tag.name, admin_tag_path(tag.id) %></td>
|
||||
<td><%= tag.id %></td>
|
||||
<td><%= tag.alias_for %></td>
|
||||
<td><%= tag.taggings_count %></td>
|
||||
<td><%= tag.category %></td>
|
||||
<td><%= tag.tag_moderator_ids.any? %></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @tags.each do |tag| %>
|
||||
<tr>
|
||||
<td><%= link_to tag.name, admin_tag_path(tag.id) %></td>
|
||||
<td><%= tag.id %></td>
|
||||
<td><%= tag.alias_for %></td>
|
||||
<td><%= tag.taggings_count %></td>
|
||||
<td><%= tag.category %></td>
|
||||
<td><%= tag.tag_moderator_ids.any? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @tags %>
|
||||
</main>
|
||||
<%= paginate @tags %>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
<main class="row">
|
||||
<div class="col-12">
|
||||
<h2>
|
||||
<a href="/t/<%= @tag.name %>" style="background:<%= @tag.bg_color_hex %>;color:<%= @tag.text_color_hex %>;">#<%= @tag.name %></a>, tagged <%= @tag.taggings_count %> times.
|
||||
</h2>
|
||||
<header class="flex mb-6 items-center">
|
||||
<div>
|
||||
<h2 class="fs-2xl s:fs-3xl"><span class="crayons-tag crayons-tag--2xl" style="background:<%= @tag.bg_color_hex %>;color:<%= @tag.text_color_hex %>;">#<%= @tag.name %></span></h2>
|
||||
<p>Tagged <%= @tag.taggings_count %> times</p>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<h3>Moderators</h3>
|
||||
|
||||
<div class="ml-auto">
|
||||
<a href="/t/<%= @tag.name %>">View</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="grid gap-6">
|
||||
<div class="crayons-card p-6">
|
||||
<h4 class="mb-4">Moderators</h4>
|
||||
<% if @tag.tag_moderator_ids.any? %>
|
||||
<ul class="list-group-flush">
|
||||
<% @tag.tag_moderator_ids.each do |id| %>
|
||||
|
|
@ -30,9 +36,10 @@
|
|||
<%= f.submit "Add Moderator", class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<h4 class="mb-4">Edit details</h4>
|
||||
<%= form_for [:admin, @tag] do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label :supported %>
|
||||
|
|
@ -84,4 +91,4 @@
|
|||
<%= f.submit class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,43 +1,31 @@
|
|||
<main>
|
||||
<h2>General Purpose URL Purge</h2>
|
||||
<p>For a page that should 404. This will purge the page via Fastly.</p>
|
||||
<p>Use the full path (<%= app_url("xyz") %>) or the relative path: (/xyz)</p>
|
||||
<div class="row m-3">
|
||||
<%= form_tag bust_cache_admin_tools_path do %>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<%= label_tag :dead_link, "Link:" %>
|
||||
<%= text_field_tag :dead_link, nil, placeholder: "/xyz" %>
|
||||
<%= submit_tag("Clear Cache") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="crayons-card p-6 mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-4">General Purpose URL Purge</h2>
|
||||
<p class="mb-2">For a page that should 404. This will purge the page via Fastly.</p>
|
||||
<p class="mb-6">Use the full path (<%= app_url("xyz") %>) or the relative path: (/xyz)</p>
|
||||
<%= form_tag bust_cache_admin_tools_path do %>
|
||||
<div class="form-group">
|
||||
<%= label_tag :dead_link, "Link:" %>
|
||||
<%= text_field_tag :dead_link, nil, placeholder: "/xyz" %>
|
||||
<%= submit_tag("Clear Cache") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>Bust Cache For Specific Content</h2>
|
||||
<p>This clears both the Rails cache & the Fastly cache.</p>
|
||||
<div class="row m-3">
|
||||
<div class="crayons-card p-6">
|
||||
<h2 class="fs-2xl s:fs-3xl mb-4">Bust Cache For Specific Content</h2>
|
||||
<p class="mb-6">This clears both the Rails cache & the Fastly cache.</p>
|
||||
<%= form_tag bust_cache_admin_tools_path do %>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<%= label_tag :bust_article, "Article ID:" %>
|
||||
<%= text_field_tag :bust_article, nil, placeholder: "12345" %>
|
||||
<%= submit_tag("Clear Article Cache") %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= label_tag :bust_article, "Article ID:" %>
|
||||
<%= text_field_tag :bust_article, nil, placeholder: "12345" %>
|
||||
<%= submit_tag("Clear Article Cache") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="row m-3">
|
||||
<%= form_tag bust_cache_admin_tools_path do %>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<%= label_tag :bust_user, "User ID:" %>
|
||||
<%= text_field_tag :bust_user, nil, placeholder: "12345" %>
|
||||
<%= submit_tag("Clear User Cache") %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= label_tag :bust_user, "User ID:" %>
|
||||
<%= text_field_tag :bust_user, nil, placeholder: "12345" %>
|
||||
<%= submit_tag("Clear User Cache") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,24 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h2>Activity</h2>
|
||||
<ul>
|
||||
<li><%= @user.comments_count %> comments</li>
|
||||
<li><%= @user.articles_count %> articles</li>
|
||||
<li><%= @user.reactions_count %> reactions</li>
|
||||
<li><%= @user.followers_count %> followers</li>
|
||||
<li><%= @user.following_users_count %> users following</li>
|
||||
<li><%= @user.badge_achievements_count %> badges</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<h2>Current Roles</h2>
|
||||
<p>(view full history in notes below)</p>
|
||||
<ul>
|
||||
<% @user.roles.each do |role| %>
|
||||
<li><%= role.name %> <em><%= "- " + Tag.find(role.resource_id).name if role.resource_id.present? %></em></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="crayons-card p-6">
|
||||
<div class="grid grid-cols-2">
|
||||
<div>
|
||||
<h2>Activity</h2>
|
||||
<ul>
|
||||
<li><%= @user.comments_count %> comments</li>
|
||||
<li><%= @user.articles_count %> articles</li>
|
||||
<li><%= @user.reactions_count %> reactions</li>
|
||||
<li><%= @user.followers_count %> followers</li>
|
||||
<li><%= @user.following_users_count %> users following</li>
|
||||
<li><%= @user.badge_achievements_count %> badges</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Current Roles</h2>
|
||||
<p>(view full history in notes below)</p>
|
||||
<ul>
|
||||
<% @user.roles.each do |role| %>
|
||||
<li><%= role.name %> <em><%= "- " + Tag.find(role.resource_id).name if role.resource_id.present? %></em></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Credits</h2>
|
||||
<hr>
|
||||
<div class="crayons-card p-6 grid gap-6">
|
||||
<h2>Credits</h2>
|
||||
|
||||
<div>
|
||||
<h4 class="mt-3"><%= @user.username %></h4>
|
||||
<% current_credits = @user.unspent_credits_count %>
|
||||
<p>Available User Credits: <%= current_credits %></p>
|
||||
|
|
@ -21,28 +21,27 @@
|
|||
<%= f.submit "Remove Credits", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<% if @organizations.present? %>
|
||||
<div class="col-12">
|
||||
<h4>Organizations</h4>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :add_org_credits, in: 1...10_000, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
<%= f.select :organization_id, orgs_with_credits(@organizations), {}, { class: "form-control" } %>
|
||||
</div>
|
||||
<%= f.submit "Add Org Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :remove_org_credits, in: 1...10_000, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
<%= f.select :organization_id, orgs_with_credits(@organizations), {}, { class: "form-control" } %>
|
||||
</div>
|
||||
<%= f.submit "Remove Org Credits", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
<hr>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Organizations</h4>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :add_org_credits, in: 1...10_000, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
<%= f.select :organization_id, orgs_with_credits(@organizations), {}, { class: "form-control" } %>
|
||||
</div>
|
||||
<%= f.submit "Add Org Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :remove_org_credits, in: 1...10_000, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
<%= f.select :organization_id, orgs_with_credits(@organizations), {}, { class: "form-control" } %>
|
||||
</div>
|
||||
<%= f.submit "Remove Org Credits", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h2>Email Tools</h2>
|
||||
<div class="crayons-card p-6 grid gap-6">
|
||||
<h2>Email Tools</h2>
|
||||
|
||||
<div>
|
||||
<%= form_with url: verify_email_ownership_admin_user_path(@user), local: true do |f| %>
|
||||
Email last verified at: <%= @last_email_verification_date %>
|
||||
<%= f.hidden_field(:user_id, value: @user.id) %>
|
||||
<%= f.submit "Verify Email Ownership", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
<div>
|
||||
<h3>Email <%= @user.name %></h3>
|
||||
<%= form_with url: send_email_admin_user_path(@user), local: true do |f| %>
|
||||
<%= f.hidden_field(:user_id, value: @user.id) %>
|
||||
|
|
@ -18,10 +20,8 @@
|
|||
<%= f.submit "Send Email", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<div>
|
||||
<h3>Recent Emails</h3>
|
||||
<div class="list-group-flush">
|
||||
<% @user.email_messages.order(sent_at: :desc).limit(50).each do |email| %>
|
||||
|
|
|
|||
|
|
@ -1,28 +1,26 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Recent Notes (last 10)</h2>
|
||||
|
||||
<% unless @notes.load.empty? %>
|
||||
<% @notes.each do |note| %>
|
||||
<p>
|
||||
<em>
|
||||
<%= note.created_at.strftime("%d %B %Y %H:%M UTC") %> by <%= User.find(note.author_id).username if note.author_id.present? %>
|
||||
</em> -
|
||||
<% unless note.reason.blank? %>
|
||||
<strong><%= note.reason %>:</strong>
|
||||
<% end %>
|
||||
<%= note.content %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>No notes yet!</em></p>
|
||||
<div class="crayons-card p-6">
|
||||
<h2 class="mb-6">Recent Notes (last 10)</h2>
|
||||
|
||||
<% unless @notes.load.empty? %>
|
||||
<% @notes.each do |note| %>
|
||||
<p>
|
||||
<em>
|
||||
<%= note.created_at.strftime("%d %B %Y %H:%M UTC") %> by <%= User.find(note.author_id).username if note.author_id.present? %>
|
||||
</em> -
|
||||
<% unless note.reason.blank? %>
|
||||
<strong><%= note.reason %>:</strong>
|
||||
<% end %>
|
||||
<%= note.content %>
|
||||
</p>
|
||||
<% end %>
|
||||
<%= form_with model: @user, url: admin_user_path(@user), method: :patch, html: { class: "mb-2" }, local: true do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Add new note: ", class: "d-block" %>
|
||||
<%= f.text_area :new_note, class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Submit Note", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="crayons-notice mb-6">No notes yet...</div>
|
||||
<% end %>
|
||||
<%= form_with model: @user, url: admin_user_path(@user), method: :patch, html: { class: "mb-2" }, local: true do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Add new note: ", class: "d-block" %>
|
||||
<%= f.text_area :new_note, class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Submit Note", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Organization Memberships</h2>
|
||||
<div class="crayons-card p-6 grid gap-6">
|
||||
<h2>Organization Memberships</h2>
|
||||
|
||||
<div>
|
||||
<h3>Add to New Organization</h3>
|
||||
<%= form_with model: [:admin, OrganizationMembership.new], local: true, html: { class: "form-inline justify-content-between my-3" } do |f| %>
|
||||
<%= f.hidden_field :user_id, value: @user.id %>
|
||||
|
|
@ -14,7 +15,10 @@
|
|||
<%= f.submit "Add to Org", class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% unless @organization_memberships.load.empty? %>
|
||||
</div>
|
||||
|
||||
<% unless @organization_memberships.load.empty? %>
|
||||
<div>
|
||||
<h3>Manage Memberships</h3>
|
||||
<table class='table'>
|
||||
<tbody>
|
||||
|
|
@ -43,6 +47,6 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2 class="d-inline">
|
||||
<div class="grid gap-6">
|
||||
<div class="crayons-card p-6">
|
||||
<h2>
|
||||
<%= @user.name %><%= link_to "@#{@user.username}", @user.path, class: "ml-2", target: "_blank", rel: "noopener" %>
|
||||
</h2>
|
||||
|
||||
|
|
@ -12,25 +12,26 @@
|
|||
<a href="<%= admin_user_path(@user) %>" class="btn btn-primary float-right">admin Profile</a>
|
||||
<p class="font-italic">Member since <%= @user.created_at.strftime("%b %e '%y") %></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "activity" %>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2 class="d-inline">User Status</h2>
|
||||
<h3 class="float-right">
|
||||
<% if @user.banned %>
|
||||
<span class="badge badge-danger">🚨 Member is Suspended 🚨</span>
|
||||
<% elsif @user.warned %>
|
||||
<span class="badge badge-warning">Member is Warned</span>
|
||||
<% elsif @user.comment_banned %>
|
||||
<span class="badge badge-warning">Member is Comment Banned</span>
|
||||
<% elsif @user.trusted %>
|
||||
<span class="badge badge-success">Member is Trusted</span>
|
||||
<% else %>
|
||||
<span class="badge badge-info">Member is in Good Standing</span>
|
||||
<% end %>
|
||||
</h3>
|
||||
<%= render "activity" %>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2>
|
||||
User Status
|
||||
<% if @user.banned %>
|
||||
<span class="badge badge-danger">🚨 Member is Suspended 🚨</span>
|
||||
<% elsif @user.warned %>
|
||||
<span class="badge badge-warning">Member is Warned</span>
|
||||
<% elsif @user.comment_banned %>
|
||||
<span class="badge badge-warning">Member is Comment Banned</span>
|
||||
<% elsif @user.trusted %>
|
||||
<span class="badge badge-success">Member is Trusted</span>
|
||||
<% else %>
|
||||
<span class="badge badge-info">Member is in Good Standing</span>
|
||||
<% end %>
|
||||
</h2>
|
||||
</div>
|
||||
<%= form_for(@user, url: user_status_admin_user_path(@user), html: { class: "mt-3" }) do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Select new user status", class: "mr-3" %>
|
||||
|
|
@ -45,130 +46,131 @@
|
|||
<%= f.submit "Update User Status", class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "notes" %>
|
||||
<%= render "notes" %>
|
||||
|
||||
<div class="row my-3">
|
||||
<div class="col-12">
|
||||
<h2 class="d-inline">Remove Identity</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#identity-row" class="btn btn-secondary float-right">Toggle</button>
|
||||
</div>
|
||||
<div class="col-12 collapse" id="identity-row">
|
||||
<p>Removing a social account identity can solve certain sign in issues, for example:</p>
|
||||
<ul>
|
||||
<li>
|
||||
They created an account on <%= community_name %>, but deleted their original social account and recreated it with the same Twitter/GitHub username.
|
||||
This will be true if their Twitter/GitHub account's UID does not match their identity's UID. You can use the following third party tools to check:
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://tweeterid.com/?username=<%= @user.twitter_username %>" target="_blank" rel="noopener nofollow">Tweeter ID for Twitter (username is in URL for reference)</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://caius.github.io/github_id/#<%= @user.github_username %>" target="_blank" rel="noopener nofollow">Caius's GitHub ID Lookup Tool</a>
|
||||
</li>
|
||||
</ul>
|
||||
Steps to check:
|
||||
<ol>
|
||||
<li>Click one of the links to check their social account's UID.</li>
|
||||
<li>Confirm whether or not it matches with the identity's UID.</li>
|
||||
<li>If it doesn't match, delete the respective identity.</li>
|
||||
<li>Ask the user to reauthorize their social account via <%= app_url(user_settings_path(:account)) %></li>
|
||||
</ol>
|
||||
</li>
|
||||
<% @user.identities.each do |identity| %>
|
||||
<%= form_for(@user, url: remove_identity_admin_user_path(@user), html: { method: :delete, onsubmit: "return confirm('Are you sure? This should only be done as a solution for the listed example(s).)" }) do |f| %>
|
||||
<%= f.hidden_field :identity_id, value: identity.id %>
|
||||
<p><b><%= identity.provider.capitalize %> UID: <%= identity.uid %> - Username: <%= identity.auth_data_dump.present? ? identity.auth_data_dump["info"]["nickname"] : "no auth data dump available! 😞" %></b></p>
|
||||
<%= f.submit "Delete #{identity.provider.capitalize} Identity", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<h3>This should be done only do this if you are certain the user is having the specific problem(s) listed above.</h3>
|
||||
<% if @user.backup_data.any? %>
|
||||
<hr>
|
||||
<h2>Recover a deleted identity:</h2>
|
||||
<ul>
|
||||
<% @user.backup_data.where(instance_type: "Identity").each do |data| %>
|
||||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Remove Identity</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#identity-row" class="btn btn-secondary float-right">Toggle</button>
|
||||
</div>
|
||||
<div class="pt-6 collapse" id="identity-row">
|
||||
<p>Removing a social account identity can solve certain sign in issues, for example:</p>
|
||||
<ul>
|
||||
<li>
|
||||
They created an account on <%= community_name %>, but deleted their original social account and recreated it with the same Twitter/GitHub username.
|
||||
This will be true if their Twitter/GitHub account's UID does not match their identity's UID. You can use the following third party tools to check:
|
||||
<ul>
|
||||
<li>
|
||||
<%= "#{data.json_data['provider'].capitalize} #{data.instance_type} - UID: #{data.json_data['uid']}" %>
|
||||
<%= form_for(@user, url: recover_identity_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Please confirm you want to recover the #{data.json_data['provider'].capitalize} identity.')" }) do |f| %>
|
||||
<%= f.hidden_field :backup_data_id, value: data.id %>
|
||||
<%= f.submit "Recover #{data.json_data['provider'].capitalize} Identity" %>
|
||||
<% end %>
|
||||
<a href="https://tweeterid.com/?username=<%= @user.twitter_username %>" target="_blank" rel="noopener nofollow">Tweeter ID for Twitter (username is in URL for reference)</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://caius.github.io/github_id/#<%= @user.github_username %>" target="_blank" rel="noopener nofollow">Caius's GitHub ID Lookup Tool</a>
|
||||
</li>
|
||||
</ul>
|
||||
Steps to check:
|
||||
<ol>
|
||||
<li>Click one of the links to check their social account's UID.</li>
|
||||
<li>Confirm whether or not it matches with the identity's UID.</li>
|
||||
<li>If it doesn't match, delete the respective identity.</li>
|
||||
<li>Ask the user to reauthorize their social account via <%= app_url(user_settings_path(:account)) %></li>
|
||||
</ol>
|
||||
</li>
|
||||
<% @user.identities.each do |identity| %>
|
||||
<%= form_for(@user, url: remove_identity_admin_user_path(@user), html: { method: :delete, onsubmit: "return confirm('Are you sure? This should only be done as a solution for the listed example(s).)" }) do |f| %>
|
||||
<%= f.hidden_field :identity_id, value: identity.id %>
|
||||
<p><b><%= identity.provider.capitalize %> UID: <%= identity.uid %> - Username: <%= identity.auth_data_dump.present? ? identity.auth_data_dump["info"]["nickname"] : "no auth data dump available! 😞" %></b></p>
|
||||
<%= f.submit "Delete #{identity.provider.capitalize} Identity", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 mb-5">
|
||||
<h2 class="d-inline">Destructive Actions</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#destructive-actions" class="btn btn-secondary float-right">Toggle</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="destructive-actions" class="row collapse">
|
||||
<div class="col-12">
|
||||
<h3>Merge User</h3>
|
||||
<p>To merge a duplicate account, make sure you are currently on the page of the user you want to KEEP. Below, add the user id of the account to merge information from, and delete.</p>
|
||||
<%= form_for(@user, url: merge_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Merging will delete all the other users content and combine it with this user')" }) do |f| %>
|
||||
<%= f.label "User to be deleted:" %>
|
||||
<%= f.text_field :merge_user_id, placeholder: "#ID" %>
|
||||
<%= f.submit "Merge Users", class: "btn btn-danger float-right" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<h3>This should be done only do this if you are certain the user is having the specific problem(s) listed above.</h3>
|
||||
<% if @user.backup_data.any? %>
|
||||
<hr>
|
||||
<h2>Recover a deleted identity:</h2>
|
||||
<ul>
|
||||
<% @user.backup_data.where(instance_type: "Identity").each do |data| %>
|
||||
<li>
|
||||
<%= "#{data.json_data['provider'].capitalize} #{data.instance_type} - UID: #{data.json_data['uid']}" %>
|
||||
<%= form_for(@user, url: recover_identity_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Please confirm you want to recover the #{data.json_data['provider'].capitalize} identity.')" }) do |f| %>
|
||||
<%= f.hidden_field :backup_data_id, value: data.id %>
|
||||
<%= f.submit "Recover #{data.json_data['provider'].capitalize} Identity" %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 my-2">
|
||||
<h3>Banish User</h3>
|
||||
<% if @user.comments.where("created_at < ?", 100.days.ago).empty? && @user.created_at < 100.days.ago %>
|
||||
<p>
|
||||
<em>This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.</em>
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %>
|
||||
<button class="btn btn-danger float-right">🚫 Banish User for Spam 🚫</button>
|
||||
<% end %>
|
||||
<% elsif current_user.has_role?(:super_admin) || current_user.has_role?(:support_admin) %>
|
||||
<p><strong>This is not a new user.</strong> You are only allowed to take this action because you are a
|
||||
<strong>super admin or a support admin.</strong></p>
|
||||
<p>
|
||||
<em>This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.</em>
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %>
|
||||
<button class="btn btn-danger float-right">Banish User for Spam!</button>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>This is not a new user. Only super admins or support admins are allowed to banish this user.</em></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if current_user.has_role?(:super_admin) %>
|
||||
<div class="col-12 my-2">
|
||||
<h3>Delete User & Turn Content Into Ghost</h3>
|
||||
<p>This will
|
||||
<strong>completely destroy the user</strong> and convert all of their articles & comments into a ghost author. This action is irreversible.
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: full_delete_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? 👻 This is extremely destructive and irreversible. The user will be deleted and their articles & comments will be converted to Ghost')" }) do |f| %>
|
||||
<%= f.hidden_field :ghostify, value: true %>
|
||||
<button class="btn btn-danger float-right">👻 Fully Delete User & Ghostify 👻</button>
|
||||
<% end %>
|
||||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Destructive Actions</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#destructive-actions" class="btn btn-secondary float-right">Toggle</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12 my-2">
|
||||
<h3>Fully Delete User</h3>
|
||||
<p>This will
|
||||
<strong>completely destroy the user</strong> and all of their activity from our database. This action is irreversible.
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: full_delete_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible.')" }) do |f| %>
|
||||
<%= f.hidden_field :ghostify, value: false %>
|
||||
<button class="btn btn-danger float-right">☠️ Fully Delete User & All Activity ☠️</button>
|
||||
<div id="destructive-actions" class="pt-6 collapse">
|
||||
<div class="mb-6">
|
||||
<h3>Merge User</h3>
|
||||
<p>To merge a duplicate account, make sure you are currently on the page of the user you want to KEEP. Below, add the user id of the account to merge information from, and delete.</p>
|
||||
<%= form_for(@user, url: merge_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Merging will delete all the other users content and combine it with this user')" }) do |f| %>
|
||||
<%= f.label "User to be deleted:" %>
|
||||
<%= f.text_field :merge_user_id, placeholder: "#ID" %>
|
||||
<%= f.submit "Merge Users", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<h3>Banish User</h3>
|
||||
<% if @user.comments.where("created_at < ?", 100.days.ago).empty? && @user.created_at < 100.days.ago %>
|
||||
<p>
|
||||
<em>This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.</em>
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %>
|
||||
<button class="btn btn-danger">🚫 Banish User for Spam 🚫</button>
|
||||
<% end %>
|
||||
<% elsif current_user.has_role?(:super_admin) || current_user.has_role?(:support_admin) %>
|
||||
<p><strong>This is not a new user.</strong> You are only allowed to take this action because you are a
|
||||
<strong>super admin or a support admin.</strong></p>
|
||||
<p>
|
||||
<em>This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.</em>
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %>
|
||||
<button class="btn btn-danger">Banish User for Spam!</button>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>This is not a new user. Only super admins or support admins are allowed to banish this user.</em></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if current_user.has_role?(:super_admin) %>
|
||||
<div class="mb-6">
|
||||
<h3>Delete User & Turn Content Into Ghost</h3>
|
||||
<p>This will
|
||||
<strong>completely destroy the user</strong> and convert all of their articles & comments into a ghost author. This action is irreversible.
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: full_delete_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? 👻 This is extremely destructive and irreversible. The user will be deleted and their articles & comments will be converted to Ghost')" }) do |f| %>
|
||||
<%= f.hidden_field :ghostify, value: true %>
|
||||
<button class="btn btn-danger">👻 Fully Delete User & Ghostify 👻</button>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>Fully Delete User</h3>
|
||||
<p>This will
|
||||
<strong>completely destroy the user</strong> and all of their activity from our database. This action is irreversible.
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: full_delete_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible.')" }) do |f| %>
|
||||
<%= f.hidden_field :ghostify, value: false %>
|
||||
<button class="btn btn-danger">☠️ Fully Delete User & All Activity ☠️</button>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,40 +1,36 @@
|
|||
<div class="row my-3">
|
||||
<div class="col-8">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "All", admin_users_path, class: "nav-link #{'active' if params[:role].blank?}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Admins", admin_users_path(role: :admin), class: "nav-link #{'active' if params[:role] == 'admin'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Super Admins", admin_users_path(role: :super_admin), class: "nav-link #{'active' if params[:role] == 'super_admin'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Trusted", admin_users_path(role: :trusted), class: "nav-link #{'active' if params[:role] == 'trusted'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Tag Mods", admin_users_path(role: :tag_moderator), class: "nav-link #{'active' if params[:role] == 'tag_moderator'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Invitations", admin_invitations_path, class: "nav-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= form_with url: admin_users_path, method: :get, local: true, class: "form-inline justify-content-end" do |f| %>
|
||||
<div class="form-group mx-sm-3">
|
||||
<%= f.text_field :search, value: params[:search], class: "form-control" %>
|
||||
<%= f.hidden_field :role, value: params[:role] if params[:role].present? %>
|
||||
</div>
|
||||
<%= f.submit "Search", class: "btn btn-light" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="flex mb-6 items-center">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<%= link_to "All", admin_users_path, class: "nav-link #{'active' if params[:role].blank?}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Admins", admin_users_path(role: :admin), class: "nav-link #{'active' if params[:role] == 'admin'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Super Admins", admin_users_path(role: :super_admin), class: "nav-link #{'active' if params[:role] == 'super_admin'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Trusted", admin_users_path(role: :trusted), class: "nav-link #{'active' if params[:role] == 'trusted'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Tag Mods", admin_users_path(role: :tag_moderator), class: "nav-link #{'active' if params[:role] == 'tag_moderator'}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Invitations", admin_invitations_path, class: "nav-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
<%= form_with url: admin_users_path, method: :get, local: true, class: "form-inline ml-auto" do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.text_field :search, value: params[:search], class: "form-control mr-2" %>
|
||||
<%= f.hidden_field :role, value: params[:role] if params[:role].present? %>
|
||||
</div>
|
||||
<%= f.submit "Search", class: "btn btn-light" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= paginate @users, theme: "internal" %>
|
||||
|
||||
<table class="table table-hover">
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">User</th>
|
||||
|
|
@ -45,7 +41,7 @@
|
|||
<th scope="col">Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="crayons-card">
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to user.username, admin_user_path(user) %></td>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="grid gap-6">
|
||||
<div class="crayons-card p-6">
|
||||
<h2 class="d-inline">
|
||||
<%= @user.name %><%= link_to "@#{@user.username}", @user.path, class: "ml-2", target: "_blank", rel: "noopener" %>
|
||||
</h2>
|
||||
<a href="<%= edit_admin_user_path(@user) %>" class="btn btn-primary float-right">Manage User</a>
|
||||
<p class="font-italic">Member since <%= @user.created_at.strftime("%b %e '%y") %></p>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>General Info</h2>
|
||||
<dl>
|
||||
<dt>ID:</dt>
|
||||
<dd><%= @user.id %></span></dd>
|
||||
<dd><%= @user.id %></dd>
|
||||
<dt>Username:</dt>
|
||||
<dd><%= @user.username %></dd>
|
||||
<dt>Name:</dt>
|
||||
|
|
@ -33,11 +34,11 @@
|
|||
<% end %>
|
||||
</dl>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<%= render "activity" %>
|
||||
<%= render "credits" %>
|
||||
<%= render "notes" %>
|
||||
<%= render "user_organizations" %>
|
||||
<%= render "email_tools" %>
|
||||
<%= render "activity" %>
|
||||
<%= render "credits" %>
|
||||
<%= render "notes" %>
|
||||
<%= render "user_organizations" %>
|
||||
<%= render "email_tools" %>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,30 +1,28 @@
|
|||
<main>
|
||||
<%= paginate @endpoints %>
|
||||
<%= paginate @endpoints %>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Target URL</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Events</th>
|
||||
<th scope="col">Source</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @endpoints.each do |endpoint| %>
|
||||
<tr>
|
||||
<th scope="col">Target URL</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Events</th>
|
||||
<th scope="col">Source</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Created At</th>
|
||||
<td><%= link_to endpoint.target_url, endpoint.target_url %></td>
|
||||
<td><%= endpoint.id %></td>
|
||||
<td><%= endpoint.events.join(", ") %></td>
|
||||
<td><%= endpoint.source %></td>
|
||||
<td><%= link_to endpoint.user.username, endpoint.user.path %></td>
|
||||
<td><%= endpoint.created_at.strftime("%H:%M %d %b %Y") %></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @endpoints.each do |endpoint| %>
|
||||
<tr>
|
||||
<td><%= link_to endpoint.target_url, endpoint.target_url %></td>
|
||||
<td><%= endpoint.id %></td>
|
||||
<td><%= endpoint.events.join(", ") %></td>
|
||||
<td><%= endpoint.source %></td>
|
||||
<td><%= link_to endpoint.user.username, endpoint.user.path %></td>
|
||||
<td><%= endpoint.created_at.strftime("%H:%M %d %b %Y") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @endpoints %>
|
||||
</main>
|
||||
<%= paginate @endpoints %>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,13 @@
|
|||
<main>
|
||||
<div class="notice"><%= flash[:notice] %></div>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<div class="row justify-content-end">
|
||||
<%= link_to "Create A New Welcome Thread", admin_welcome_index_path, method: :post, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<h2>All Welcome Threads</h2>
|
||||
<hr>
|
||||
<header class="flex items-center mb-6">
|
||||
<h2 class="fs-2xl s:fs-3xl">Welcome Threads</h2>
|
||||
<%= link_to "Create A New Welcome Thread", admin_welcome_index_path, method: :post, class: "btn btn-primary ml-auto" %>
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="list-group-flush">
|
||||
<% @daily_threads.each do |thread| %>
|
||||
<a class="list-group-item list-group-item-action" href="<%= thread.path %>"><%= thread.title %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<div class="crayons-card p-6 grid gap-4">
|
||||
<% @daily_threads.each do |thread| %>
|
||||
<a class="crayons-card crayons-card--secondary p-3" href="<%= thread.path %>"><%= thread.title %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,32 +21,42 @@
|
|||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.16/css/bootstrap-select.min.css" integrity="sha256-g19F2KOr/H58l6XdI/rhCdEK3NmB8OILHwP/QYBQ8M4=" crossorigin="anonymous" />
|
||||
|
||||
<%= stylesheet_link_tag "internal/layout" %>
|
||||
<%= stylesheet_link_tag "admin" %>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex">
|
||||
<nav class="sidebar-nav">
|
||||
<a href="/admin">
|
||||
<img class="d-block mx-auto mt-3" src="<%= optimized_image_url(safe_logo_url(SiteConfig.secondary_logo_url), width: 190) %>" width="40" height="40" alt="<%= community_name %> Logo">
|
||||
</a>
|
||||
<%= render "admin/shared/navbar" %>
|
||||
</nav>
|
||||
<body class="admin">
|
||||
<header class="top-bar" id="top-bar" role="banner">
|
||||
<div class="top-bar__container">
|
||||
<a href="/" class="top-bar--logo" aria-label="<%= community_name %> Home"><%= logo_svg %></a>
|
||||
<h1 class="pl-4 fs-l">
|
||||
Admin
|
||||
<span class="color-base-40">»</span> <span class="fw-bold"><%= controller_name.titleize %></span>
|
||||
</h1>
|
||||
|
||||
<div class="container mt-3">
|
||||
<header>
|
||||
<% flash.each do |type, message| %>
|
||||
<div class="alert alert-<%= type == "notice" || type == "success" ? "success" : "danger" %>">
|
||||
<button class="close" data-dismiss="alert" aria-label="Close">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
<%= message %>
|
||||
</div>
|
||||
<% end %>
|
||||
<h1 class="mt-3"><%= controller_name.titleize %></h1>
|
||||
</header>
|
||||
<%= yield %>
|
||||
<div class="top-bar__links">
|
||||
<a href="/" aria-label="<%= community_name %> Home">Go to <%= community_name %> home page</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="crayons-layout crayons-layout--2-cols">
|
||||
<div class="crayons-layout__left-sidebar">
|
||||
<nav class="hidden m:block">
|
||||
<%= render "admin/shared/navbar" %>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<main class="crayons-layout__content min-w-0">
|
||||
<% flash.each do |type, message| %>
|
||||
<div class="alert alert-<%= type == "notice" || type == "success" ? "success" : "danger" %>">
|
||||
<button class="close" data-dismiss="alert" aria-label="Close">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
<%= message %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap Dependencies -->
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ RSpec.describe "Admin manages chat channels", type: :system do
|
|||
|
||||
it "loads the view" do
|
||||
expect(page).to have_content("Chat Channels")
|
||||
expect(page).to have_content("Create New Connect Channel")
|
||||
expect(page).to have_content("Group Connect Channels")
|
||||
expect(page).to have_content("Create Channel")
|
||||
expect(page).to have_content("Channels")
|
||||
end
|
||||
|
||||
context "when creating a chat channel" do
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RSpec.describe "Admin manages reports", type: :system do
|
|||
|
||||
it "loads the view" do
|
||||
expect(page).to have_content("Feedback Messages")
|
||||
expect(page).to have_content("Suspicious Activity")
|
||||
expect(page).to have_content("Suspicious activity")
|
||||
end
|
||||
|
||||
context "when searching for reports" do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue