diff --git a/app/assets/javascripts/optional_field_toggle.js b/app/assets/javascripts/optional_field_toggle.js index f6b85516..7a43a5f1 100644 --- a/app/assets/javascripts/optional_field_toggle.js +++ b/app/assets/javascripts/optional_field_toggle.js @@ -1,4 +1,5 @@ $(document).ready(function() { + $('.optional_field').hide(); $('.optional-field-toggle').on("click", function(e){ $('.optional_field').fadeToggle(); e.preventDefault(); diff --git a/app/assets/javascripts/spinnable.js b/app/assets/javascripts/spinnable.js index b0d026a0..98527bb3 100644 --- a/app/assets/javascripts/spinnable.js +++ b/app/assets/javascripts/spinnable.js @@ -1,5 +1,10 @@ // Show and hide spinners on Ajax requests. $(document).ready(function(){ - $('form.spinnable').on('ajax:before', function(evt, xhr, status){ $('#spinner').show();}) - $('form.spinnable').on('ajax:complete', function(evt, xhr, status){ $('#spinner').hide();}) + $('#spinner').hide().removeClass("hidden"); + $('form.spinnable').on('ajax:before', function(evt, xhr, status){ + $('#spinner').show(); + }); + $('form.spinnable').on('ajax:complete', function(evt, xhr, status){ + $('#spinner').hide(); + }); }); diff --git a/app/assets/stylesheets/administration_structure.css.scss b/app/assets/stylesheets/administration_structure.css.scss index c766e657..4ed9325f 100644 --- a/app/assets/stylesheets/administration_structure.css.scss +++ b/app/assets/stylesheets/administration_structure.css.scss @@ -1,7 +1,7 @@ /* General */ body { - padding-top: 40px; + padding-top: 60px; } footer { diff --git a/app/assets/stylesheets/publify.css.scss b/app/assets/stylesheets/publify.css.scss index b7270ecd..f9007ae5 100644 --- a/app/assets/stylesheets/publify.css.scss +++ b/app/assets/stylesheets/publify.css.scss @@ -28,3 +28,25 @@ .admin-tools-reveal:hover .admintools { display: block; } + +.tag-sidebar-tag-cloud { + overflow: hidden; +} + +.tag-sidebar-tag-67 { font-size: 0.67em; } +.tag-sidebar-tag-75 { font-size: 0.75em; } +.tag-sidebar-tag-83 { font-size: 0.83em; } +.tag-sidebar-tag-91 { font-size: 0.91em; } +.tag-sidebar-tag-100 { font-size: 1em; } +.tag-sidebar-tag-112 { font-size: 1.12em; } +.tag-sidebar-tag-125 { font-size: 1.25em; } +.tag-sidebar-tag-137 { font-size: 1.37em; } +.tag-sidebar-tag-150 { font-size: 1.50em; } +.tag-sidebar-tag-162 { font-size: 1.62em; } +.tag-sidebar-tag-175 { font-size: 1.75em; } +.tag-sidebar-tag-187 { font-size: 1.87em; } +.tag-sidebar-tag-200 { font-size: 2em; } + +.hidden { + display: none; +} diff --git a/app/models/tag_sidebar.rb b/app/models/tag_sidebar.rb index 9810211b..9c1c69f5 100644 --- a/app/models/tag_sidebar.rb +++ b/app/models/tag_sidebar.rb @@ -18,12 +18,34 @@ def sizes average = total.to_f / @tags.size @sizes = tags.reduce({}) do |h, tag| size = tag.content_counter.to_f / average - h.merge tag => size.clamp(2.0 / 3.0, 2) * 100 + h.merge tag => bucket(size) end end - def font_multiplier - 80 + BUCKETS = [ + 67, + 75, + 83, + 91, + 100, + 112, + 125, + 137, + 150, + 162, + 175, + 187, + 200 + ].freeze + + private + + def bucket(size) + base_size = size.clamp(2.0 / 3.0, 2) * 100 + BUCKETS.each do |sz| + return sz if sz >= base_size + end + BUCKETS.last end end diff --git a/app/views/admin/articles/index.html.erb b/app/views/admin/articles/index.html.erb index 088fb322..b841c2f7 100644 --- a/app/views/admin/articles/index.html.erb +++ b/app/views/admin/articles/index.html.erb @@ -20,7 +20,7 @@
diff --git a/app/views/tag_sidebar/_content.html.erb b/app/views/tag_sidebar/_content.html.erb index 987cab51..a10010c1 100644 --- a/app/views/tag_sidebar/_content.html.erb +++ b/app/views/tag_sidebar/_content.html.erb @@ -1,9 +1,9 @@ <% unless sidebar.tags.blank? %>
<%= t('.tags') %>
+
<% sidebar.tags.each do |tag| %> - <%= link_to tag.display_name, tag_url(tag.name) %> + <%= link_to tag.display_name, tag_url(tag.name) %> <% end %>