Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
22fcb2f4
Commit
22fcb2f4
authored
Mar 17, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve UI
parent
1b437ec3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
22 deletions
+30
-22
app/assets/javascripts/subscription.js.coffee
app/assets/javascripts/subscription.js.coffee
+8
-8
app/views/projects/issues/_issue_context.html.haml
app/views/projects/issues/_issue_context.html.haml
+9
-5
app/views/projects/merge_requests/show/_context.html.haml
app/views/projects/merge_requests/show/_context.html.haml
+9
-5
features/steps/project/issues/issues.rb
features/steps/project/issues/issues.rb
+2
-2
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+2
-2
No files found.
app/assets/javascripts/subscription.js.coffee
View file @
22fcb2f4
class
@
Subscription
class
@
Subscription
constructor
:
(
url
)
->
constructor
:
(
url
)
->
$
(
".subscribe-button"
).
click
(
event
)
=>
$
(
".subscribe-button"
).
unbind
(
"click"
).
click
(
event
)
=>
btn
=
$
(
event
.
currentTarget
)
btn
=
$
(
event
.
currentTarget
)
action
=
btn
.
prop
(
"value"
)
action
=
btn
.
find
(
"span"
).
text
()
current_status
=
$
(
".sub_status"
).
text
().
trim
()
current_status
=
$
(
".subscription-status"
).
attr
(
"data-status"
)
$
(
".fa-spinner.subscription"
).
removeClass
(
"hidden"
)
btn
.
prop
(
"disabled"
,
true
)
$
(
".sub_status"
).
empty
()
$
.
post
url
,
=>
$
.
post
url
,
=>
$
(
".fa-spinner.subscription"
).
addClass
(
"hidden"
)
btn
.
prop
(
"disabled"
,
false
)
status
=
if
current_status
==
"subscribed"
then
"unsubscribed"
else
"subscribed"
status
=
if
current_status
==
"subscribed"
then
"unsubscribed"
else
"subscribed"
$
(
".sub
_status"
).
text
(
status
)
$
(
".sub
scription-status"
).
attr
(
"data-status"
,
status
)
action
=
if
status
==
"subscribed"
then
"Unsubscribe"
else
"Subscribe"
action
=
if
status
==
"subscribed"
then
"Unsubscribe"
else
"Subscribe"
btn
.
prop
(
"value"
,
action
)
btn
.
find
(
"span"
).
text
(
action
)
$
(
".subscription-status>div"
).
toggleClass
(
"hidden"
)
app/views/projects/issues/_issue_context.html.haml
View file @
22fcb2f4
...
@@ -31,11 +31,15 @@
...
@@ -31,11 +31,15 @@
.issuable-context-title
.issuable-context-title
%label
%label
Subscription:
Subscription:
%i
.fa.fa-spinner.fa-spin.hidden.subscription
%button
.btn.btn-block.subscribe-button
%span
.sub_status
%i
.fa.fa-eye
=
@issue
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
%span
=
@issue
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
-
subscribe_action
=
@issue
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
-
subscribtion_status
=
@issue
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
%input
.btn.subscribe-button
{
:type
=>
"button"
,
:value
=>
subscribe_action
}
.subscription-status
{
"data-status"
=>
subscribtion_status
}
.description-block.unsubscribed
{
class:
(
"hidden"
if
@issue
.
subscribed?
(
current_user
)
)}
You're not receiving notifications from this thread.
.description-block.subscribed
{
class:
(
"hidden"
unless
@issue
.
subscribed?
(
current_user
)
)}
You're receiving notifications because you're subscribed to this thread.
:coffeescript
:coffeescript
$ ->
$ ->
...
...
app/views/projects/merge_requests/show/_context.html.haml
View file @
22fcb2f4
...
@@ -33,11 +33,15 @@
...
@@ -33,11 +33,15 @@
.issuable-context-title
.issuable-context-title
%label
%label
Subscription:
Subscription:
%i
.fa.fa-spinner.fa-spin.hidden.subscription
%button
.btn.btn-block.subscribe-button
%span
.sub_status
%i
.fa.fa-eye
=
@merge_request
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
%span
=
@merge_request
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
-
subscribe_action
=
@merge_request
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
-
subscribtion_status
=
@merge_request
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
%input
.btn.subscribe-button
{
:type
=>
"button"
,
:value
=>
subscribe_action
}
.subscription-status
{
"data-status"
=>
subscribtion_status
}
.description-block.unsubscribed
{
class:
(
"hidden"
if
@merge_request
.
subscribed?
(
current_user
)
)}
You're not receiving notifications from this thread.
.description-block.subscribed
{
class:
(
"hidden"
unless
@merge_request
.
subscribed?
(
current_user
)
)}
You're receiving notifications because you're subscribed to this thread.
:coffeescript
:coffeescript
$ ->
$ ->
...
...
features/steps/project/issues/issues.rb
View file @
22fcb2f4
...
@@ -19,12 +19,12 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -19,12 +19,12 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I should see that I am subscribed'
do
step
'I should see that I am subscribed'
do
find
(
".sub
_status"
).
text
.
should
==
"subscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Unsubscribe
"
end
end
step
'I should see that I am unsubscribed'
do
step
'I should see that I am unsubscribed'
do
sleep
0.2
sleep
0.2
find
(
".sub
_status"
).
text
.
should
==
"unsubscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Subscribe
"
end
end
step
'I click link "Closed"'
do
step
'I click link "Closed"'
do
...
...
features/steps/project/merge_requests.rb
View file @
22fcb2f4
...
@@ -57,12 +57,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -57,12 +57,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see that I am subscribed'
do
step
'I should see that I am subscribed'
do
find
(
".sub
_status"
).
text
.
should
==
"subscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Unsubscribe
"
end
end
step
'I should see that I am unsubscribed'
do
step
'I should see that I am unsubscribed'
do
sleep
0.2
sleep
0.2
find
(
".sub
_status"
).
text
.
should
==
"unsubscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Subscribe
"
end
end
step
'I click button "Unsubscribe"'
do
step
'I click button "Unsubscribe"'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment