Fix general accessibility warnings in admin (#9927)
* Fix general accessibility warnings in admin * Update app/views/admin/webhook_endpoints/index.html.erb Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> * Update app/views/admin/organizations/show.html.erb Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
This commit is contained in:
parent
8574153b07
commit
c0d86649a4
23 changed files with 676 additions and 644 deletions
|
|
@ -1,34 +1,35 @@
|
|||
<%= paginate @comments %>
|
||||
<main>
|
||||
<%= 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 %> ❤️)
|
||||
<% 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] %>
|
||||
<% @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 %>
|
||||
<% 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>
|
||||
</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 %>
|
||||
<% 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? %>
|
||||
|
|
@ -39,19 +40,20 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= paginate @comments %>
|
||||
<%= paginate @comments %>
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
$("form").submit(function (e) {
|
||||
$(this).toggleClass("d-none");
|
||||
$(this).toggleClass("d-inline");
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
$("form").submit(function (e) {
|
||||
$(this).toggleClass("d-none");
|
||||
$(this).toggleClass("d-inline");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="row">
|
||||
<main class="row">
|
||||
<div class="col-12">
|
||||
<h2>Create New Event</h2>
|
||||
</div>
|
||||
|
|
@ -29,4 +29,4 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<h3 class="m-4">Past <%= num_days %> day new users (<%= User.where("registered_at > ?", num_days.day.ago).count %>)</h3>
|
||||
<div class="row">
|
||||
<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="card">
|
||||
<div class="card-header">
|
||||
<strong>Overall data:</strong>
|
||||
|
|
@ -18,4 +18,4 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<h2>Onboarding</h2>
|
||||
<%= render "results", num_days: 7 %>
|
||||
<%= render "results", num_days: 1 %>
|
||||
<main>
|
||||
<h2>Onboarding</h2>
|
||||
<%= render "results", num_days: 7 %>
|
||||
<%= render "results", num_days: 1 %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,86 +1,88 @@
|
|||
<div class="row m-3">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<%= paginate @listings %>
|
||||
|
||||
<table class="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>
|
||||
<% @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>
|
||||
|
||||
<% 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>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
|
||||
<%= paginate @listings %>
|
||||
<%= paginate @listings %>
|
||||
|
||||
<table class="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>
|
||||
<% @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>
|
||||
|
||||
<% 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>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @listings %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
<div class="row m-3">
|
||||
<div class="col">
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= search_form_for @q, url: admin_moderator_actions_path, class: "form-inline justify-content-end" do |f| %>
|
||||
<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| %>
|
||||
|
||||
<%= 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 mx-3" %>
|
||||
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @moderator_actions %>
|
||||
<%= paginate @moderator_actions %>
|
||||
|
||||
<table class="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"), class: "mx-2") %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @moderator_actions.each do |action| %>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<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>
|
||||
<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>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<%= paginate @moderator_actions %>
|
||||
<%= paginate @moderator_actions %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,61 +1,63 @@
|
|||
<div class="row my-3">
|
||||
<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>
|
||||
<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" %>
|
||||
<%= f.hidden_field :state, value: params[:state] if params[:state].present? %>
|
||||
</div>
|
||||
<%= f.submit "Search", class: "btn btn-light" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
|
||||
<table class="table">
|
||||
<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>
|
||||
<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>
|
||||
<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" %>
|
||||
<% 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" %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
|
||||
<table class="table">
|
||||
<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 %>
|
||||
</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 %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
<%= paginate @mods, theme: "internal" %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="row">
|
||||
<article class="row">
|
||||
<div class="col-sm-6">
|
||||
<h2>Activity</h2>
|
||||
<ul>
|
||||
|
|
@ -6,4 +6,4 @@
|
|||
<li><%= @organization.followers.size %> followers</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -1,51 +1,53 @@
|
|||
<div class="row m-3">
|
||||
<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]) %>
|
||||
<%= submit_tag("Search") %>
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @organizations %>
|
||||
<%= paginate @organizations %>
|
||||
|
||||
<table class="table">
|
||||
<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>
|
||||
<% @organizations.each do |organization| %>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<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 %>
|
||||
<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>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<%= paginate @organizations %>
|
||||
<%= paginate @organizations %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,57 +1,58 @@
|
|||
<div 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>
|
||||
</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 %>
|
||||
<%= text_field_tag :note, "", placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
</div>
|
||||
<%= submit_tag "Add Org Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<% if current_credits.positive? %>
|
||||
<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>
|
||||
</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, :remove %>
|
||||
<%= number_field_tag :credits, nil, in: 1..current_credits, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= text_field_tag :note, "", placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
<%= 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 "Remove Org Credits", class: "btn btn-danger" %>
|
||||
<%= submit_tag "Add Org Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "activity" %>
|
||||
<% 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>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Edit <%= @page.title %></h2>
|
||||
<main>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Edit <%= @page.title %></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
<%= render "form" %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
<%= csrf_meta_tags %>
|
||||
|
||||
<div class="row justify-content-end">
|
||||
<%= link_to "New Page", new_admin_page_path, class: "btn btn-primary" %>
|
||||
</div>
|
||||
|
||||
<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 %>
|
||||
<main>
|
||||
<div class="row justify-content-end">
|
||||
<%= link_to "New Page", new_admin_page_path, class: "btn btn-primary" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>New Page</h2>
|
||||
<main>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>New Page</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
<%= render "form" %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,36 +1,36 @@
|
|||
<h2>Admin Roles</h2>
|
||||
<main>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Admin Roles</h2>
|
||||
<%= paginate @users %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<%= paginate @users %>
|
||||
|
||||
<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| %>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<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 %>
|
||||
</ul>
|
||||
</td>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Profile</th>
|
||||
<th scope="col">Roles</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</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 %>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @users %>
|
||||
<%= paginate @users %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,49 +1,51 @@
|
|||
<div class="row m-3">
|
||||
<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]) %>
|
||||
<%= submit_tag("Search") %>
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @podcasts %>
|
||||
<%= paginate @podcasts %>
|
||||
|
||||
<table class="table">
|
||||
<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>
|
||||
<% @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>
|
||||
<table class="table">
|
||||
<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>
|
||||
<% @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>
|
||||
|
||||
<%= paginate @podcasts %>
|
||||
<%= paginate @podcasts %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,57 +1,58 @@
|
|||
<div class="row m-3">
|
||||
<div class="col">
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= search_form_for @q, url: admin_privileged_reactions_path, class: "form-inline justify-content-end" do |f| %>
|
||||
<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| %>
|
||||
|
||||
<%= 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 mx-3" %>
|
||||
|
||||
<%= f.select(
|
||||
:category_eq,
|
||||
options_for_select(["", "thumbsup", "thumbsdown", "vomit"], @q.category_eq),
|
||||
{},
|
||||
class: "custom-select mx-3",
|
||||
) %>
|
||||
<%= 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>
|
||||
</div>
|
||||
<%= f.submit "Search", class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @privileged_reactions %>
|
||||
<%= paginate @privileged_reactions %>
|
||||
|
||||
<table class="table">
|
||||
<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>
|
||||
<% @privileged_reactions.each do |reaction| %>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<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>
|
||||
<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>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<%= paginate @privileged_reactions %>
|
||||
<%= paginate @privileged_reactions %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,24 @@
|
|||
<div class="crayons-card grid p-6 mb-6 gap-1">
|
||||
<%= form_for [:admin, ProfileField.new], html: { class: "inline-form" } do |form| %>
|
||||
<div class="form-group">
|
||||
<%= render "form", form: form %>
|
||||
<%= form.submit class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% @profile_fields.each do |group, fields| %>
|
||||
<h3>Group: <%= group %></h3>
|
||||
|
||||
<% fields.each do |field| %>
|
||||
<div class="crayons-card grid p-6 mb-6 gap-1">
|
||||
<%= form_for [:admin, field] do |form| %>
|
||||
<main>
|
||||
<article class="crayons-card grid p-6 mb-6 gap-1">
|
||||
<%= form_for [:admin, ProfileField.new], html: { class: "inline-form" } do |form| %>
|
||||
<div class="form-group">
|
||||
<%= render "form", form: form %>
|
||||
<%= form.submit class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<%= button_to "Delete", admin_profile_field_path(field), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-secondary" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</article>
|
||||
|
||||
<% @profile_fields.each do |group, fields| %>
|
||||
<h2>Group: <%= group %></h3>
|
||||
|
||||
<% fields.each do |field| %>
|
||||
<article class="crayons-card 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", admin_profile_field_path(field), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-secondary" %>
|
||||
</article>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,29 +1,31 @@
|
|||
<% if !@vault_enabled %>
|
||||
<div class="alert alert-warning" 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 %>
|
||||
<main>
|
||||
<% if !@vault_enabled %>
|
||||
<div class="alert alert-warning" 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>
|
||||
<tr>
|
||||
<th scope="col">Secret Name</th>
|
||||
<th scope="col">Secret Value</th>
|
||||
<th scope="col">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @secrets.each do |key, partial_value| %>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<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 %>
|
||||
<th scope="col">Secret Name</th>
|
||||
<th scope="col">Secret Value</th>
|
||||
<th scope="col">Action</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</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
|
||||
|
|
|
|||
|
|
@ -1,57 +1,59 @@
|
|||
<div class="row m-3">
|
||||
<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]) %>
|
||||
<% if params[:state].present? %>
|
||||
<%= hidden_field_tag(:state, params[:state]) %>
|
||||
<% end %>
|
||||
<%= submit_tag("Search") %>
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= paginate @tags %>
|
||||
<%= paginate @tags %>
|
||||
|
||||
<table class="table">
|
||||
<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>
|
||||
<% @tags.each do |tag| %>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<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>
|
||||
<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>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<%= paginate @tags %>
|
||||
<%= paginate @tags %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="row">
|
||||
<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.
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<% end %>
|
||||
<%= form_for [:admin, @tag], html: { class: "form-inline justify-content-between" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Add Moderator (id):", class: "mr-3" %>
|
||||
<%= f.label :tag_moderator_id, "Add Moderator (id):", class: "mr-3" %>
|
||||
<%= f.text_field :tag_moderator_id, class: "form-control" %>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -84,4 +84,4 @@
|
|||
<%= f.submit class: "btn btn-primary float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,41 +1,43 @@
|
|||
<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("Link:") %>
|
||||
<%= text_field_tag :dead_link, nil, placeholder: "/xyz" %>
|
||||
<%= submit_tag("Clear Cache") %>
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
|
||||
<h2>Bust Cache For Specific Content</h2>
|
||||
<p>This clears both the Rails cache & the Fastly cache.</p>
|
||||
<div class="row m-3">
|
||||
<%= form_tag bust_cache_admin_tools_path do %>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<%= label_tag("Article ID: ") %>
|
||||
<%= text_field_tag :bust_article, nil, placeholder: "12345" %>
|
||||
<%= submit_tag("Clear Article Cache") %>
|
||||
<h2>Bust Cache For Specific Content</h2>
|
||||
<p>This clears both the Rails cache & the Fastly cache.</p>
|
||||
<div class="row m-3">
|
||||
<%= 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>
|
||||
</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("User ID: ") %>
|
||||
<%= text_field_tag :bust_user, nil, placeholder: "12345" %>
|
||||
<%= submit_tag("Clear User Cache") %>
|
||||
<% 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>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,28 +1,30 @@
|
|||
<%= paginate @endpoints %>
|
||||
<main>
|
||||
<%= paginate @endpoints %>
|
||||
|
||||
<table class="table">
|
||||
<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>
|
||||
<% @endpoints.each do |endpoint| %>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<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>
|
||||
<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>
|
||||
<% @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>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @endpoints %>
|
||||
<%= paginate @endpoints %>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
<div class="notice"><%= flash[:notice] %></div>
|
||||
<%= csrf_meta_tags %>
|
||||
<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>
|
||||
|
||||
<h2>All Welcome Threads</h2>
|
||||
<hr>
|
||||
|
||||
<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 class="row justify-content-end">
|
||||
<%= link_to "Create A New Welcome Thread", admin_welcome_index_path, method: :post, class: "btn btn-primary" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>All Welcome Threads</h2>
|
||||
<hr>
|
||||
|
||||
<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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue