summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorHannes Rosenögger <123haynes@gmail.com>2015-01-28 22:18:22 +0100
committerHannes Rosenögger <123haynes@gmail.com>2015-01-29 01:25:26 +0100
commit792ced2f4190226c3335967a8e5a30d3b72bd4ae (patch)
tree0411a2c41710a7f0d2c06fa141b8875c77873968 /app/views
parent8eb365c0a04b912d2e10eb16adeeb4216563be2c (diff)
downloadgitlab-ce-792ced2f4190226c3335967a8e5a30d3b72bd4ae.tar.gz
Add a commit calendar to the user profile
Diffstat (limited to 'app/views')
-rw-r--r--app/views/events/_event.html.haml3
-rw-r--r--app/views/users/_calendar.html.haml9
-rw-r--r--app/views/users/_calendar_onclick.html.haml25
-rw-r--r--app/views/users/show.html.haml2
4 files changed, 37 insertions, 2 deletions
diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml
index 61383315373..c7976ba564f 100644
--- a/app/views/events/_event.html.haml
+++ b/app/views/events/_event.html.haml
@@ -11,5 +11,4 @@
- elsif event.note?
= render "events/event/note", event: event
- else
- = render "events/event/common", event: event
-
+ = render "events/event/common", event: event \ No newline at end of file
diff --git a/app/views/users/_calendar.html.haml b/app/views/users/_calendar.html.haml
new file mode 100644
index 00000000000..70d5cca854d
--- /dev/null
+++ b/app/views/users/_calendar.html.haml
@@ -0,0 +1,9 @@
+#cal-heatmap.calendar
+ :javascript
+ new calendar(
+ #{@timestamps.to_json},
+ #{@starting_year},
+ #{@starting_month},
+ '#{user_activities_path}'
+ );
+= render "calendar_onclick"
diff --git a/app/views/users/_calendar_onclick.html.haml b/app/views/users/_calendar_onclick.html.haml
new file mode 100644
index 00000000000..1514b56bb23
--- /dev/null
+++ b/app/views/users/_calendar_onclick.html.haml
@@ -0,0 +1,25 @@
+#calendar_commit_activity.calendar_commit_activity
+ %h4.activity_title Commit Activity:
+
+ #loading_commits
+ %section.text-center
+ %h3
+ %i.icon-spinner.icon-spin
+
+ #calendar_onclick_placeholder.calendar_onclick_placeholder
+ %span.calendar_onclick_second.calendar_onclick_second
+ - if @timestamps.empty?
+ %span.calendar_activity_summary
+ %strong> #{@user.username}
+ &nbsp; has no activity
+ - else
+ %span.calendar_activity_summary
+ %strong> #{@user.username}
+ 's last commit was on
+ %span.commit_date #{@last_commit_date}
+
+ %hr.calendar_onclick_hr
+
+:javascript
+ $("#loading_commits").hide();
+
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 54f2666ce5d..0d214d31607 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -18,6 +18,8 @@
%h4 Groups:
= render 'groups', groups: @groups
%hr
+ %h4 Calendar:
+ = render 'calendar'
%h4
User Activity: