Commit ffe2f8e6 authored by Arinde Eniola's avatar Arinde Eniola

fix the failing tests and some changes

parent 8d28f94e
...@@ -3,22 +3,19 @@ class @Subscription ...@@ -3,22 +3,19 @@ class @Subscription
$container = $(container) $container = $(container)
@url = $container.attr('data-url') @url = $container.attr('data-url')
@subscribe_button = $container.find('.subscribe-button') @subscribe_button = $container.find('.subscribe-button')
@subscribe_icon = $container.find('.subscribe-icon')
@subscription_status = $container.find('.subscription-status') @subscription_status = $container.find('.subscription-status')
@subscribe_button.unbind('click').click(@toggleSubscription) @subscribe_button.unbind('click').click(@toggleSubscription)
@subscribe_icon.unbind('click').click(@toggleSubscription)
toggleSubscription: (event) => toggleSubscription: (event) =>
btn = $(event.currentTarget) btn = $(event.currentTarget)
action = btn.find('span').text() action = btn.find('span').text()
current_status = @subscription_status.attr('data-status') current_status = @subscription_status.attr('data-status')
btn.prop('disabled', true) btn.addClass('disabled')
$.post @url, => $.post @url, =>
btn.prop('disabled', false) btn.removeClass('disabled')
status = if current_status == 'subscribed' then 'unsubscribed' else 'subscribed' status = if current_status == 'subscribed' then 'unsubscribed' else 'subscribed'
@subscription_status.attr('data-status', status) @subscription_status.attr('data-status', status)
@subscribe_icon.attr('data-original-title', status)
action = if status == 'subscribed' then 'Unsubscribe' else 'Subscribe' action = if status == 'subscribed' then 'Unsubscribe' else 'Subscribe'
btn.find('span').text(action) btn.find('span').text(action)
@subscription_status.find('>div').toggleClass('hidden') @subscription_status.find('>div').toggleClass('hidden')
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
.label-name { .label-name {
display: inline-block; display: inline-block;
width: 200px; width: 200px;
vertical-align: top; vertical-align: baseline;
@media (max-width: $screen-xs-min) { @media (max-width: $screen-xs-min) {
display: block; display: block;
...@@ -85,12 +85,13 @@ ...@@ -85,12 +85,13 @@
.prepend-left-10 { .prepend-left-10 {
display: inline-block; display: inline-block;
width: 45%; width: 40%;
vertical-align: text-top;
@media (max-width: $screen-xs-min) { @media (max-width: $screen-xs-min) {
display: block; display: block;
width: 100%; width: 100%;
margin-left: 0px; margin-left: 0;
padding: 10px 0; padding: 10px 0;
} }
} }
...@@ -104,7 +105,13 @@ ...@@ -104,7 +105,13 @@
.action-buttons { .action-buttons {
border-color: transparent; border-color: transparent;
padding: 6px padding: 6px;
color: $gl-text-color;
vertical-align: initial;
&.subscribe-button {
padding-left: 0;
}
} }
i { i {
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
.label-subscription{data: {url: toggle_subscription_namespace_project_label_path(@project.namespace, @project, label)}} .label-subscription{data: {url: toggle_subscription_namespace_project_label_path(@project.namespace, @project, label)}}
.subscription-status{data: {status: label_subscription_status(label)}} .subscription-status{data: {status: label_subscription_status(label)}}
%a.subscribe-icon.btn.action-buttons{data: {toggle: "tooltip", original_title: label_subscription_status(label)}} %a.subscribe-button.btn.action-buttons{data: {toggle: "tooltip"}}
%i.fa.fa-rss %span= label_subscription_toggle_button_text(label)
- if can? current_user, :admin_label, @project - if can? current_user, :admin_label, @project
= link_to edit_namespace_project_label_path(@project.namespace, @project, label), class: 'btn action-buttons', data: {toggle: "tooltip", original_title: "Edit"} do = link_to edit_namespace_project_label_path(@project.namespace, @project, label), title: "Edit", class: 'btn action-buttons', data: {toggle: "tooltip"} do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
= link_to namespace_project_label_path(@project.namespace, @project, label), class: 'btn action-buttons remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?", toggle: "tooltip", original_title: "Delete"} do = link_to namespace_project_label_path(@project.namespace, @project, label), title: "Delete", class: 'btn action-buttons remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?", toggle: "tooltip"} do
%i.fa.fa-trash-o %i.fa.fa-trash-o
- if current_user - if current_user
......
...@@ -15,7 +15,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps ...@@ -15,7 +15,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
step 'I delete all labels' do step 'I delete all labels' do
page.within '.labels' do page.within '.labels' do
page.all('.btn-remove').each do |remove| page.all('.remove-row').each do |remove|
remove.click remove.click
sleep 0.05 sleep 0.05
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment