Commit b6f670c82379b0ad5b331fcd1b86f2642596e71f
1 parent
09f663fc
Exists in
master
and in
1 other branch
Fix spec and extract some string in translation
Showing
2 changed files
with
57 additions
and
29 deletions
Show diff stats
app/views/apps/show.html.haml
1 | - content_for :title, app.name | 1 | - content_for :title, app.name |
2 | - content_for :head do | 2 | - content_for :head do |
3 | - = auto_discovery_link_tag :atom, app_path(app, User.token_authentication_key => current_user.authentication_token, :format => "atom"), :title => "Errbit notices for #{app.name} at #{request.host}" | 3 | + = auto_discovery_link_tag :atom, app_path(app, User.token_authentication_key => current_user.authentication_token, :format => "atom"), :title => t('.atom_title', :name => app.name, :host => request.host) |
4 | - content_for :meta do | 4 | - content_for :meta do |
5 | - %strong Errors Caught: | 5 | + %strong=t('.errors_caught') |
6 | = app.problems.count | 6 | = app.problems.count |
7 | - %strong Deploy Count: | 7 | + %strong=t('.deploy_count') |
8 | = app.deploys.count | 8 | = app.deploys.count |
9 | - %strong API Key: | 9 | + %strong=t('.api_key') |
10 | = app.api_key | 10 | = app.api_key |
11 | - content_for :action_bar do | 11 | - content_for :action_bar do |
12 | - if current_user.admin? | 12 | - if current_user.admin? |
13 | - = link_to 'edit', edit_app_path(app), :class => 'button' | 13 | + = link_to t('.edit'), edit_app_path(app), :class => 'button' |
14 | - if all_errs | 14 | - if all_errs |
15 | - = link_to 'unresolved errs', app_path(app), :class => 'button' | 15 | + = link_to t('.unresolved_errs'), app_path(app), :class => 'button' |
16 | - else | 16 | - else |
17 | - = link_to 'all errs', app_path(app, :all_errs => true), :class => 'button' | ||
18 | - = link_to 'unwatch', app_watcher_path({:app_id => @app, :id => current_user.id}), :method => :delete, :class => 'button', :confirm => 'Are you sure?' | 17 | + = link_to t('.all_errs'), app_path(app, :all_errs => true), :class => 'button' |
18 | + = link_to t('.unwatch'), app_watcher_path({:app_id => app, :id => current_user.id}), :method => :delete, :class => 'button', :confirm => 'Are you sure?' | ||
19 | 19 | ||
20 | %h3#watchers_toggle | 20 | %h3#watchers_toggle |
21 | - Watchers | ||
22 | - %span.click_span (show/hide) | 21 | + =t('.watchers') |
22 | + %span.click_span=t('.show_hide') | ||
23 | #watchers_div | 23 | #watchers_div |
24 | - if app.notify_all_users | 24 | - if app.notify_all_users |
25 | %table.watchers | 25 | %table.watchers |
26 | %thead | 26 | %thead |
27 | %tr | 27 | %tr |
28 | - %th All users will be notified when something happens. | 28 | + %th=t('.all_users_notified') |
29 | - else | 29 | - else |
30 | %table.watchers | 30 | %table.watchers |
31 | %thead | 31 | %thead |
32 | %tr | 32 | %tr |
33 | - %th User or Email | 33 | + %th=t('.user_or_email') |
34 | %tbody | 34 | %tbody |
35 | - app.watchers.each do |watcher| | 35 | - app.watchers.each do |watcher| |
36 | %tr | 36 | %tr |
@@ -38,35 +38,35 @@ | @@ -38,35 +38,35 @@ | ||
38 | - if app.watchers.none? | 38 | - if app.watchers.none? |
39 | %tr | 39 | %tr |
40 | %td | 40 | %td |
41 | - %em Sadly, no one is watching this app | 41 | + %em= t('.no_watcher') |
42 | 42 | ||
43 | - if app.github_repo? | 43 | - if app.github_repo? |
44 | %h3#repository_toggle | 44 | %h3#repository_toggle |
45 | - Repository | ||
46 | - %span.click_span (show/hide) | 45 | + =t('.repository') |
46 | + %span.click_span=t('.show_hide') | ||
47 | #repository_div | 47 | #repository_div |
48 | %table.repository | 48 | %table.repository |
49 | %thead | 49 | %thead |
50 | %tr | 50 | %tr |
51 | - %th GitHub Repo | 51 | + %th=t('.github_repo') |
52 | %tbody | 52 | %tbody |
53 | %tr | 53 | %tr |
54 | %td= link_to(app.github_repo, app.github_url, :target => '_blank') | 54 | %td= link_to(app.github_repo, app.github_url, :target => '_blank') |
55 | 55 | ||
56 | %h3#deploys_toggle | 56 | %h3#deploys_toggle |
57 | - Latest Deploys | ||
58 | - %span.click_span (show/hide) | 57 | + =t('.latest_deploys') |
58 | + %span.click_span=t('.show_hide') | ||
59 | #deploys_div | 59 | #deploys_div |
60 | - if deploys.any? | 60 | - if deploys.any? |
61 | %table.deploys | 61 | %table.deploys |
62 | %thead | 62 | %thead |
63 | %tr | 63 | %tr |
64 | - %th When | ||
65 | - %th Environment | ||
66 | - %th Who | ||
67 | - %th Message | ||
68 | - %th Repository | ||
69 | - %th Revision | 64 | + %th=t('.when') |
65 | + %th=t('.environment') | ||
66 | + %th=t('.who') | ||
67 | + %th=t('.message') | ||
68 | + %th=t('.repository') | ||
69 | + %th=t('.revision') | ||
70 | 70 | ||
71 | %tbody | 71 | %tbody |
72 | - deploys.each do |deploy| | 72 | - deploys.each do |deploy| |
@@ -77,20 +77,20 @@ | @@ -77,20 +77,20 @@ | ||
77 | %td.message #{deploy.message} | 77 | %td.message #{deploy.message} |
78 | %td.repository #{deploy.repository} | 78 | %td.repository #{deploy.repository} |
79 | %td.revision #{deploy.short_revision} | 79 | %td.revision #{deploy.short_revision} |
80 | - = link_to "All Deploys (#{app.deploys.count})", app_deploys_path(app), :class => 'button' | 80 | + = link_to t('.all_deploys', :count => app.deploys.count), app_deploys_path(app), :class => 'button' |
81 | - else | 81 | - else |
82 | - %h3 No deploys | 82 | + %h3=t('.no_deploys') |
83 | 83 | ||
84 | - if app.problems.any? | 84 | - if app.problems.any? |
85 | - %h3.clear Errors | 85 | + %h3.clear=t('.errors') |
86 | %section | 86 | %section |
87 | = form_tag search_problems_path(:all_errs => all_errs, :app_id => app.id), :method => :get, :remote => true do | 87 | = form_tag search_problems_path(:all_errs => all_errs, :app_id => app.id), :method => :get, :remote => true do |
88 | - = text_field_tag :search, params[:search], :placeholder => 'Search for issues' | 88 | + = text_field_tag :search, params[:search], :placeholder => t('.search_placeholder') |
89 | %br | 89 | %br |
90 | %section | 90 | %section |
91 | .problem_table{:id => 'problem_table'} | 91 | .problem_table{:id => 'problem_table'} |
92 | = render 'problems/table', :problems => problems | 92 | = render 'problems/table', :problems => problems |
93 | - else | 93 | - else |
94 | - %h3.clear No errs have been caught yet, make sure you setup your app | 94 | + %h3.clear=t('.no_error_yet') |
95 | = render 'configuration_instructions', :app => app | 95 | = render 'configuration_instructions', :app => app |
96 | 96 |
config/locales/en.yml
@@ -78,3 +78,31 @@ en: | @@ -78,3 +78,31 @@ en: | ||
78 | new_app: Add a New App | 78 | new_app: Add a New App |
79 | no_apps: 'No apps here.' | 79 | no_apps: 'No apps here.' |
80 | click_to_create: 'Click here to create your first one' | 80 | click_to_create: 'Click here to create your first one' |
81 | + show: | ||
82 | + all_deploys: "All Deploys (%{count})" | ||
83 | + all_errs: all errs | ||
84 | + all_users_notified: "All users will be notified when something happens." | ||
85 | + api_key: "API Key:" | ||
86 | + atom_title: "Errbit notices for %{name} at %{host}" | ||
87 | + deploy_count: "Deploy Count:" | ||
88 | + edit: edit | ||
89 | + environment: Environment | ||
90 | + errors: Errors | ||
91 | + errors_caught: "Errors Caught:" | ||
92 | + github_repo: GitHub Repo | ||
93 | + latest_deploys: Latest Deploys | ||
94 | + message: Message | ||
95 | + no_deploys: No deploys | ||
96 | + no_error_yet: "No errs have been caught yet, make sure you setup your app" | ||
97 | + no_watcher: "Sadly, no one is watching this app" | ||
98 | + repository: Repository | ||
99 | + repository: Repository | ||
100 | + revision: Revision | ||
101 | + search_placeholder: 'Search for issues' | ||
102 | + show_hide: "(show/hide)" | ||
103 | + unresolved_errs: unresolved errs | ||
104 | + unwatch: unwatch | ||
105 | + user_or_email: User or Email | ||
106 | + watchers: Watchers | ||
107 | + when: When | ||
108 | + who: Who |