Unverified Commit 09af1548 authored by Bruno Michel's avatar Bruno Michel Committed by GitHub

Merge pull request #240 from linuxfrorg/tag_moderation

Tag moderation (public->not public, not the removal part)
parents 37b62599 6726e42d
# encoding: UTF-8
class Moderation::TagsController < ModerationController
def index
@tags = Tag.public_tags
end
end
......@@ -46,6 +46,16 @@ class Tag < ActiveRecord::Base
EOS
end
def self.public_tags(offset=0, count=10000)
Tag.find_by_sql <<-EOS
SELECT t.name, t.taggings_count
FROM tags t
WHERE t.public = 1
ORDER BY t.taggings_count ASC
LIMIT #{offset},#{count}
EOS
end
### Visibility ###
def updatable_by?(account)
......
......@@ -25,6 +25,9 @@
%h2
= link_to "Images externes", moderation_images_path
%h2
= link_to "Tags publics", moderation_tags_path
%h2
= link_to "Sondages", moderation_polls_path
- if @polls.empty?
......
%h2 Tags publics par nombre croissant d'occurences
- @tags.each do |tag|
.tag
= link_to("#{tag.name} (#{tag.taggings_count})", public_tag_path(tag.name))
......@@ -170,6 +170,7 @@ Rails.application.routes.draw do
resources :plonk, only: [:create]
resources :block, only: [:create]
resources :images, only: [:index, :destroy]
resources :tags, only: [:index]
end
# Admin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment