From e7d6831900e5231e5502e8c4a6afb8069df0f0a4 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sun, 15 Jan 2017 22:40:13 +0100 Subject: [PATCH 1/3] Add .wti to .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 46f688972..072691512 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,6 @@ diaspora.iml # Dolphin's directory's preferences files *.directory + +# WebTranslateIt +.wti From fa0bd14dfbbab7658e2fdbd2ad14b4439967ebd0 Mon Sep 17 00:00:00 2001 From: spixi Date: Sun, 8 Jan 2017 17:43:06 +0100 Subject: [PATCH 2/3] Fix script/server when bin/ is not in PATH This fixes an issue, when the bin/ directory of diaspora is not in the PATH variable closes #7281 --- Changelog.md | 1 + script/server | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index a2651e9c4..f9c32963d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ ## Refactor ## Bug fixes +* Fix path to `bundle` in `script/server` [#7281](https://github.com/diaspora/diaspora/pull/7281) ## Features diff --git a/script/server b/script/server index d8d35aad8..715697d44 100755 --- a/script/server +++ b/script/server @@ -87,7 +87,7 @@ if [ $? -eq 0 ]; then fi # Check if bundle is complete -if ! bundle check > /dev/null +if ! bin/bundle check > /dev/null then fatal "Your bundle is not up to date, run the command \"bundle install\"" fi From 941118d7af07230c097ad8c026ecbc6ac06cb7e4 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sun, 15 Jan 2017 20:49:41 +0100 Subject: [PATCH 3/3] Move formatting from locale to views closes #7283 --- app/helpers/report_helper.rb | 2 +- app/views/admins/stats.html.haml | 10 +++++++--- config/locales/diaspora/en.yml | 8 ++++---- spec/controllers/admins_controller_spec.rb | 12 +++++++++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/helpers/report_helper.rb b/app/helpers/report_helper.rb index 67b5ba6ad..248587d94 100644 --- a/app/helpers/report_helper.rb +++ b/app/helpers/report_helper.rb @@ -13,7 +13,7 @@ module ReportHelper post_path(item.post.id, anchor: item.guid) )) else - raw t("report.not_found") + t("report.not_found") end end diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index 8f9082ef6..d2d5fcc5e 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -20,7 +20,7 @@ = submit_tag t('.go'), class: 'btn btn-primary' %h3 - != t('.display_results', :segment => @segment) + != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) .row - [:posts, :comments, :aspect_memberships, :users].each do |name| @@ -45,7 +45,9 @@ .row .col-md-12 %p.alert.alert-info.text-center{role: "alert"} - != t('.current_segment', :post_yest => @posts[:yesterday]/@user_count.to_f, :post_day => @posts[:day_before]/@user_count.to_f) + != t("admins.stats.current_segment", + post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f), + post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) .row .col-md-12 @@ -53,4 +55,6 @@ %ul - @popular_tags.each do |name,count| %li - != t('.tag_name', :name_tag => name, :count_tag => count) + != t("admins.stats.tag_name", + name_tag: content_tag(:strong, name), + count_tag: content_tag(:strong, count)) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 37fd1565d..669079d3a 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -138,7 +138,7 @@ en: daily: "Daily" usage_statistic: "Usage statistics" go: "Go" - display_results: "Displaying results from the %{segment} segment" + display_results: "Displaying results from the %{segment} segment" posts: zero: "%{count} posts" one: "%{count} post" @@ -155,9 +155,9 @@ en: zero: "%{count} users" one: "%{count} user" other: "%{count} users" - current_segment: "The current segment is averaging %{post_yest} posts per user, from %{post_day}" + current_segment: "The current segment is averaging %{post_yest} posts per user, from %{post_day}" 50_most: "50 most popular tags" - tag_name: "Tag name: %{name_tag} Count: %{count_tag}" + tag_name: "Tag name: %{name_tag} Count: %{count_tag}" pods: pod_network: "Pod network" aspects: @@ -943,7 +943,7 @@ en: delete_link: "Delete item" reported_user_details: "Details on reported user" confirm_deletion: "Are you sure to delete the item?" - not_found: "The post/comment was not found. It seems that it was deleted by the user!" + not_found: "The post/comment was not found. It seems that it was deleted by the user!" status: destroyed: "The post was destroyed" failed: "Something went wrong" diff --git a/spec/controllers/admins_controller_spec.rb b/spec/controllers/admins_controller_spec.rb index 8d617d7c9..4dfdd0ef5 100644 --- a/spec/controllers/admins_controller_spec.rb +++ b/spec/controllers/admins_controller_spec.rb @@ -140,7 +140,9 @@ describe AdminsController, :type => :controller do expect(response).to be_success expect(response).to render_template(:stats) expect(response.body).to include( - I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.daily")) + I18n.translate( + "admins.stats.display_results", segment: "#{I18n.translate('admins.stats.daily')}" + ) ) end @@ -150,10 +152,14 @@ describe AdminsController, :type => :controller do expect(response).to be_success expect(response).to render_template(:stats) expect(response.body).not_to include( - I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.daily")) + I18n.translate( + "admins.stats.display_results", segment: "#{I18n.translate('admins.stats.daily')}" + ) ) expect(response.body).to include( - I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.#{range}")) + I18n.translate( + "admins.stats.display_results", segment: "#{I18n.translate("admins.stats.#{range}")}" + ) ) end end