diff --git a/app/controllers/concerns/commentable_actions.rb b/app/controllers/concerns/commentable_actions.rb index 66e2456de..2c6d1da81 100644 --- a/app/controllers/concerns/commentable_actions.rb +++ b/app/controllers/concerns/commentable_actions.rb @@ -3,6 +3,7 @@ module CommentableActions include Polymorphic include Search include DownloadSettingsHelper + include RemotelyTranslatable def index @resources = resource_model.all @@ -23,6 +24,8 @@ module CommentableActions set_resource_votes(@resources) set_resources_instance + @remote_translations = detect_remote_translations(@resources, featured_proposals) + respond_to do |format| format.html format.csv {send_data to_csv(resources_csv, resource_model), @@ -38,6 +41,7 @@ module CommentableActions @comment_tree = CommentTree.new(@commentable, params[:page], @current_order) set_comment_flags(@comment_tree.comments) set_resource_instance + @remote_translations = detect_remote_translations([@resource], @comment_tree.comments) end def new @@ -132,4 +136,7 @@ module CommentableActions end end + def featured_proposals + @featured_proposals ||= [] + end end diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 8c58682f5..9dfcbcc0f 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -21,6 +21,14 @@ describe "Debates" do "edit_debate_path", %w[title], { "description" => :ckeditor } + it_behaves_like "remotely_translatable", + :debate, + "debates_path", + {} + it_behaves_like "remotely_translatable", + :debate, + "debate_path", + { "id": "id" } end scenario "Index" do diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index bfaef572c..62e851e6d 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -25,6 +25,14 @@ describe "Proposals" do "edit_proposal_path", %w[title summary], { "description" => :ckeditor } + it_behaves_like "remotely_translatable", + :proposal, + "proposals_path", + {} + it_behaves_like "remotely_translatable", + :proposal, + "proposal_path", + { "id": "id" } end context "Index" do