From 42d9db526d3aef2e08848d6bc587feaf3700db42 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 7 Jul 2018 16:23:04 -0400 Subject: Added tags Blogs and streams can now be tagged. Records now show the appropriate tags for an entry. Updates work oddly, because their records show the stream's tags, since updates do not have tags themselves. refs #2 --- app/assets/javascripts/admin/records.coffee | 2 ++ app/assets/javascripts/application.js | 1 + app/assets/stylesheets/admin.css.scss | 1 + app/assets/stylesheets/admin/layout.scss | 8 ++++++++ app/assets/stylesheets/main/records.scss | 2 ++ 5 files changed, 14 insertions(+) (limited to 'app/assets') diff --git a/app/assets/javascripts/admin/records.coffee b/app/assets/javascripts/admin/records.coffee index 3a1ed51..7a11ce1 100644 --- a/app/assets/javascripts/admin/records.coffee +++ b/app/assets/javascripts/admin/records.coffee @@ -23,3 +23,5 @@ $(document).on "turbolinks:load", -> create_record_toggle($(this).prop("checked")) $(".published-field input[type=checkbox]").change -> published_field_toggle($(this).prop("checked")) + $("input[type=tags]").each -> + tagsInput(this) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index f902906..a81b3b2 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,4 +14,5 @@ //= require jquery_ujs //= require turbolinks //= require ckeditor/init +//= require tags-input //= require_tree ./admin diff --git a/app/assets/stylesheets/admin.css.scss b/app/assets/stylesheets/admin.css.scss index 5235c4b..95d1ed0 100644 --- a/app/assets/stylesheets/admin.css.scss +++ b/app/assets/stylesheets/admin.css.scss @@ -1,4 +1,5 @@ /* *= require normalize-rails + *= require tags-input *= require_tree ./admin */ diff --git a/app/assets/stylesheets/admin/layout.scss b/app/assets/stylesheets/admin/layout.scss index b825c25..220dcd5 100644 --- a/app/assets/stylesheets/admin/layout.scss +++ b/app/assets/stylesheets/admin/layout.scss @@ -196,6 +196,14 @@ body { } } +.tags-field { + label { + font-size: .75em; + display: block; + margin-bottom: 0.5em; + } +} + .record-description-field { display: none; margin-top: 1em; diff --git a/app/assets/stylesheets/main/records.scss b/app/assets/stylesheets/main/records.scss index f57dded..350fb16 100644 --- a/app/assets/stylesheets/main/records.scss +++ b/app/assets/stylesheets/main/records.scss @@ -31,6 +31,7 @@ .tags { margin: .25em; display: flex; + flex-wrap: wrap; padding-left: 0; li { @@ -58,6 +59,7 @@ } } + &.entry-tag { & + li { margin-left: 1em; } -- cgit 1.4.1