Tag cloud threshold is displayed on the screen

remotes/origin/master
echarp 4 years ago
parent 6c6b293099
commit 2048398aa7
  1. 10
      app/assets/stylesheets/tags.sass
  2. 3
      app/controllers/tags_controller.rb
  3. 6
      app/views/tags/index.html.haml
  4. 2
      config/application.rb
  5. 1
      config/locales/views/en.yml
  6. 1
      config/locales/views/fr.yml

@ -51,6 +51,10 @@ ul.ui-autocomplete li
margin: 0
background-color: #F0F8FF
body.tags .event[class*='libre-en-fete-'] em.city:before
content: image-url(lef-small)
margin-right: 0.5em
body.tags
.event[class*='libre-en-fete-'] em.city:before
content: image-url(lef-small)
margin-right: 0.5em
.info
float: right
margin-right: 10%

@ -5,7 +5,8 @@ class TagsController < InheritedResources::Base
has_scope :tag, as: :id
def index
@tags = ActsAsTaggableOn::Tag.where('taggings_count > 3')
@tags = ActsAsTaggableOn::Tag.where('taggings_count > ?',
Rails.configuration.cloud_threshold)
if params[:term]
# Used to autocomplete tags
@tags = @tags.select(:id, :name, 'name AS label')

@ -2,5 +2,9 @@
%em.fa.fa-tags
= title t '.title'
- tag_cloud @tags, %w(css1 css2 css3 css4) do |tag, css_class|
- tag_cloud @tags.order(:name), %w[css1 css2 css3 css4] do |tag, css_class|
= link_to tag.name, { action: :show, id: tag.name }, class: css_class
%p.info
%em.fa.fa-info-circle
= t '.threshold', threshold: Rails.configuration.cloud_threshold

@ -50,5 +50,7 @@ module AgendaDuLibreRails
config.action_controller.per_form_csrf_tokens = false
config.active_record.sqlite3.represent_boolean_as_integer = true
config.cloud_threshold = 3
end
end

@ -151,6 +151,7 @@ it more readable or agreable."
tags:
index:
title: Tags
threshold: used more than %{threshold} times
show:
title: Tag
links: See also

@ -164,6 +164,7 @@ l’événement pour la rendre plus complète, plus lisible ou plus attrayante."
tags:
index:
title: Mots-clés
threshold: utilisés plus de %{threshold} fois
show:
title: Mot-clé
links: Voir aussi

Loading…
Cancel
Save