diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss
index 5afa088d1..08f95cd41 100644
--- a/app/assets/stylesheets/admin.scss
+++ b/app/assets/stylesheets/admin.scss
@@ -164,6 +164,11 @@ body.admin {
font-size: rem-calc(12);
}
+.ignored {
+ color: $text-medium;
+ font-size: rem-calc(12);
+}
+
.rejected {
color: $delete;
}
diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss
index 116b57ff8..b195899d3 100644
--- a/app/assets/stylesheets/participacion.scss
+++ b/app/assets/stylesheets/participacion.scss
@@ -187,7 +187,7 @@ h1, h2, h3, h4, h5, h6 {
// - - - - - - - - - - - - - - - - - - - - - - - - -
header {
- background: url('home_header_bg.jpg');
+ background: image-url('home_header_bg.jpg');
background-position: 50% 50%;
background-size: cover;
min-height: rem-calc(480);
@@ -217,6 +217,12 @@ header {
margin: 0;
}
+ p {
+ color: white;
+ font-size: rem-calc(18);
+ line-height: $line-height;
+ }
+
.button {
color: white;
font-family: inherit;
@@ -431,6 +437,11 @@ footer {
.logo {
@include logo;
+
+ a {
+ line-height: rem-calc(36);
+ padding-left: 0;
+ }
}
h4 {
@@ -446,6 +457,16 @@ footer {
opacity: .5;
}
}
+
+ .footer-description {
+ a {
+ text-decoration: underline;
+
+ &:hover {
+ color: rgba(255,255,255,.6);
+ }
+ }
+ }
}
.subfooter {
@@ -566,7 +587,7 @@ form.locale-form {
position: relative;
select {
- background-image: url("language_select.png");
+ background-image: image-url("language_select.png");
&.js-locale-switcher {
background-color: transparent;
diff --git a/app/controllers/admin/comments_controller.rb b/app/controllers/admin/comments_controller.rb
index 49dbc2889..40f9b31dc 100644
--- a/app/controllers/admin/comments_controller.rb
+++ b/app/controllers/admin/comments_controller.rb
@@ -1,13 +1,35 @@
class Admin::CommentsController < Admin::BaseController
+ before_filter :set_valid_filters, only: :index
+ before_filter :parse_filter, only: :index
+
+ before_filter :load_comment, only: [:confirm_hide, :restore]
def index
- @comments = Comment.only_hidden.page(params[:page])
+ @comments = Comment.only_hidden.send(@filter).page(params[:page])
+ end
+
+ def confirm_hide
+ @comment.confirm_hide
+ redirect_to request.query_parameters.merge(action: :index)
end
def restore
- @comment = Comment.with_hidden.find(params[:id])
@comment.restore
- redirect_to admin_comments_path, notice: t('admin.comments.restore.success')
+ redirect_to request.query_parameters.merge(action: :index)
end
-end
\ No newline at end of file
+ private
+ def load_comment
+ @comment = Comment.with_hidden.find(params[:id])
+ end
+
+ def set_valid_filters
+ @valid_filters = %w{all with_confirmed_hide}
+ end
+
+ def parse_filter
+ @filter = params[:filter]
+ @filter = 'all' unless @valid_filters.include?(@filter)
+ end
+
+end
diff --git a/app/controllers/admin/debates_controller.rb b/app/controllers/admin/debates_controller.rb
index 9f2f21f62..4487fcf81 100644
--- a/app/controllers/admin/debates_controller.rb
+++ b/app/controllers/admin/debates_controller.rb
@@ -1,16 +1,36 @@
class Admin::DebatesController < Admin::BaseController
+ before_filter :set_valid_filters, only: :index
+ before_filter :parse_filter, only: :index
+
+ before_filter :load_debate, only: [:confirm_hide, :restore]
def index
- @debates = Debate.only_hidden.page(params[:page])
+ @debates = Debate.only_hidden.send(@filter).page(params[:page])
end
- def show
- @debate = Debate.with_hidden.find(params[:id])
+ def confirm_hide
+ @debate.confirm_hide
+ redirect_to request.query_parameters.merge(action: :index)
end
def restore
- @debate = Debate.with_hidden.find(params[:id])
@debate.restore
- redirect_to admin_debates_path, notice: t('admin.debates.restore.success')
+ redirect_to request.query_parameters.merge(action: :index)
end
-end
\ No newline at end of file
+
+ private
+
+ def load_debate
+ @debate = Debate.with_hidden.find(params[:id])
+ end
+
+ def set_valid_filters
+ @valid_filters = %w{all with_confirmed_hide}
+ end
+
+ def parse_filter
+ @filter = params[:filter]
+ @filter = 'all' unless @valid_filters.include?(@filter)
+ end
+
+end
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 9b23b7927..61c0f5650 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -1,25 +1,42 @@
class Admin::UsersController < Admin::BaseController
+ before_filter :set_valid_filters, only: :index
+ before_filter :parse_filter, only: :index
+
+ before_filter :load_user, only: [:confirm_hide, :restore]
def index
- @users = User.only_hidden.page(params[:page])
+ @users = User.only_hidden.send(@filter).page(params[:page])
end
def show
@user = User.with_hidden.find(params[:id])
- @debates = Debate.where(author_id: @user.id).with_hidden.page(params[:page])
- @comments = Comment.where(user_id: @user.id).with_hidden.page(params[:page])
+ @debates = @user.debates.with_hidden.page(params[:page])
+ @comments = @user.comments.with_hidden.page(params[:page])
+ end
+
+ def confirm_hide
+ @user.confirm_hide
+ redirect_to request.query_parameters.merge(action: :index)
end
def restore
- user = User.with_hidden.find(params[:id])
- if hidden_at = user.hidden_at
- debates_ids = Debate.only_hidden.where(author_id: user.id).where("debates.hidden_at > ?", hidden_at).pluck(:id)
- comments_ids = Comment.only_hidden.where(user_id: user.id).where("comments.hidden_at > ?", hidden_at).pluck(:id)
-
- user.restore
- Debate.restore_all debates_ids
- Comment.restore_all comments_ids
- end
- redirect_to admin_users_path, notice: t('admin.users.restore.success')
+ @user.restore
+ redirect_to request.query_parameters.merge(action: :index)
end
-end
\ No newline at end of file
+
+ private
+
+ def load_user
+ @user = User.with_hidden.find(params[:id])
+ end
+
+ def set_valid_filters
+ @valid_filters = %w{all with_confirmed_hide}
+ end
+
+ def parse_filter
+ @filter = params[:filter]
+ @filter = 'all' unless @valid_filters.include?(@filter)
+ end
+
+end
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index 798196ca0..c342b8d10 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -22,14 +22,14 @@ class CommentsController < ApplicationController
respond_with @comment
end
- def flag_as_inappropiate
- InappropiateFlag.flag!(current_user, @comment)
- respond_with @comment, template: 'comments/_refresh_flag_as_inappropiate_actions'
+ def flag
+ Flag.flag!(current_user, @comment)
+ respond_with @comment, template: 'comments/_refresh_flag_actions'
end
- def undo_flag_as_inappropiate
- InappropiateFlag.unflag!(current_user, @comment)
- respond_with @comment, template: 'comments/_refresh_flag_as_inappropiate_actions'
+ def unflag
+ Flag.unflag!(current_user, @comment)
+ respond_with @comment, template: 'comments/_refresh_flag_actions'
end
private
diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb
index efa441d81..60819fcf6 100644
--- a/app/controllers/debates_controller.rb
+++ b/app/controllers/debates_controller.rb
@@ -52,14 +52,14 @@ class DebatesController < ApplicationController
set_debate_votes(@debate)
end
- def flag_as_inappropiate
- InappropiateFlag.flag!(current_user, @debate)
- respond_with @debate, template: 'debates/_refresh_flag_as_inappropiate_actions'
+ def flag
+ Flag.flag!(current_user, @debate)
+ respond_with @debate, template: 'debates/_refresh_flag_actions'
end
- def undo_flag_as_inappropiate
- InappropiateFlag.unflag!(current_user, @debate)
- respond_with @debate, template: 'debates/_refresh_flag_as_inappropiate_actions'
+ def unflag
+ Flag.unflag!(current_user, @debate)
+ respond_with @debate, template: 'debates/_refresh_flag_actions'
end
private
diff --git a/app/controllers/moderation/comments_controller.rb b/app/controllers/moderation/comments_controller.rb
index 8a4d3768e..3622d02ac 100644
--- a/app/controllers/moderation/comments_controller.rb
+++ b/app/controllers/moderation/comments_controller.rb
@@ -19,19 +19,19 @@ class Moderation::CommentsController < Moderation::BaseController
redirect_to request.query_parameters.merge(action: :index)
end
- def archive
- @comment.archive
+ def ignore_flag
+ @comment.ignore_flag
redirect_to request.query_parameters.merge(action: :index)
end
private
def load_comments
- @comments = Comment.accessible_by(current_ability, :hide).flagged_as_inappropiate.sorted_for_moderation.includes(:commentable)
+ @comments = Comment.accessible_by(current_ability, :hide).flagged.sorted_for_moderation.includes(:commentable)
end
def set_valid_filters
- @valid_filters = %w{all pending archived}
+ @valid_filters = %w{all pending_flag_review with_ignored_flag}
end
def parse_filter
diff --git a/app/controllers/moderation/debates_controller.rb b/app/controllers/moderation/debates_controller.rb
index 3492ee423..abb8e964b 100644
--- a/app/controllers/moderation/debates_controller.rb
+++ b/app/controllers/moderation/debates_controller.rb
@@ -19,19 +19,19 @@ class Moderation::DebatesController < Moderation::BaseController
redirect_to request.query_parameters.merge(action: :index)
end
- def archive
- @debate.archive
+ def ignore_flag
+ @debate.ignore_flag
redirect_to request.query_parameters.merge(action: :index)
end
private
def load_debates
- @debates = Debate.accessible_by(current_ability, :hide).flagged_as_inappropiate.sorted_for_moderation
+ @debates = Debate.accessible_by(current_ability, :hide).flagged.sorted_for_moderation
end
def set_valid_filters
- @valid_filters = %w{all pending archived}
+ @valid_filters = %w{all pending_flag_review with_ignored_flag}
end
def parse_filter
diff --git a/app/models/ability.rb b/app/models/ability.rb
index c8ed63d22..e931d037f 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -22,20 +22,20 @@ class Ability
can :create, Comment
can :create, Debate
- can :flag_as_inappropiate, Comment do |comment|
- comment.author_id != user.id && !InappropiateFlag.flagged?(user, comment)
+ can :flag, Comment do |comment|
+ comment.author_id != user.id && !Flag.flagged?(user, comment)
end
- can :undo_flag_as_inappropiate, Comment do |comment|
- comment.author_id != user.id && InappropiateFlag.flagged?(user, comment)
+ can :unflag, Comment do |comment|
+ comment.author_id != user.id && Flag.flagged?(user, comment)
end
- can :flag_as_inappropiate, Debate do |debate|
- debate.author_id != user.id && !InappropiateFlag.flagged?(user, debate)
+ can :flag, Debate do |debate|
+ debate.author_id != user.id && !Flag.flagged?(user, debate)
end
- can :undo_flag_as_inappropiate, Debate do |debate|
- debate.author_id != user.id && InappropiateFlag.flagged?(user, debate)
+ can :unflag, Debate do |debate|
+ debate.author_id != user.id && Flag.flagged?(user, debate)
end
unless user.organization?
@@ -53,14 +53,14 @@ class Ability
can :hide, Comment, hidden_at: nil
cannot :hide, Comment, user_id: user.id
- can :archive, Comment, archived_at: nil, hidden_at: nil
- cannot :archive, Comment, user_id: user.id
+ can :ignore_flag, Comment, ignored_flag_at: nil, hidden_at: nil
+ cannot :ignore_flag, Comment, user_id: user.id
can :hide, Debate, hidden_at: nil
cannot :hide, Debate, author_id: user.id
- can :archive, Debate, archived_at: nil, hidden_at: nil
- cannot :archive, Debate, author_id: user.id
+ can :ignore_flag, Debate, ignored_flag_at: nil, hidden_at: nil
+ cannot :ignore_flag, Debate, author_id: user.id
can :hide, User
cannot :hide, User, id: user.id
@@ -72,8 +72,23 @@ class Ability
if user.administrator?
can :restore, Comment
+ cannot :restore, Comment, hidden_at: nil
+
can :restore, Debate
+ cannot :restore, Debate, hidden_at: nil
+
can :restore, User
+ cannot :restore, User, hidden_at: nil
+
+ can :confirm_hide, Comment
+ cannot :confirm_hide, Comment, hidden_at: nil
+
+ can :confirm_hide, Debate
+ cannot :confirm_hide, Debate, hidden_at: nil
+
+ can :confirm_hide, User
+ cannot :confirm_hide, User, hidden_at: nil
+
can :comment_as_administrator, [Debate, Comment]
end
end
diff --git a/app/models/comment.rb b/app/models/comment.rb
index bbfeca4f5..fa5f72164 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -1,7 +1,7 @@
class Comment < ActiveRecord::Base
- include ActsAsParanoidAliases
acts_as_nested_set scope: [:commentable_id, :commentable_type], counter_cache: :children_count
acts_as_paranoid column: :hidden_at
+ include ActsAsParanoidAliases
acts_as_votable
attr_accessor :as_moderator, :as_administrator
@@ -12,14 +12,14 @@ class Comment < ActiveRecord::Base
belongs_to :commentable, polymorphic: true, counter_cache: true
belongs_to :user, -> { with_hidden }
- has_many :inappropiate_flags, :as => :flaggable
+ has_many :flags, :as => :flaggable
scope :recent, -> { order(id: :desc) }
- scope :sorted_for_moderation, -> { order(inappropiate_flags_count: :desc, updated_at: :desc) }
- scope :pending, -> { where(archived_at: nil, hidden_at: nil) }
- scope :archived, -> { where("archived_at IS NOT NULL AND hidden_at IS NULL") }
- scope :flagged_as_inappropiate, -> { where("inappropiate_flags_count > 0") }
+ scope :sorted_for_moderation, -> { order(flags_count: :desc, updated_at: :desc) }
+ scope :pending_flag_review, -> { where(ignored_flag_at: nil, hidden_at: nil) }
+ scope :with_ignored_flag, -> { where("ignored_flag_at IS NOT NULL AND hidden_at IS NULL") }
+ scope :flagged, -> { where("flags_count > 0") }
scope :for_render, -> { with_hidden.includes(user: :organization) }
@@ -65,8 +65,12 @@ class Comment < ActiveRecord::Base
hidden? || user.hidden?
end
- def archived?
- archived_at.present?
+ def ignored_flag?
+ ignored_flag_at.present?
+ end
+
+ def ignore_flag
+ update(ignored_flag_at: Time.now)
end
def as_administrator?
@@ -77,10 +81,6 @@ class Comment < ActiveRecord::Base
moderator_id.present?
end
- def archive
- update(archived_at: Time.now)
- end
-
# TODO: faking counter cache since there is a bug with acts_as_nested_set :counter_cache
# Remove when https://github.com/collectiveidea/awesome_nested_set/issues/294 is fixed
# and reset counters using
diff --git a/app/models/debate.rb b/app/models/debate.rb
index 779cca33a..fdf939b2f 100644
--- a/app/models/debate.rb
+++ b/app/models/debate.rb
@@ -1,6 +1,5 @@
require 'numeric'
class Debate < ActiveRecord::Base
- include ActsAsParanoidAliases
default_scope { order(created_at: :desc) }
apply_simple_captcha
@@ -10,9 +9,10 @@ class Debate < ActiveRecord::Base
acts_as_commentable
acts_as_taggable
acts_as_paranoid column: :hidden_at
+ include ActsAsParanoidAliases
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
- has_many :inappropiate_flags, :as => :flaggable
+ has_many :flags, :as => :flaggable
validates :title, presence: true
validates :description, presence: true
@@ -23,10 +23,10 @@ class Debate < ActiveRecord::Base
before_validation :sanitize_description
before_validation :sanitize_tag_list
- scope :sorted_for_moderation, -> { order(inappropiate_flags_count: :desc, updated_at: :desc) }
- scope :pending, -> { where(archived_at: nil, hidden_at: nil) }
- scope :archived, -> { where("archived_at IS NOT NULL AND hidden_at IS NULL") }
- scope :flagged_as_inappropiate, -> { where("inappropiate_flags_count > 0") }
+ scope :sorted_for_moderation, -> { order(flags_count: :desc, updated_at: :desc) }
+ scope :pending_flag_review, -> { where(ignored_flag_at: nil, hidden_at: nil) }
+ scope :with_ignored_flag, -> { where("ignored_flag_at IS NOT NULL AND hidden_at IS NULL") }
+ scope :flagged, -> { where("flags_count > 0") }
scope :for_render, -> { includes(:tags) }
scope :sort_by_total_votes, -> { reorder(cached_votes_total: :desc) }
scope :sort_by_likes , -> { reorder(cached_votes_up: :desc) }
@@ -79,12 +79,12 @@ class Debate < ActiveRecord::Base
count < 0 ? 0 : count
end
- def archived?
- archived_at.present?
+ def ignored_flag?
+ ignored_flag_at.present?
end
- def archive
- update(archived_at: Time.now)
+ def ignore_flag
+ update(ignored_flag_at: Time.now)
end
protected
diff --git a/app/models/inappropiate_flag.rb b/app/models/flag.rb
similarity index 72%
rename from app/models/inappropiate_flag.rb
rename to app/models/flag.rb
index b60b98618..d2f30d284 100644
--- a/app/models/inappropiate_flag.rb
+++ b/app/models/flag.rb
@@ -1,7 +1,7 @@
-class InappropiateFlag < ActiveRecord::Base
+class Flag < ActiveRecord::Base
belongs_to :user
- belongs_to :flaggable, polymorphic: true, counter_cache: true, touch: :flagged_as_inappropiate_at
+ belongs_to :flaggable, polymorphic: true, counter_cache: true
scope(:by_user_and_flaggable, lambda do |user, flaggable|
where(user_id: user.id,
@@ -12,13 +12,13 @@ class InappropiateFlag < ActiveRecord::Base
class AlreadyFlaggedError < StandardError
def initialize
- super "The flaggable was already flagged as inappropiate by this user"
+ super "The flaggable was already flagged by this user"
end
end
class NotFlaggedError < StandardError
def initialize
- super "The flaggable was not flagged as inappropiate by this user"
+ super "The flaggable was not flagged by this user"
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index f54c15306..0b37ac386 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,6 +1,9 @@
class User < ActiveRecord::Base
+<<<<<<< HEAD
include ActsAsParanoidAliases
include Verification
+=======
+>>>>>>> master
OMNIAUTH_EMAIL_PREFIX = 'omniauth@participacion'
OMNIAUTH_EMAIL_REGEX = /\A#{OMNIAUTH_EMAIL_PREFIX}/
@@ -11,13 +14,16 @@ class User < ActiveRecord::Base
acts_as_voter
acts_as_paranoid column: :hidden_at
+ include ActsAsParanoidAliases
has_one :address
has_one :administrator
has_one :moderator
has_one :organization
- has_many :inappropiate_flags
+ has_many :flags
has_many :identities, dependent: :destroy
+ has_many :debates, -> { with_hidden }, foreign_key: :author_id
+ has_many :comments, -> { with_hidden }
validates :username, presence: true, unless: :organization?
validates :official_level, inclusion: {in: 0..5}
@@ -116,4 +122,5 @@ class User < ActiveRecord::Base
!!(email && email !~ OMNIAUTH_EMAIL_REGEX) ||
!!(unconfirmed_email && unconfirmed_email !~ OMNIAUTH_EMAIL_REGEX)
end
+
end
diff --git a/app/views/admin/comments/index.html.erb b/app/views/admin/comments/index.html.erb
index 87b25680d..941e1e9ed 100644
--- a/app/views/admin/comments/index.html.erb
+++ b/app/views/admin/comments/index.html.erb
@@ -1,13 +1,17 @@
<%= t("admin.comments.index.title") %>
-
- <%= t("admin.comments.index.filter") %>:
- - <%= t("admin.comments.filters.all") %>
- - <%= t("admin.comments.filters.pending") %>
- - <%= t("admin.comments.filters.archived") %>
+
+ <% @valid_filters.each do |filter| %>
+ <% if @filter == filter %>
+ - <%= t("admin.comments.index.filters.#{filter}") %>
+ <% else %>
+ - <%= link_to t("admin.comments.index.filters.#{filter}"),
+ admin_comments_path(filter: filter) %>
+ <% end %>
+ <% end %>
-
<%= page_entries_info @comments %>
@@ -17,17 +21,19 @@
<%= comment.body %>
-
- <%= link_to t("admin.comments.index.show_debate"), "#" %>
-
+ <%= link_to comment.commentable.title, comment.commentable %>
-
- <%= link_to t("admin.actions.archive"), "#", class: "button radius tiny warning" %>
-
- <%= link_to t("admin.actions.restore"), restore_admin_comment_path(comment),
- method: :put, data: { confirm: t("admin.actions.confirm") },
- class: "button radius tiny success" %>
+ <%= link_to t("admin.actions.restore"),
+ restore_admin_comment_path(comment, request.query_parameters),
+ method: :put,
+ data: { confirm: t("admin.actions.confirm") },
+ class: "button radius tiny success right" %>
+
+ <%= link_to t("admin.actions.confirm_hide"),
+ confirm_hide_admin_comment_path(comment, request.query_parameters),
+ method: :put,
+ class: "button radius tiny warning right" %>
diff --git a/app/views/admin/debates/index.html.erb b/app/views/admin/debates/index.html.erb
index dbd85a46f..cdeb7b016 100644
--- a/app/views/admin/debates/index.html.erb
+++ b/app/views/admin/debates/index.html.erb
@@ -1,30 +1,37 @@
<%= t("admin.debates.index.title") %>
-
- <%= t("admin.debates.index.filter") %>:
- - <%= t("admin.debates.filters.all") %>
- - <%= t("admin.debates.filters.pending") %>
- - <%= t("admin.debates.filters.archived") %>
+
+ <% @valid_filters.each do |filter| %>
+ <% if @filter == filter %>
+ - <%= t("admin.debates.index.filters.#{filter}") %>
+ <% else %>
+ - <%= link_to t("admin.debates.index.filters.#{filter}"),
+ admin_debates_path(filter: filter) %>
+ <% end %>
+ <% end %>
-
<%= page_entries_info @debates %>
<% @debates.each do |debate| %>
-
- <%= link_to debate.title, admin_debate_path(debate) %>
+ <%= link_to debate.title, debate_path(debate) %>
- <%= link_to t("admin.actions.restore"), restore_admin_debate_path(debate),
- method: :put, data: { confirm: t("admin.actions.confirm") },
+ <%= link_to t("admin.actions.restore"),
+ restore_admin_debate_path(debate, request.query_parameters),
+ method: :put,
+ data: { confirm: t("admin.actions.confirm") },
class: "button radius tiny success right" %>
-
- <%= link_to t("admin.actions.archive"), "#", class: "button radius tiny warning right" %>
-
+ <%= link_to t("admin.actions.confirm_hide"),
+ confirm_hide_admin_debate_path(debate, request.query_parameters),
+ method: :put,
+ class: "button radius tiny warning right" %>
<% end %>
-<%= paginate @debates %>
\ No newline at end of file
+<%= paginate @debates %>
diff --git a/app/views/admin/debates/show.html.erb b/app/views/admin/debates/show.html.erb
deleted file mode 100644
index e740baf47..000000000
--- a/app/views/admin/debates/show.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<%= t("admin.debates.index.title") %>
-
-<%= @debate.title %>
-
-<%= @debate.description %>
-
-<%= link_to t("admin.debates.show.back"), admin_debates_path,
- class: "button radius small secondary" %>
-
-<%= link_to t("admin.actions.restore"), restore_admin_debate_path(@debate),
- method: :put, data: { confirm: t("admin.actions.confirm") },
- class: "button radius small success" %>
diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb
index 5c84468f8..8f728295d 100644
--- a/app/views/admin/users/index.html.erb
+++ b/app/views/admin/users/index.html.erb
@@ -1,5 +1,18 @@
<%= t("admin.users.index.title") %>
+
+ - <%= t("admin.users.index.filter") %>:
+
+ <% @valid_filters.each do |filter| %>
+ <% if @filter == filter %>
+ - <%= t("admin.users.index.filters.#{filter}") %>
+ <% else %>
+ - <%= link_to t("admin.users.index.filters.#{filter}"),
+ admin_users_path(filter: filter) %>
+ <% end %>
+ <% end %>
+
+
<%= page_entries_info @users %>
@@ -7,8 +20,16 @@
-
<%= link_to user.name, admin_user_path(user) %>
- <%= link_to t("admin.users.index.restore"), restore_admin_user_path(user),
- method: :put, data: { confirm: t('admin.actions.confirm') }, class: "button radius tiny right" %>
+ <%= link_to t("admin.actions.restore"),
+ restore_admin_user_path(user, request.query_parameters),
+ method: :put,
+ data: { confirm: t("admin.actions.confirm") },
+ class: "button radius tiny success right" %>
+
+ <%= link_to t("admin.actions.confirm_hide"),
+ confirm_hide_admin_user_path(user, request.query_parameters),
+ method: :put,
+ class: "button radius tiny warning right" %>
<% end %>
diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb
index 375d9110e..79a4b223e 100644
--- a/app/views/admin/users/show.html.erb
+++ b/app/views/admin/users/show.html.erb
@@ -6,8 +6,6 @@
<%= t("admin.users.show.hidden_at") %> <%= @user.hidden_at %>
- <%= link_to t("admin.users.show.restore"), restore_admin_user_path(@user),
- method: :put, data: { confirm: t('admin.actions.confirm') }, class: "button radius tiny" %>
<%= link_to t("admin.users.show.back"), admin_users_path,
class: "button radius tiny secondary" %>
@@ -19,7 +17,7 @@
<% @debates.each do |debate| %>
-
- <%= link_to debate.title, admin_debate_path(debate) %>
+ <%= link_to debate.title, debate_path(debate) %>
<% end %>
diff --git a/app/views/comments/_actions.html.erb b/app/views/comments/_actions.html.erb
index 51a6743e0..c4bb0d072 100644
--- a/app/views/comments/_actions.html.erb
+++ b/app/views/comments/_actions.html.erb
@@ -1,5 +1,5 @@
-
- <%= render 'comments/flag_as_inappropiate_actions', comment: comment %>
+
+ <%= render 'comments/flag_actions', comment: comment %>
diff --git a/app/views/comments/_flag_as_inappropiate_actions.html.erb b/app/views/comments/_flag_actions.html.erb
similarity index 65%
rename from app/views/comments/_flag_as_inappropiate_actions.html.erb
rename to app/views/comments/_flag_actions.html.erb
index 9fba8b5b2..f1557668c 100644
--- a/app/views/comments/_flag_as_inappropiate_actions.html.erb
+++ b/app/views/comments/_flag_actions.html.erb
@@ -1,23 +1,23 @@
-<% if can? :flag_as_inappropiate, comment %>
+<% if can? :flag, comment %>
|
-
+
<% end %>
-<% if can? :undo_flag_as_inappropiate, comment %>
+<% if can? :unflag, comment %>
|
-
+
<% end %>
diff --git a/app/views/comments/_refresh_flag_actions.js.erb b/app/views/comments/_refresh_flag_actions.js.erb
new file mode 100644
index 000000000..01c1dcf76
--- /dev/null
+++ b/app/views/comments/_refresh_flag_actions.js.erb
@@ -0,0 +1 @@
+$("#<%= dom_id(@comment) %> .js-flag-actions").html('<%= j render("comments/flag_actions", comment: @comment) %>');
diff --git a/app/views/comments/_refresh_flag_as_inappropiate_actions.js.erb b/app/views/comments/_refresh_flag_as_inappropiate_actions.js.erb
deleted file mode 100644
index 58f356f2b..000000000
--- a/app/views/comments/_refresh_flag_as_inappropiate_actions.js.erb
+++ /dev/null
@@ -1 +0,0 @@
-$("#<%= dom_id(@comment) %> .js-flag-as-inappropiate-actions").html('<%= j render("comments/flag_as_inappropiate_actions", comment: @comment) %>');
diff --git a/app/views/debates/_flag_as_inappropiate_actions.html.erb b/app/views/debates/_flag_actions.html.erb
similarity index 63%
rename from app/views/debates/_flag_as_inappropiate_actions.html.erb
rename to app/views/debates/_flag_actions.html.erb
index 6c3d34236..07fff9329 100644
--- a/app/views/debates/_flag_as_inappropiate_actions.html.erb
+++ b/app/views/debates/_flag_actions.html.erb
@@ -1,21 +1,21 @@
-<% if can? :flag_as_inappropiate, debate %>
-
+<% if can? :flag, debate %>
+
-
- <%= link_to t('shared.flag_as_inappropiate'), flag_as_inappropiate_debate_path(debate), method: :put, remote: true, id: "flag-debate-#{ debate.id }" %>
+ <%= link_to t('shared.flag'), flag_debate_path(debate), method: :put, remote: true, id: "flag-debate-#{ debate.id }" %>
<% end %>
-<% if can? :undo_flag_as_inappropiate, debate %>
-
+<% if can? :unflag, debate %>
+
-
- <%= link_to t('shared.undo_flag_as_inappropiate'), undo_flag_as_inappropiate_debate_path(debate), method: :put, remote: true, id: "unflag-debate-#{ debate.id }" %>
+ <%= link_to t('shared.unflag'), unflag_debate_path(debate), method: :put, remote: true, id: "unflag-debate-#{ debate.id }" %>
<% end %>
diff --git a/app/views/debates/_refresh_flag_actions.js.erb b/app/views/debates/_refresh_flag_actions.js.erb
new file mode 100644
index 000000000..f511f347f
--- /dev/null
+++ b/app/views/debates/_refresh_flag_actions.js.erb
@@ -0,0 +1 @@
+$("#<%= dom_id(@debate) %> .js-flag-actions").html('<%= j render("debates/flag_actions", debate: @debate) %>');
diff --git a/app/views/debates/_refresh_flag_as_inappropiate_actions.js.erb b/app/views/debates/_refresh_flag_as_inappropiate_actions.js.erb
deleted file mode 100644
index 7be008e35..000000000
--- a/app/views/debates/_refresh_flag_as_inappropiate_actions.js.erb
+++ /dev/null
@@ -1 +0,0 @@
-$("#<%= dom_id(@debate) %> .js-flag-as-inappropiate-actions").html('<%= j render("debates/flag_as_inappropiate_actions", debate: @debate) %>');
diff --git a/app/views/debates/new.html.erb b/app/views/debates/new.html.erb
index 7987265bd..f9fe689da 100644
--- a/app/views/debates/new.html.erb
+++ b/app/views/debates/new.html.erb
@@ -16,6 +16,8 @@
<%= t("debates.new.recommendation_one") %>
<%= t("debates.new.recommendation_two") %>
<%= t("debates.new.recommendation_three") %>
+ <%= t("debates.new.recommendation_four") %>
+ <%= t("debates.new.recommendation_five") %>
-
\ No newline at end of file
+
diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb
index af25f28b1..8fab71128 100644
--- a/app/views/debates/show.html.erb
+++ b/app/views/debates/show.html.erb
@@ -42,8 +42,8 @@
<%= link_to t("debates.show.comments", count: @debate.comments_count), "#comments" %>
•
-
- <%= render 'debates/flag_as_inappropiate_actions', debate: @debate %>
+
+ <%= render 'debates/flag_actions', debate: @debate %>
diff --git a/app/views/layouts/_admin_header.html.erb b/app/views/layouts/_admin_header.html.erb
index 13424e5e8..fdc1d6c6e 100644
--- a/app/views/layouts/_admin_header.html.erb
+++ b/app/views/layouts/_admin_header.html.erb
@@ -23,14 +23,4 @@
-
- <% if home_page? %>
-
-
-
<%= t("layouts.header.open_city") %>
- <%= t("layouts.header.open_city_slogan") %>
- <%= link_to t("layouts.header.see_all_debates"), debates_path, class: 'button radius' %>
-
-
- <% end %>
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index 64d6fe8a4..5ad0e6c8b 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -1,36 +1,35 @@