Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
84941705
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 搜索 >>
提交
84941705
编写于
3月 22, 2015
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve contribution calendar per day info
上级
7d84252e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
30 deletion
+5
-30
app/assets/javascripts/calendar.js.coffee
app/assets/javascripts/calendar.js.coffee
+0
-3
app/assets/stylesheets/generic/calendar.scss
app/assets/stylesheets/generic/calendar.scss
+0
-21
app/views/users/calendar_activities.html.haml
app/views/users/calendar_activities.html.haml
+3
-4
lib/gitlab/contributions_calendar.rb
lib/gitlab/contributions_calendar.rb
+2
-2
未找到文件。
app/assets/javascripts/calendar.js.coffee
浏览文件 @
84941705
...
...
@@ -27,7 +27,6 @@ class @calendar
legendCellPadding
:
3
onClick
:
(
date
,
count
)
->
formated_date
=
date
.
getFullYear
()
+
"-"
+
(
date
.
getMonth
()
+
1
)
+
"-"
+
date
.
getDate
()
$
(
".calendar_commit_activity"
).
fadeOut
400
$
.
ajax
url
:
calendar_activities_path
data
:
...
...
@@ -36,6 +35,4 @@ class @calendar
dataType
:
"html"
success
:
(
data
)
->
$
(
".user-calendar-activities"
).
html
data
$
(
".calendar_commit_activity"
).
find
(
".js-toggle-content"
).
hide
()
$
(
".calendar_commit_activity"
).
fadeIn
400
app/assets/stylesheets/generic/calendar.scss
浏览文件 @
84941705
.user-calendar-activities
{
.calendar_commit_activity
{
padding
:
5px
0
0
;
}
.calendar_onclick_hr
{
padding
:
0
;
margin
:
10px
0
;
}
.calendar_commit_date
{
color
:
#999
;
}
.calendar_activity_summary
{
font-size
:
14px
;
}
.str-truncated
{
max-width
:
70%
;
...
...
@@ -31,14 +18,6 @@
background-color
:
#ddd
;
}
}
.commit-row-message
{
color
:
#333
;
&
:hover
{
color
:
#444
;
text-decoration
:
underline
;
}
}
}
/**
* This overwrites the default values of the cal-heatmap gem
...
...
app/views/users/calendar_activities.html.haml
浏览文件 @
84941705
.calendar_commit_activity
%h4
.prepend-top-20
%span
.light
Contributions for
%strong
#{
@calendar_date
.
to_s
(
:short
)
}
...
...
@@ -9,14 +8,14 @@
%span
.light
%i
.fa.fa-clock-o
=
event
.
created_at
.
to_s
(
:time
)
-
if
event
.
push?
&&
event
.
commits_count
>
0
pushed
#{
event
.
commits_count
}
commits to
-
if
event
.
push?
#{
event
.
action_name
}
#{
event
.
ref_type
}
#{
event
.
ref_name
}
-
else
=
event_action_name
(
event
)
-
if
event
.
target
%strong
=
link_to
"#
#{
event
.
target_iid
}
"
,
[
event
.
project
.
namespace
.
becomes
(
Namespace
),
event
.
project
,
event
.
target
]
at
at
%strong
-
if
event
.
project
=
link_to_project
event
.
project
...
...
lib/gitlab/contributions_calendar.rb
浏览文件 @
84941705
...
...
@@ -14,11 +14,11 @@ module Gitlab
date_from
=
1
.
year
.
ago
date_to
=
Date
.
today
events
=
Event
.
contributions
.
where
(
author_id:
user
.
id
).
events
=
Event
.
reorder
(
nil
).
contributions
.
where
(
author_id:
user
.
id
).
where
(
"created_at > ?"
,
date_from
).
where
(
project_id:
projects
).
group
(
'date(created_at)'
).
select
(
'date(created_at), count(id) as total_amount'
).
reorder
(
nil
).
map
(
&
:attributes
)
map
(
&
:attributes
)
dates
=
(
1
.
year
.
ago
.
to_date
..
(
Date
.
today
+
1
.
day
)).
to_a
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录