Tag cloud threshold is displayed on the screen
This commit is contained in:
parent
6c6b293099
commit
2048398aa7
@ -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…
Reference in New Issue
Block a user