diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3cd7580ee..369cabe84 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -43,10 +43,9 @@ module ApplicationHelper authorable.author_id == user.id end - def back_link_to(destination_path) - destination = destination_path || :back + def back_link_to(destination = :back, text = t("shared.back")) link_to destination, class: "back" do - "".html_safe + t("shared.back") + content_tag(:span, nil, class: "icon-angle-left") + text end end diff --git a/app/views/admin/geozones/edit.html.erb b/app/views/admin/geozones/edit.html.erb index b6b8c3fd9..554d82e98 100644 --- a/app/views/admin/geozones/edit.html.erb +++ b/app/views/admin/geozones/edit.html.erb @@ -1,10 +1,6 @@
-
- <%= link_to admin_geozones_path, class: "back" do %> - - <%= t("admin.geozones.edit.back") %> - <% end %> + <%= back_link_to admin_geozones_path, t("admin.geozones.edit.back") %>

<%= t("admin.geozones.edit.editing") %>

diff --git a/app/views/admin/geozones/new.html.erb b/app/views/admin/geozones/new.html.erb index 0d5080337..14e43e34e 100644 --- a/app/views/admin/geozones/new.html.erb +++ b/app/views/admin/geozones/new.html.erb @@ -1,10 +1,6 @@
-
- <%= link_to admin_geozones_path, class: "back" do %> - - <%= t("admin.geozones.new.back") %> - <% end %> + <%= back_link_to admin_geozones_path, t("admin.geozones.new.back") %>

<%= t("admin.geozones.new.creating") %>

diff --git a/app/views/admin/hidden_users/show.html.erb b/app/views/admin/hidden_users/show.html.erb index 9fe69ef44..9eae29589 100644 --- a/app/views/admin/hidden_users/show.html.erb +++ b/app/views/admin/hidden_users/show.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>

<%= t("admin.hidden_users.show.title", user: @user.name) %>

diff --git a/app/views/admin/legislation/draft_versions/edit.html.erb b/app/views/admin/legislation/draft_versions/edit.html.erb index c041f02c2..9a1d959f1 100644 --- a/app/views/admin/legislation/draft_versions/edit.html.erb +++ b/app/views/admin/legislation/draft_versions/edit.html.erb @@ -4,10 +4,8 @@
- <%= link_to admin_legislation_process_draft_versions_path(@process), class: "back" do %> - - <%= t("admin.legislation.draft_versions.edit.back") %> - <% end %> + <%= back_link_to admin_legislation_process_draft_versions_path(@process), + t("admin.legislation.draft_versions.edit.back") %>

<%= @process.title %>

diff --git a/app/views/admin/legislation/draft_versions/index.html.erb b/app/views/admin/legislation/draft_versions/index.html.erb index a4d8fea24..26310b19e 100644 --- a/app/views/admin/legislation/draft_versions/index.html.erb +++ b/app/views/admin/legislation/draft_versions/index.html.erb @@ -4,10 +4,7 @@
- <%= link_to admin_legislation_processes_path, class: "back" do %> - - <%= t("admin.legislation.processes.edit.back") %> - <% end %> + <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>

<%= @process.title %>

diff --git a/app/views/admin/legislation/draft_versions/new.html.erb b/app/views/admin/legislation/draft_versions/new.html.erb index 81509531c..63ab6f8e7 100644 --- a/app/views/admin/legislation/draft_versions/new.html.erb +++ b/app/views/admin/legislation/draft_versions/new.html.erb @@ -4,10 +4,8 @@
- <%= link_to admin_legislation_process_draft_versions_path(@process), class: "back" do %> - - <%= t("admin.legislation.draft_versions.new.back") %> - <% end %> + <%= back_link_to admin_legislation_process_draft_versions_path(@process), + t("admin.legislation.draft_versions.new.back") %>

<%= @process.title %>

diff --git a/app/views/admin/legislation/processes/edit.html.erb b/app/views/admin/legislation/processes/edit.html.erb index 38bb01147..5d2c1aa8a 100644 --- a/app/views/admin/legislation/processes/edit.html.erb +++ b/app/views/admin/legislation/processes/edit.html.erb @@ -5,10 +5,7 @@
- <%= link_to admin_legislation_processes_path, class: "back" do %> - - <%= t("admin.legislation.processes.edit.back") %> - <% end %> + <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>

<%= @process.title %>

diff --git a/app/views/admin/legislation/processes/new.html.erb b/app/views/admin/legislation/processes/new.html.erb index 026697faa..8acb724db 100644 --- a/app/views/admin/legislation/processes/new.html.erb +++ b/app/views/admin/legislation/processes/new.html.erb @@ -5,10 +5,7 @@
- <%= link_to admin_legislation_processes_path, class: "back" do %> - - <%= t("admin.legislation.processes.new.back") %> - <% end %> + <%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.new.back") %>

<%= t("admin.legislation.processes.new.title") %>

diff --git a/app/views/admin/legislation/questions/edit.html.erb b/app/views/admin/legislation/questions/edit.html.erb index b87f7daeb..f2293b6c3 100644 --- a/app/views/admin/legislation/questions/edit.html.erb +++ b/app/views/admin/legislation/questions/edit.html.erb @@ -4,10 +4,7 @@
- <%= link_to admin_legislation_process_questions_path(@process), class: "back" do %> - - <%= t("admin.legislation.questions.edit.back") %> - <% end %> + <%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.edit.back") %>

<%= @process.title %>

diff --git a/app/views/admin/legislation/questions/index.html.erb b/app/views/admin/legislation/questions/index.html.erb index d630fa659..fbbb7c93b 100644 --- a/app/views/admin/legislation/questions/index.html.erb +++ b/app/views/admin/legislation/questions/index.html.erb @@ -4,10 +4,7 @@
- <%= link_to admin_legislation_processes_path, class: "back" do %> - - <%= t("admin.legislation.questions.index.back") %> - <% end %> + <%= back_link_to admin_legislation_processes_path, t("admin.legislation.questions.index.back") %>

<%= @process.title %>

diff --git a/app/views/admin/legislation/questions/new.html.erb b/app/views/admin/legislation/questions/new.html.erb index eb3aa7ec1..877c70eb5 100644 --- a/app/views/admin/legislation/questions/new.html.erb +++ b/app/views/admin/legislation/questions/new.html.erb @@ -4,10 +4,7 @@
- <%= link_to admin_legislation_process_questions_path(@process), class: "back" do %> - - <%= t("admin.legislation.questions.new.back") %> - <% end %> + <%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.new.back") %>

<%= @process.title %>

diff --git a/app/views/admin/officials/edit.html.erb b/app/views/admin/officials/edit.html.erb index 10ec9b23f..4696ea4de 100644 --- a/app/views/admin/officials/edit.html.erb +++ b/app/views/admin/officials/edit.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>
diff --git a/app/views/admin/poll/polls/edit.html.erb b/app/views/admin/poll/polls/edit.html.erb index cf131203f..1ba88359e 100644 --- a/app/views/admin/poll/polls/edit.html.erb +++ b/app/views/admin/poll/polls/edit.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>

<%= t("admin.polls.edit.title") %>

diff --git a/app/views/admin/poll/polls/new.html.erb b/app/views/admin/poll/polls/new.html.erb index ba1ae7260..1203688d5 100644 --- a/app/views/admin/poll/polls/new.html.erb +++ b/app/views/admin/poll/polls/new.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>

<%= t("admin.polls.new.title") %>

diff --git a/app/views/admin/poll/questions/edit.html.erb b/app/views/admin/poll/questions/edit.html.erb index 6c4d24adf..48998081a 100644 --- a/app/views/admin/poll/questions/edit.html.erb +++ b/app/views/admin/poll/questions/edit.html.erb @@ -1,4 +1,4 @@ -<%= render "shared/back_link" %> +<%= back_link_to %>

<%= t("admin.questions.edit.title") %>

diff --git a/app/views/admin/poll/questions/new.html.erb b/app/views/admin/poll/questions/new.html.erb index 830492d6d..844195920 100644 --- a/app/views/admin/poll/questions/new.html.erb +++ b/app/views/admin/poll/questions/new.html.erb @@ -1,4 +1,4 @@ -<%= render "shared/back_link" %> +<%= back_link_to %>

<%= t("admin.questions.new.title") %>

diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index a8f25f2bd..3be660f79 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -1,4 +1,4 @@ -<%= render "shared/back_link" %> +<%= back_link_to %> <%= link_to t('shared.edit'), edit_admin_question_path(@question), class: "button hollow float-right" %> diff --git a/app/views/admin/signature_sheets/new.html.erb b/app/views/admin/signature_sheets/new.html.erb index a1f2436bb..bec2f359d 100644 --- a/app/views/admin/signature_sheets/new.html.erb +++ b/app/views/admin/signature_sheets/new.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>

<%= t("admin.signature_sheets.new.title") %>

diff --git a/app/views/admin/stats/direct_messages.html.erb b/app/views/admin/stats/direct_messages.html.erb index b87e2b3e3..4a8a55829 100644 --- a/app/views/admin/stats/direct_messages.html.erb +++ b/app/views/admin/stats/direct_messages.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>

<%= t("admin.stats.direct_messages.title")%>

diff --git a/app/views/admin/stats/proposal_notifications.html.erb b/app/views/admin/stats/proposal_notifications.html.erb index 51130424d..102eb0c60 100644 --- a/app/views/admin/stats/proposal_notifications.html.erb +++ b/app/views/admin/stats/proposal_notifications.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>

<%= t("admin.stats.proposal_notifications.title")%>

diff --git a/app/views/admin/valuators/summary.html.erb b/app/views/admin/valuators/summary.html.erb index 81cbc54d4..19d1dde20 100644 --- a/app/views/admin/valuators/summary.html.erb +++ b/app/views/admin/valuators/summary.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/back_link' %> +<%= back_link_to %>

<%= t("admin.valuators.summary.title") %>

diff --git a/app/views/comments/show.html.erb b/app/views/comments/show.html.erb index 90e49a7d3..37d379d4f 100644 --- a/app/views/comments/show.html.erb +++ b/app/views/comments/show.html.erb @@ -1,9 +1,7 @@
- <%= link_to commentable_path(@comment), class: "back" do %> - - <%= t("comments.show.return_to_commentable") + @comment.commentable.title %> - <% end %> + <%= back_link_to commentable_path(@comment), + t("comments.show.return_to_commentable") + @comment.commentable.title %>
diff --git a/app/views/debates/edit.html.erb b/app/views/debates/edit.html.erb index 13a2aa625..8645be255 100644 --- a/app/views/debates/edit.html.erb +++ b/app/views/debates/edit.html.erb @@ -1,7 +1,7 @@
- <%= render "shared/back_link" %> + <%= back_link_to %>
<%= link_to t("debates.edit.show_link"), @debate %> diff --git a/app/views/debates/new.html.erb b/app/views/debates/new.html.erb index ccd11bec2..5085ca17a 100644 --- a/app/views/debates/new.html.erb +++ b/app/views/debates/new.html.erb @@ -1,7 +1,7 @@
- <%= render "shared/back_link" %> + <%= back_link_to %>

<%= t("debates.new.start_new") %>

diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 0a57b2997..44fa08a06 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -7,7 +7,7 @@
- <%= render "shared/back_link" %> + <%= back_link_to %> <% if current_user && @debate.editable_by?(current_user) %> <%= link_to edit_debate_path(@debate), class: 'edit-debate button success small float-right' do %> diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb index 3413f26f0..fd0081337 100644 --- a/app/views/direct_messages/new.html.erb +++ b/app/views/direct_messages/new.html.erb @@ -1,6 +1,6 @@
- <%= render 'shared/back_link' %> + <%= back_link_to %>

<%= t("users.direct_messages.new.title", receiver: @receiver.name) %> diff --git a/app/views/direct_messages/show.html.erb b/app/views/direct_messages/show.html.erb index 8d0f62d84..cc98c8a89 100644 --- a/app/views/direct_messages/show.html.erb +++ b/app/views/direct_messages/show.html.erb @@ -1,9 +1,6 @@
- <%= link_to user_path(@direct_message.receiver), class: "back" do %> - - <%= t("shared.back") %> - <% end %> + <%= back_link_to user_path(@direct_message.receiver) %>
diff --git a/app/views/management/user_invites/create.html.erb b/app/views/management/user_invites/create.html.erb index 3d573532f..3e346e4f2 100644 --- a/app/views/management/user_invites/create.html.erb +++ b/app/views/management/user_invites/create.html.erb @@ -1,5 +1,5 @@
- <%= render 'shared/back_link' %> + <%= back_link_to %>

<%= t('management.user_invites.create.title') %>

diff --git a/app/views/pages/more_info/faq/index.html.erb b/app/views/pages/more_info/faq/index.html.erb index 0a1158f60..db8bfaf6e 100644 --- a/app/views/pages/more_info/faq/index.html.erb +++ b/app/views/pages/more_info/faq/index.html.erb @@ -4,7 +4,7 @@