about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-15 13:44:47 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-15 14:12:24 -0500
commit9a2f0131c6cddef3ef0e7faa73070945f0d4f452 (patch)
treec9393bd59493510d4c708b068111134ca7ef20a6
parent5e3ea221a80d7498d4939386f072d933e6b23dda (diff)
tag folding
-rw-r--r--app/javascript/flavours/glitch/styles/monsterpit.scss22
-rw-r--r--app/lib/formatter.rb5
2 files changed, 27 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/styles/monsterpit.scss b/app/javascript/flavours/glitch/styles/monsterpit.scss
index 495c5c179..75d2691ad 100644
--- a/app/javascript/flavours/glitch/styles/monsterpit.scss
+++ b/app/javascript/flavours/glitch/styles/monsterpit.scss
@@ -7,6 +7,28 @@
     font-size: 12px;
     text-align: right;
   }
+  details.tags {
+    color: lighten($dark-text-color, 20%);
+    font-size: 12px;
+    text-align: right;
+
+    a {
+      color: darken($secondary-text-color, 20%);
+    }
+  }
+}
+
+.composer--reply > .content {
+  p.signature {
+    color: $dark-text-color;
+  }
+  details.tags {
+    color: $dark-text-color;
+
+    a {
+      color: darken($secondary-text-color, 50%);
+    }
+  }
 }
 
 div.media-caption {
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 2d35a07bc..62047e4bd 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -219,6 +219,11 @@ class Formatter
       html = "#{html.strip}<p class=\"signature\">— #{footer}</p>"
     end
 
+    unless status.tags.blank?
+      tags = encode_and_link_urls(status.tags.pluck(:name).sort.map{ |t| "##{t}" }.join(' '))
+      html = "#{html}<details class=\"tags\"><summary>\xf0\x9f\x8f\xb7</summary><p class=\"tags\">#{tags}</p></details>"
+    end
+
     html.html_safe # rubocop:disable Rails/OutputSafety
   end