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
Jérome Perrin
gitlab-ce
Commits
84941705
Commit
84941705
authored
Mar 22, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve contribution calendar per day info
parent
7d84252e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
30 deletions
+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
No files found.
app/assets/javascripts/calendar.js.coffee
View file @
84941705
...
@@ -27,7 +27,6 @@ class @calendar
...
@@ -27,7 +27,6 @@ class @calendar
legendCellPadding
:
3
legendCellPadding
:
3
onClick
:
(
date
,
count
)
->
onClick
:
(
date
,
count
)
->
formated_date
=
date
.
getFullYear
()
+
"-"
+
(
date
.
getMonth
()
+
1
)
+
"-"
+
date
.
getDate
()
formated_date
=
date
.
getFullYear
()
+
"-"
+
(
date
.
getMonth
()
+
1
)
+
"-"
+
date
.
getDate
()
$
(
".calendar_commit_activity"
).
fadeOut
400
$
.
ajax
$
.
ajax
url
:
calendar_activities_path
url
:
calendar_activities_path
data
:
data
:
...
@@ -36,6 +35,4 @@ class @calendar
...
@@ -36,6 +35,4 @@ class @calendar
dataType
:
"html"
dataType
:
"html"
success
:
(
data
)
->
success
:
(
data
)
->
$
(
".user-calendar-activities"
).
html
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
View file @
84941705
.user-calendar-activities
{
.user-calendar-activities
{
.calendar_commit_activity
{
padding
:
5px
0
0
;
}
.calendar_onclick_hr
{
.calendar_onclick_hr
{
padding
:
0
;
padding
:
0
;
margin
:
10px
0
;
margin
:
10px
0
;
}
}
.calendar_commit_date
{
color
:
#999
;
}
.calendar_activity_summary
{
font-size
:
14px
;
}
.str-truncated
{
.str-truncated
{
max-width
:
70%
;
max-width
:
70%
;
}
}
...
@@ -31,14 +18,6 @@
...
@@ -31,14 +18,6 @@
background-color
:
#ddd
;
background-color
:
#ddd
;
}
}
}
}
.commit-row-message
{
color
:
#333
;
&
:hover
{
color
:
#444
;
text-decoration
:
underline
;
}
}
}
}
/**
/**
* This overwrites the default values of the cal-heatmap gem
* This overwrites the default values of the cal-heatmap gem
...
...
app/views/users/calendar_activities.html.haml
View file @
84941705
.calendar_commit_activity
%h4
.prepend-top-20
%h4
.prepend-top-20
%span
.light
Contributions for
%span
.light
Contributions for
%strong
#{
@calendar_date
.
to_s
(
:short
)
}
%strong
#{
@calendar_date
.
to_s
(
:short
)
}
...
@@ -9,14 +8,14 @@
...
@@ -9,14 +8,14 @@
%span
.light
%span
.light
%i
.fa.fa-clock-o
%i
.fa.fa-clock-o
=
event
.
created_at
.
to_s
(
:time
)
=
event
.
created_at
.
to_s
(
:time
)
-
if
event
.
push?
&&
event
.
commits_count
>
0
-
if
event
.
push?
pushed
#{
event
.
commits_count
}
commits to
#{
event
.
action_name
}
#{
event
.
ref_type
}
#{
event
.
ref_name
}
-
else
-
else
=
event_action_name
(
event
)
=
event_action_name
(
event
)
-
if
event
.
target
-
if
event
.
target
%strong
=
link_to
"#
#{
event
.
target_iid
}
"
,
[
event
.
project
.
namespace
.
becomes
(
Namespace
),
event
.
project
,
event
.
target
]
%strong
=
link_to
"#
#{
event
.
target_iid
}
"
,
[
event
.
project
.
namespace
.
becomes
(
Namespace
),
event
.
project
,
event
.
target
]
at
at
%strong
%strong
-
if
event
.
project
-
if
event
.
project
=
link_to_project
event
.
project
=
link_to_project
event
.
project
...
...
lib/gitlab/contributions_calendar.rb
View file @
84941705
...
@@ -14,11 +14,11 @@ module Gitlab
...
@@ -14,11 +14,11 @@ module Gitlab
date_from
=
1
.
year
.
ago
date_from
=
1
.
year
.
ago
date_to
=
Date
.
today
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
).
where
(
"created_at > ?"
,
date_from
).
where
(
project_id:
projects
).
group
(
'date(created_at)'
).
group
(
'date(created_at)'
).
select
(
'date(created_at), count(id) as total_amount'
).
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
dates
=
(
1
.
year
.
ago
.
to_date
..
(
Date
.
today
+
1
.
day
)).
to_a
...
...
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