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
Tatuya Kamada
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
Hide 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
constructor
:
(
url
)
->
$
(
".subscribe-button"
).
click
(
event
)
=>
$
(
".subscribe-button"
).
unbind
(
"click"
).
click
(
event
)
=>
btn
=
$
(
event
.
currentTarget
)
action
=
btn
.
prop
(
"value"
)
current_status
=
$
(
".sub_status"
).
text
().
trim
()
$
(
".fa-spinner.subscription"
).
removeClass
(
"hidden"
)
$
(
".sub_status"
).
empty
()
action
=
btn
.
find
(
"span"
).
text
()
current_status
=
$
(
".subscription-status"
).
attr
(
"data-status"
)
btn
.
prop
(
"disabled"
,
true
)
$
.
post
url
,
=>
$
(
".fa-spinner.subscription"
).
addClass
(
"hidden"
)
btn
.
prop
(
"disabled"
,
false
)
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"
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 @@
.issuable-context-title
%label
Subscription:
%i
.fa.fa-spinner.fa-spin.hidden.subscription
%span
.sub_status
=
@issue
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
-
subscribe_action
=
@issue
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
%input
.btn.subscribe-button
{
:type
=>
"button"
,
:value
=>
subscribe_action
}
%button
.btn.btn-block.subscribe-button
%i
.fa.fa-eye
%span
=
@issue
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
-
subscribtion_status
=
@issue
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
.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
$ ->
...
...
app/views/projects/merge_requests/show/_context.html.haml
View file @
22fcb2f4
...
...
@@ -33,11 +33,15 @@
.issuable-context-title
%label
Subscription:
%i
.fa.fa-spinner.fa-spin.hidden.subscription
%span
.sub_status
=
@merge_request
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
-
subscribe_action
=
@merge_request
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
%input
.btn.subscribe-button
{
:type
=>
"button"
,
:value
=>
subscribe_action
}
%button
.btn.btn-block.subscribe-button
%i
.fa.fa-eye
%span
=
@merge_request
.
subscribed?
(
current_user
)
?
"Unsubscribe"
:
"Subscribe"
-
subscribtion_status
=
@merge_request
.
subscribed?
(
current_user
)
?
"subscribed"
:
"unsubscribed"
.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
$ ->
...
...
features/steps/project/issues/issues.rb
View file @
22fcb2f4
...
...
@@ -19,12 +19,12 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
step
'I should see that I am subscribed'
do
find
(
".sub
_status"
).
text
.
should
==
"subscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Unsubscribe
"
end
step
'I should see that I am unsubscribed'
do
sleep
0.2
find
(
".sub
_status"
).
text
.
should
==
"unsubscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Subscribe
"
end
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
end
step
'I should see that I am subscribed'
do
find
(
".sub
_status"
).
text
.
should
==
"subscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Unsubscribe
"
end
step
'I should see that I am unsubscribed'
do
sleep
0.2
find
(
".sub
_status"
).
text
.
should
==
"unsubscribed
"
find
(
".sub
scribe-button span"
).
text
.
should
==
"Subscribe
"
end
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