Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
adcae6eb
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
adcae6eb
编写于
9月 14, 2015
作者:
P
Patricio Cano
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Notification level can now be saved from within the project view.
上级
ab56718f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
21 deletion
+32
-21
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+6
-0
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+4
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/helpers/notifications_helper.rb
app/helpers/notifications_helper.rb
+12
-8
app/models/notification.rb
app/models/notification.rb
+1
-1
app/views/projects/buttons/_notifications.html.haml
app/views/projects/buttons/_notifications.html.haml
+8
-11
未找到文件。
app/assets/javascripts/project.js.coffee
浏览文件 @
adcae6eb
...
...
@@ -24,3 +24,9 @@ class @Project
$
.
cookie
(
'hide_no_password_message'
,
'false'
,
{
path
:
path
})
$
(
@
).
parents
(
'.no-password-message'
).
remove
()
e
.
preventDefault
()
$
(
'.update-notification'
).
on
'click'
,
(
e
)
->
e
.
preventDefault
()
level
=
$
(
this
).
data
(
'notification-level'
)
$
(
'#notification_level'
).
val
(
level
)
$
(
'#notification-form'
).
submit
()
\ No newline at end of file
app/assets/stylesheets/pages/projects.scss
浏览文件 @
adcae6eb
...
...
@@ -338,3 +338,7 @@ pre.light-well {
margin-top
:
-1px
;
}
}
.inline-form
{
display
:
inline-block
;
}
app/controllers/projects_controller.rb
浏览文件 @
adcae6eb
...
...
@@ -82,7 +82,7 @@ class ProjectsController < ApplicationController
if
@project
.
empty_repo?
render
'projects/empty'
else
@membership_id
=
@project
.
project_members
.
where
(
user_id:
current_user
.
id
).
first
@membership_id
=
@project
.
project_members
.
where
(
user_id:
current_user
.
id
).
first
.
id
render
:show
end
else
...
...
app/helpers/notifications_helper.rb
浏览文件 @
adcae6eb
...
...
@@ -17,23 +17,27 @@ module NotificationsHelper
case
notification_level
when
Notification
::
N_DISABLED
content_tag
(
:li
)
do
icon
(
'microphone-slash'
)
'Disabled'
link_to
'#'
,
class:
'update-notification'
,
data:
{
notification_level:
Notification
::
N_DISABLED
}
do
icon
(
'microphone-slash'
,
text:
'Disabled'
)
end
end
when
Notification
::
N_PARTICIPATING
content_tag
(
:li
)
do
icon
(
'volume-up'
)
'Participating'
link_to
'#'
,
class:
'update-notification'
,
data:
{
notification_level:
Notification
::
N_PARTICIPATING
}
do
icon
(
'volume-up'
,
text:
'Participating'
)
end
end
when
Notification
::
N_WATCH
content_tag
(
:li
)
do
icon
(
'globe'
)
'Watch'
link_to
'#'
,
class:
'update-notification'
,
data:
{
notification_level:
Notification
::
N_WATCH
}
do
icon
(
'globe'
,
text:
'Watch'
)
end
end
when
Notification
::
N_MENTION
content_tag
(
:li
)
do
icon
(
'at'
)
'Mention'
link_to
'#'
,
class:
'update-notification'
,
data:
{
notification_level:
Notification
::
N_MENTION
}
do
icon
(
'at'
,
text:
'Mention'
)
end
end
else
# do nothing
...
...
app/models/notification.rb
浏览文件 @
adcae6eb
...
...
@@ -12,7 +12,7 @@ class Notification
class
<<
self
def
notification_levels
[
N_DISABLED
,
N_
PARTICIPATING
,
N_WATCH
,
N_MENTION
]
[
N_DISABLED
,
N_
MENTION
,
N_PARTICIPATING
,
N_WATCH
]
end
def
options_with_labels
...
...
app/views/projects/buttons/_notifications.html.haml
浏览文件 @
adcae6eb
-
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
=
form_tag
profile_notifications_path
,
method: :put
,
remote:
true
,
class:
'inline-form'
,
id:
'notification-form'
do
=
hidden_field_tag
:notification_type
,
'project'
=
hidden_field_tag
:notification_id
,
@membership_id
=
hidden_field_tag
:notification_level
%span
.dropdown
%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
)
%ul
.dropdown-menu.dropdown-menu-right.project-home-dropdown
-
Notification
.
notification_levels
.
each
do
|
level
|
=
notification_list_item
(
level
)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录