diff options
author | Andriy Dyadyura <adyadyura@Andriys-MBP.lan> | 2016-01-14 15:54:15 +0100 |
---|---|---|
committer | Andriy Dyadyura <adyadyura@Andriys-MBP.lan> | 2016-01-14 15:54:15 +0100 |
commit | 3102575316e6eac937eb865346e0d78935c37362 (patch) | |
tree | 5434a52528390e18ac68ff705f19f8441a952f57 /app/helpers | |
parent | e29ce9ac267e6724945b9558d069dda2b2ec2755 (diff) | |
parent | b6ae2def2cb2b1da3ddcb3ceee556628a1147cc4 (diff) | |
download | gitlab-ce-pr-page-fix1.tar.gz |
updatepr-page-fix1
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/button_helper.rb | 58 | ||||
-rw-r--r-- | app/helpers/events_helper.rb | 8 |
2 files changed, 5 insertions, 61 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb deleted file mode 100644 index 80c7090d91e..00000000000 --- a/app/helpers/button_helper.rb +++ /dev/null @@ -1,58 +0,0 @@ -module ButtonHelper - # Output a "Copy to Clipboard" button - # - # data - Data attributes passed to `content_tag` - # - # Examples: - # - # # Define the clipboard's text - # clipboard_button(clipboard_text: "Foo") - # # => "<button class='...' data-clipboard-text='Foo'>...</button>" - # - # # Define the target element - # clipboard_button(clipboard_target: "div#foo") - # # => "<button class='...' data-clipboard-target='div#foo'>...</button>" - # - # See http://clipboardjs.com/#usage - def clipboard_button(data = {}) - content_tag :button, - icon('clipboard'), - class: 'btn btn-xs btn-nr btn-clipboard', - data: data, - type: :button - end - - def http_clone_button(project) - klass = 'btn js-protocol-switch' - klass << ' active' if default_clone_protocol == 'http' - klass << ' has_tooltip' if current_user.try(:require_password?) - - protocol = gitlab_config.protocol.upcase - - content_tag :button, protocol, - class: klass, - data: { - clone: project.http_url_to_repo, - container: 'body', - html: 'true', - title: "Set a password on your account<br>to pull or push via #{protocol}" - }, - type: :button - end - - def ssh_clone_button(project) - klass = 'btn js-protocol-switch' - klass << ' active' if default_clone_protocol == 'ssh' - klass << ' has_tooltip' if current_user.try(:require_ssh_key?) - - content_tag :button, 'SSH', - class: klass, - data: { - clone: project.ssh_url_to_repo, - container: 'body', - html: 'true', - title: 'Add an SSH key to your profile<br>to pull or push via SSH.' - }, - type: :button - end -end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index dde83ff36b5..31bf45baeb7 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -27,13 +27,15 @@ module EventsHelper key = key.to_s active = 'active' if @event_filter.active?(key) link_opts = { - class: "event-filter-link btn btn-default #{active}", + class: "event-filter-link", id: "#{key}_event_filter", title: "Filter by #{tooltip.downcase}", } - link_to request.path, link_opts do - content_tag(:span, ' ' + tooltip) + content_tag :li, class: active do + link_to request.path, link_opts do + content_tag(:span, ' ' + tooltip) + end end end |