summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-24 10:33:31 +0200
committerAzul <azul@leap.se>2014-05-26 13:01:34 +0200
commit4085e3fabef6427cd3f8be9b61c209bd82eaa595 (patch)
treef5ca512efd7d81c29a43dd846b60ad29074dae63 /app
parent19bce0f114180f355f0df367cf6d21bd957734a6 (diff)
navigation works with empty locale selected
Just in case some translation keys are not present things should still work and make sense. So translation keys should be picked in a meaningful way and scoped rather than prefixed. For example overview.account will turn into "Account" if no translation is present while "overview_account" will turn into "Overview Account". We usually want the former.
Diffstat (limited to 'app')
-rw-r--r--app/views/common/_action_buttons.html.haml8
-rw-r--r--app/views/common/_download_button.html.haml2
-rw-r--r--app/views/users/_overview.html.haml24
-rw-r--r--app/views/users/new.html.haml2
-rw-r--r--app/views/users/show.html.haml37
5 files changed, 37 insertions, 36 deletions
diff --git a/app/views/common/_action_buttons.html.haml b/app/views/common/_action_buttons.html.haml
index c74fcd1..d00cf74 100644
--- a/app/views/common/_action_buttons.html.haml
+++ b/app/views/common/_action_buttons.html.haml
@@ -2,10 +2,10 @@
.row-fluid.second
.login.span4
%span.link= link_to(icon('ok-sign', icon_color) + t(:login), login_path, :class => 'btn')
- %span.info= t(:login_info)
+ %span.info= t(:login_info, default: "")
.signup.span4
%span.link= link_to(icon('user', icon_color) + t(:signup), signup_path, :class => 'btn')
- %span.info= t(:signup_info)
+ %span.info= t(:signup_info, default: "")
.help.span4
- %span.link= link_to(icon('question-sign', icon_color) + t(:get_help), new_ticket_path, :class => 'btn')
- %span.info= t(:help_info)
+ %span.link= link_to(icon('question-sign', icon_color) + t(:support_tickets), new_ticket_path, :class => 'btn')
+ %span.info= t(:support_info, default: "")
diff --git a/app/views/common/_download_button.html.haml b/app/views/common/_download_button.html.haml
index e57c56b..d6d7bde 100644
--- a/app/views/common/_download_button.html.haml
+++ b/app/views/common/_download_button.html.haml
@@ -4,5 +4,5 @@
.download.span8
= link_to client_download_url, class: "btn btn-large btn-primary" do
= big_icon('download')
- = t(:download_client)
+ = t(:download_bitmask)
.span2
diff --git a/app/views/users/_overview.html.haml b/app/views/users/_overview.html.haml
new file mode 100644
index 0000000..e38fdc8
--- /dev/null
+++ b/app/views/users/_overview.html.haml
@@ -0,0 +1,24 @@
+.overview
+
+ %h2.first= t(".welcome", username: @user.login, cascade: true)
+
+ - if admin?
+ %p
+ = t(:created)
+ = @user.created_at
+ %br
+ = t(:updated)
+ = @user.updated_at
+ %br
+ = t(:enabled)
+ = @user.enabled?
+
+ %p= t(:overview_intro, default: "")
+
+ %ul.unstyled
+ %li= icon('user') + link_to(t(".account"), edit_user_path(@user))
+ - # %li= icon('envelope') + link_to(t(:overview_email), {insert path for user identities, presuambly}
+ %li= icon('question-sign') + link_to(t(".tickets"), user_tickets_path(@user))
+ %li= icon('shopping-cart') + link_to(t(".billing"), billing_top_link(@user)) if APP_CONFIG[:billing]
+
+
diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml
index bc36068..41a9d55 100644
--- a/app/views/users/new.html.haml
+++ b/app/views/users/new.html.haml
@@ -17,5 +17,5 @@
= f.input :login, :label => t(:username), :required => false, :input_html => { :id => :srp_username }
= f.input :password, :required => false, :validate => true, :input_html => { :id => :srp_password }
= f.input :password_confirmation, :required => false, :validate => true, :input_html => { :id => :srp_password_confirmation }
- = f.button :wrapped, value: t(:signup), cancel: home_path
+ = f.button :wrapped, cancel: home_path
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index ddc33ab..6760099 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -1,30 +1,7 @@
-.overview
-
- %h2.first= t(:overview_welcome, :username => @user.login)
-
- - if admin?
- %p
- = t(:created)
- = @user.created_at
- %br
- = t(:updated)
- = @user.updated_at
- %br
- = t(:enabled)
- = @user.enabled?
-
- %p= t(:overview_intro)
-
- %ul.unstyled
- %li= icon('user') + link_to(t(:overview_account), edit_user_path(@user))
- - # %li= icon('envelope') + link_to(t(:overview_email), {insert path for user identities, presuambly}
- %li= icon('question-sign') + link_to(t(:overview_tickets), user_tickets_path(@user))
- %li= icon('shopping-cart') + link_to(t(:overview_billing), billing_top_link(@user)) if APP_CONFIG[:billing]
-
-
- .container-fluid
- .row-fluid
- %h4 To use bitmask services:
- = link_to client_download_url, class: "btn btn-primary" do
- %i.icon-arrow-down.icon-white
- = t(:download_client)
+= render 'overview'
+.container-fluid
+ .row-fluid
+ %h4 To use bitmask services:
+ = link_to client_download_url, class: "btn btn-primary" do
+ %i.icon-arrow-down.icon-white
+ = t(:download_bitmask)