diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index be6642739..04a7ac479 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,14 @@ module ApplicationHelper + + def submit_button_tag(icon_class: 'fa-check', text: nil) + text ||= I18n.t('layout.save') + button_tag type: :submit, + data: {'disable-with' => I18n.t('layout.processing')}, + class: 'btn btn-primary' do + content_tag(:i, nil, class: ['fa', icon_class]) << ' '<< text + end + end + def layout_class case when controller_name == 'issues' && action_name == 'new' diff --git a/app/views/admin/_users/new.html.haml b/app/views/admin/_users/new.html.haml index 50651a081..d76054cb2 100644 --- a/app/views/admin/_users/new.html.haml +++ b/app/views/admin/_users/new.html.haml @@ -9,7 +9,7 @@ .rightlist= f.text_field :uname .leftlist \  - .rightlist= submit_tag t('layout.save'), data: {'disable-with' => t('layout.saving')} + .rightlist= submit_button_tag .both -else = render "users/base/form", f: f diff --git a/app/views/groups/profile/_form.html.slim b/app/views/groups/profile/_form.html.slim index 67cee0426..e23371c1b 100644 --- a/app/views/groups/profile/_form.html.slim +++ b/app/views/groups/profile/_form.html.slim @@ -3,4 +3,4 @@ = f.input :uname = f.input :description, as: :text = render 'shared/avatar_form', subject: @group, f: f -= f.button :submit, t('layout.save') \ No newline at end of file += submit_button_tag \ No newline at end of file diff --git a/app/views/platforms/key_pairs/_new.html.slim b/app/views/platforms/key_pairs/_new.html.slim index ed429c0eb..f6409ffdf 100644 --- a/app/views/platforms/key_pairs/_new.html.slim +++ b/app/views/platforms/key_pairs/_new.html.slim @@ -6,4 +6,4 @@ h3 = f.input :secret, as: :text = f.input :repository_id, collection: key_pair_repository_options(@platform) - = f.button :submit, t('layout.save') \ No newline at end of file + = submit_button_tag \ No newline at end of file diff --git a/app/views/platforms/platforms/_form.html.slim b/app/views/platforms/platforms/_form.html.slim index 8e9a4fb2e..e464851af 100644 --- a/app/views/platforms/platforms/_form.html.slim +++ b/app/views/platforms/platforms/_form.html.slim @@ -59,7 +59,7 @@ label: false .col-sm-offset-3.col-sm-9 - => f.button :submit, t('layout.save') + => submit_button_tag => t('layout.or') a.btn.btn-default href=(@platform.new_record? ? root_path : platform_path(@platform)) = t('layout.cancel') diff --git a/app/views/platforms/products/_form.html.slim b/app/views/platforms/products/_form.html.slim index bcc7f3252..323714a7f 100644 --- a/app/views/platforms/products/_form.html.slim +++ b/app/views/platforms/products/_form.html.slim @@ -35,7 +35,7 @@ = f.input :autostart_status, collection: Product::AUTOSTART_STATUSES.collect{|status| [Product.human_autostart_status(status), status]} -=> f.button :submit, t('layout.save') +=> submit_button_tag => t('layout.or') a.btn.btn-default href=( @product.new_record? ? platform_path(@platform) : platform_product_path(@platform, @product) ) = t('layout.cancel') diff --git a/app/views/platforms/repositories/_form.html.slim b/app/views/platforms/repositories/_form.html.slim index 2cc3f06ba..c46d3181e 100644 --- a/app/views/platforms/repositories/_form.html.slim +++ b/app/views/platforms/repositories/_form.html.slim @@ -7,7 +7,7 @@ - if @platform.main? = f.input :publish_builds_only_from_branch -=> f.button :submit, t('layout.save') +=> submit_button_tag => t('layout.or') a.btn.btn-default href=(@repository.new_record? ? platform_repositories_path(@platform) : platform_repository_path(@platform, @repository)) = t('layout.cancel') diff --git a/app/views/platforms/tokens/new.html.slim b/app/views/platforms/tokens/new.html.slim index 835ed53cb..f32e854c0 100644 --- a/app/views/platforms/tokens/new.html.slim +++ b/app/views/platforms/tokens/new.html.slim @@ -9,4 +9,4 @@ = simple_form_for @token, url: platform_tokens_path(@platform) do |f| = f.input :description, as: :text - = f.button :submit, t('layout.save') \ No newline at end of file + = submit_button_tag \ No newline at end of file diff --git a/app/views/projects/comments/_form.html.haml b/app/views/projects/comments/_form.html.haml index c43a72c96..dcac243bb 100644 --- a/app/views/projects/comments/_form.html.haml +++ b/app/views/projects/comments/_form.html.haml @@ -1,2 +1 @@ -=render 'projects/comments/body', f: f, id: id -/.comment-right= submit_tag t('layout.save'), data: {'disable-with' => t('layout.saving')} += render 'projects/comments/body', f: f, id: id diff --git a/app/views/projects/git/blobs/_editor.html.slim b/app/views/projects/git/blobs/_editor.html.slim index 9a883a26e..1e20e5514 100644 --- a/app/views/projects/git/blobs/_editor.html.slim +++ b/app/views/projects/git/blobs/_editor.html.slim @@ -15,9 +15,7 @@ h3= t("layout.projects.files_in_project") label[ for = :message ]= t("layout.enter_commit_message") = text_area_tag :message, "Updated #{@blob.name}", class: 'form-control' - => submit_tag t('layout.save'), title: t('layout.save'), - data: {'disable-with' => t('layout.saving')}, - class: 'btn btn-primary' + => submit_button_tag => t("layout.or") = link_to t("layout.cancel"), blob_path(@project, @treeish, @path), class: 'btn btn-default' diff --git a/app/views/projects/projects/_form.html.slim b/app/views/projects/projects/_form.html.slim index 3a48e072b..68d5980c5 100644 --- a/app/views/projects/projects/_form.html.slim +++ b/app/views/projects/projects/_form.html.slim @@ -46,7 +46,7 @@ div ng-controller = 'ProjectFromController' ng-cloak = 'true' = f.input :srpm, as: :file .col-sm-offset-3.col-sm-9 - = f.button :submit, t('layout.save'), data: {'disable-with' => t('layout.saving')} + = submit_button_tag - content_for :additional_scripts do javascript: diff --git a/app/views/projects/projects/sections.html.haml b/app/views/projects/projects/sections.html.haml index 9f24b3793..595e66c62 100644 --- a/app/views/projects/projects/sections.html.haml +++ b/app/views/projects/projects/sections.html.haml @@ -17,4 +17,4 @@ hint: t('layout.projects.has_wiki_description') .col-sm-offset-3.col-sm-9 - = f.button :submit, t('layout.save'), data: {'disable-with' => t('layout.saving')} + = submit_button_tag diff --git a/app/views/users/base/_form.html.slim b/app/views/users/base/_form.html.slim index 6f3893db4..18a10ff26 100644 --- a/app/views/users/base/_form.html.slim +++ b/app/views/users/base/_form.html.slim @@ -22,4 +22,4 @@ = f.input :professional_experience, as: :text = f.input :sound_notifications, as: :boolean -= f.button :submit, t('layout.save') += submit_button_tag \ No newline at end of file diff --git a/app/views/users/base/_submenu.html.slim b/app/views/users/base/_submenu.html.slim index 94d4fa80c..878898505 100644 --- a/app/views/users/base/_submenu.html.slim +++ b/app/views/users/base/_submenu.html.slim @@ -18,10 +18,18 @@ ul.nav.navbar-nav.left-border li class=('active' if act == :profile) - = link_to t('layout.users.profile'), profile_settings_path + a href=profile_settings_path + i.fa.fa-user> + = t('layout.users.profile') li class=('active' if act == :private) - = link_to t('layout.users.user_private_settings'), private_settings_path + a href=private_settings_path + i.fa.fa-cog> + = t('layout.users.user_private_settings') li class=('active' if act == :notifiers) - = link_to t('layout.users.settings_notifier'), notifiers_settings_path + a href=notifiers_settings_path + i.fa.fa-inbox> + = t('layout.users.settings_notifier') li class=('active' if contr == :ssh_keys) - = link_to t('ssh_keys'), ssh_keys_path + a href=ssh_keys_path + i.fa.fa-key> + = t('ssh_keys') diff --git a/app/views/users/settings/notifiers.html.slim b/app/views/users/settings/notifiers.html.slim index 41e17a95e..96d86c283 100644 --- a/app/views/users/settings/notifiers.html.slim +++ b/app/views/users/settings/notifiers.html.slim @@ -39,5 +39,5 @@ .row hr - = f.button :submit, t('layout.save') + = submit_button_tag diff --git a/app/views/users/settings/private.html.slim b/app/views/users/settings/private.html.slim index 6114a9601..03173e31d 100644 --- a/app/views/users/settings/private.html.slim +++ b/app/views/users/settings/private.html.slim @@ -12,7 +12,7 @@ = f.input :password = f.input :password_confirmation - = f.button :submit, t('layout.save') + = submit_button_tag hr = simple_form_for @user, diff --git a/app/views/users/ssh_keys/_new.html.slim b/app/views/users/ssh_keys/_new.html.slim index dbd6555c6..05a3f5624 100644 --- a/app/views/users/ssh_keys/_new.html.slim +++ b/app/views/users/ssh_keys/_new.html.slim @@ -4,4 +4,4 @@ h3 = simple_form_for @ssh_key, url: ssh_keys_path do |f| = f.input :name = f.input :key, as: :text - = f.button :submit, t('layout.save') \ No newline at end of file + = submit_button_tag \ No newline at end of file