diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss
index 3f23b11f4..e9429a495 100644
--- a/app/assets/stylesheets/layout.scss
+++ b/app/assets/stylesheets/layout.scss
@@ -1937,7 +1937,7 @@ table {
opacity: 0.4;
}
-.filter-comments {
+.wide-order-selector {
float: none;
margin-top: 0;
@@ -1993,4 +1993,4 @@ table {
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
-}
\ No newline at end of file
+}
diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb
index 7981fb121..1c0765c64 100644
--- a/app/controllers/debates_controller.rb
+++ b/app/controllers/debates_controller.rb
@@ -7,6 +7,7 @@ class DebatesController < ApplicationController
before_action :authenticate_user!, except: [:index, :show]
has_orders %w{hot_score confidence_score created_at most_commented random}, only: :index
+ has_orders %w{most_voted created_at}, only: :show
load_and_authorize_resource
respond_to :html, :js
diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb
index aa91ad02f..4c308ebe2 100644
--- a/app/controllers/proposals_controller.rb
+++ b/app/controllers/proposals_controller.rb
@@ -7,6 +7,7 @@ class ProposalsController < ApplicationController
before_action :authenticate_user!, except: [:index, :show]
has_orders %w{hot_score confidence_score created_at most_commented random}, only: :index
+ has_orders %w{most_voted created_at}, only: :show
load_and_authorize_resource
respond_to :html, :js
diff --git a/app/views/debates/_comments.html.erb b/app/views/debates/_comments.html.erb
index 6018f1bdf..4c9ad6a69 100644
--- a/app/views/debates/_comments.html.erb
+++ b/app/views/debates/_comments.html.erb
@@ -7,22 +7,7 @@
-
-
-
+ <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %>
@@ -43,4 +28,4 @@
-<% end %>
\ No newline at end of file
+<% end %>
diff --git a/app/views/proposals/_comments.html.erb b/app/views/proposals/_comments.html.erb
index 8f682c3b4..6a6868f5c 100644
--- a/app/views/proposals/_comments.html.erb
+++ b/app/views/proposals/_comments.html.erb
@@ -8,22 +8,7 @@
-
-
-
+ <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @proposal, parent_id: nil, toggeable: false} %>
@@ -44,4 +29,4 @@
-<% end %>
\ No newline at end of file
+<% end %>
diff --git a/app/views/shared/_wide_order_selector.html.erb b/app/views/shared/_wide_order_selector.html.erb
new file mode 100644
index 000000000..defa8415e
--- /dev/null
+++ b/app/views/shared/_wide_order_selector.html.erb
@@ -0,0 +1,24 @@
+<% # Params:
+ #
+ # i18n_namespace: for example "moderation.debates.index"
+%>
+
+
diff --git a/app/views/shared/_wide_order_selector.rb b/app/views/shared/_wide_order_selector.rb
new file mode 100644
index 000000000..883205493
--- /dev/null
+++ b/app/views/shared/_wide_order_selector.rb
@@ -0,0 +1,16 @@
+<% # Params:
+ #
+ # i18n_namespace: for example "moderation.debates.index"
+%>
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index e1af67760..83a4bf0e4 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -243,6 +243,10 @@ en:
form:
submit_button: "Save changes"
comments:
+ select_order: "Sort by"
+ orders:
+ most_voted: "Most voted"
+ created_at: "Newest"
form:
leave_comment: Write a comment
comment_as_moderator: Comment as moderator
diff --git a/config/locales/es.yml b/config/locales/es.yml
index d5a615850..c17484c99 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -243,6 +243,10 @@ es:
form:
submit_button: "Guardar cambios"
comments:
+ select_order: "Ordenar por"
+ orders:
+ most_voted: "Más votados"
+ created_at: "Más nuevos"
form:
leave_comment: Deja tu comentario
comment_as_moderator: Comentar como moderador