summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-27 16:32:50 +0200
committerAzul <azul@leap.se>2014-05-27 16:32:50 +0200
commitcc59ce53e52bf48d97de16d66012e8309bf98fe8 (patch)
tree8b32b2a2f791723fe93b5d73fcc104d6a9729355 /app
parent863863ff1fb6c9ab13b44248417ae1c5e57987af (diff)
add btn helper for link_to with .btn
Also translates the first arg if it's a symbol and adds more btn- classes if given as html_options[:type]
Diffstat (limited to 'app')
-rw-r--r--app/views/common/_action_buttons.html.haml6
-rw-r--r--app/views/common/_download_button.html.haml2
-rw-r--r--app/views/pages/pricing.html.haml2
-rw-r--r--app/views/users/_destroy_account.html.haml6
-rw-r--r--app/views/users/show.html.haml2
5 files changed, 9 insertions, 9 deletions
diff --git a/app/views/common/_action_buttons.html.haml b/app/views/common/_action_buttons.html.haml
index 398d384..266abe1 100644
--- a/app/views/common/_action_buttons.html.haml
+++ b/app/views/common/_action_buttons.html.haml
@@ -1,11 +1,11 @@
.home-buttons
.row-fluid.second
.login.span4
- %span.link= link_to icon('ok-sign') + t(:login), login_path, :class => 'btn'
+ %span.link= btn icon('ok-sign') + t(:login), login_path
%span.info= t(:login_info, default: "")
.signup.span4
- %span.link= link_to icon('user') + t(:signup), signup_path, :class => 'btn'
+ %span.link= btn icon('user') + t(:signup), signup_path
%span.info= t(:signup_info, default: "")
.help.span4
- %span.link= link_to icon('question-sign') + t(:get_help), new_ticket_path, :class => 'btn'
+ %span.link= btn icon('question-sign') + t(:get_help), new_ticket_path
%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 d6d7bde..9c26860 100644
--- a/app/views/common/_download_button.html.haml
+++ b/app/views/common/_download_button.html.haml
@@ -2,7 +2,7 @@
.row-fluid.first
.span2
.download.span8
- = link_to client_download_url, class: "btn btn-large btn-primary" do
+ = btn client_download_url, type: [:large, :primary] do
= big_icon('download')
= t(:download_bitmask)
.span2
diff --git a/app/views/pages/pricing.html.haml b/app/views/pages/pricing.html.haml
index e339d27..983501e 100644
--- a/app/views/pages/pricing.html.haml
+++ b/app/views/pages/pricing.html.haml
@@ -1,5 +1,5 @@
%h1= t(:pricing)
-%p= link_to(icon('user') + t(:signup), signup_path, :class => 'btn')
+%p= btn icon('user') + t(:signup), signup_path
- levels = APP_CONFIG[:service_levels]
- if levels
diff --git a/app/views/users/_destroy_account.html.haml b/app/views/users/_destroy_account.html.haml
index 445f3c4..be003ce 100644
--- a/app/views/users/_destroy_account.html.haml
+++ b/app/views/users/_destroy_account.html.haml
@@ -8,20 +8,20 @@
- else
= t(:admin_destroy_account, :username => @user.login)
%p= t(:destroy_account_info)
-= link_to user_path(@user), :method => :delete, :confirm => t(:are_you_sure), :class => "btn btn-danger" do
+= btn user_path(@user), :method => :delete, :confirm => t(:are_you_sure), :type => "danger" do
%i.icon-remove.icon-white
= t(:destroy_my_account)
- if @user != current_user and @user.enabled?
%legend
= t(:deactivate_account, :username => @user.login)
%p= t(:deactivate_description)
- = link_to deactivate_user_path(@user), :method => :post, :class => "btn btn-warning" do
+ = btn deactivate_user_path(@user), :method => :post, :type => "warning" do
%i.icon-pause.icon-white
= t(:deactivate)
- elsif @user != current_user and !@user.enabled?
%legend
= t(:enable_account, :username => @user.login)
%p= t(:enable_description)
- = link_to enable_user_path(@user), :method => :post, :class => "btn btn-warning" do
+ = btn enable_user_path(@user), :method => :post, :type => "warning" do
%i.icon-ok.icon-white
= t(:enable)
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 6760099..da8e467 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -2,6 +2,6 @@
.container-fluid
.row-fluid
%h4 To use bitmask services:
- = link_to client_download_url, class: "btn btn-primary" do
+ = btn client_download_url, type: "primary" do
%i.icon-arrow-down.icon-white
= t(:download_bitmask)