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
84508c40
Commit
84508c40
authored
Sep 14, 2015
by
Darby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PAtrially working notification button
parent
a81ce718
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
0 deletions
+49
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-0
app/helpers/notifications_helper.rb
app/helpers/notifications_helper.rb
+31
-0
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+2
-0
app/views/projects/buttons/_notifications.html.haml
app/views/projects/buttons/_notifications.html.haml
+15
-0
No files found.
app/controllers/projects_controller.rb
View file @
84508c40
...
@@ -82,6 +82,7 @@ class ProjectsController < ApplicationController
...
@@ -82,6 +82,7 @@ class ProjectsController < ApplicationController
if
@project
.
empty_repo?
if
@project
.
empty_repo?
render
'projects/empty'
render
'projects/empty'
else
else
@membership_id
=
@project
.
project_members
.
where
(
user_id:
current_user
.
id
).
first
render
:show
render
:show
end
end
else
else
...
...
app/helpers/notifications_helper.rb
View file @
84508c40
...
@@ -12,4 +12,35 @@ module NotificationsHelper
...
@@ -12,4 +12,35 @@ module NotificationsHelper
icon
(
'circle-o'
,
class:
'ns-default'
)
icon
(
'circle-o'
,
class:
'ns-default'
)
end
end
end
end
def
notification_list_item
(
notification_level
)
case
notification_level
when
Notification
::
N_DISABLED
content_tag
(
:li
)
do
icon
(
'microphone-slash'
)
do
'Disabled'
end
end
when
Notification
::
N_PARTICIPATING
content_tag
(
:li
)
do
icon
(
'volume-up'
)
do
'Participating'
end
end
when
Notification
::
N_WATCH
content_tag
(
:li
)
do
icon
(
'globe'
)
do
'Watch'
end
end
when
Notification
::
N_MENTION
content_tag
(
:li
)
do
icon
(
'at'
)
do
'Mention'
end
end
else
# do nothing
end
end
end
end
app/views/projects/_home_panel.html.haml
View file @
84508c40
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
=
icon
(
'download fw'
)
=
icon
(
'download fw'
)
Download
Download
=
render
'projects/buttons/notifications'
=
render
'projects/buttons/dropdown'
=
render
'projects/buttons/dropdown'
=
render
"shared/clone_panel"
=
render
"shared/clone_panel"
app/views/projects/buttons/_notifications.html.haml
0 → 100644
View file @
84508c40
-
if
current_user
and
!
@membership_id
.
nil?
%span
.dropdown
=
form_tag
profile_notifications_path
,
method: :put
,
remote:
true
do
=
hidden_field_tag
:notification_type
,
'project'
=
hidden_field_tag
:notification_id
,
@membership_id
%a
.dropdown-toggle.btn.btn-new
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
=
icon
(
'bell'
)
Notifications
%ul
.dropdown-menu.dropdown-menu-right.project-home-dropdown
-
Notification
.
notification_levels
.
each
do
|
level
|
=
notification_list_item
(
level
)
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