From 1f29a91f19f0d1cd81c64df62a14f58ff2cae919 Mon Sep 17 00:00:00 2001
From: ArtOfCode- <hello@artofcode.co.uk>
Date: Mon, 29 Jun 2020 16:59:05 +0100
Subject: [PATCH] More tag show view

---
 app/views/tags/show.html.erb | 32 +++++++++++++++++++++++++++++++-
 db/seeds/privileges.yml      |  2 ++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/app/views/tags/show.html.erb b/app/views/tags/show.html.erb
index 26ce3b49e..0deb48516 100644
--- a/app/views/tags/show.html.erb
+++ b/app/views/tags/show.html.erb
@@ -1 +1,31 @@
-<h1>Tag: <span class="<%= @classes %> is-large"><%= @tag.name %></span></h1>
\ No newline at end of file
+<h1>
+  Posts tagged <span class="<%= @classes %> is-large"><%= @tag.name %></span>
+</h1>
+
+<div class="widget">
+  <div class="widget--body">
+    <%= raw(sanitize(@tag.excerpt, scrubber: scrubber)) %>
+    <% unless @tag.excerpt.present? %>
+      <p class="has-font-size-caption">
+        <em>
+          This tag doesn't have any usage information yet.
+          <% if current_user&.has_privilege?('EditTag') %>
+            <%= link_to 'Help us create it', edit_tag_path(id: @category.id, tag_id: @tag.id) %>.
+          <% end %>
+        </em>
+      </p>
+    <% end %>
+    <hr/>
+    <%= raw(sanitize(@tag.wiki, scrubber: scrubber)) %>
+    <% unless @tag.wiki.present? %>
+      <p class="has-font-size-caption">
+        <em>
+          This tag doesn't have a detailed wiki yet.
+          <% if current_user&.has_privilege?('EditTag') %>
+            <%= link_to 'Help us create it', edit_tag_path(id: @category.id, tag_id: @tag.id) %>.
+          <% end %>
+        </em>
+      </p>
+    <% end %>
+  </div>
+</div>
diff --git a/db/seeds/privileges.yml b/db/seeds/privileges.yml
index 1dab7a8b3..e017b48d9 100644
--- a/db/seeds/privileges.yml
+++ b/db/seeds/privileges.yml
@@ -10,3 +10,5 @@
   threshold: 500
 - name: SeeTools
   threshold: 500
+- name: EditTag
+  threshold: 750
-- 
GitLab