|
Ryan Lerch |
6d2e06 |
{% macro searchbox(select) %}
|
|
Ryan Lerch |
6d2e06 |
<form action="{{url_for('ui_ns.search')}}" id="headerSearch"></form>
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
<select name="type" style="display:none;"></select>
|
|
Ryan Lerch |
6d2e06 |
<option %}="" endif="" if="" select="='projects'" selected="" value="projects" {%="">Projects</option>
|
|
Ryan Lerch |
6d2e06 |
<option %}="" endif="" if="" select="='projects_forks'" selected="" value="projects_forks" {%="">Projects & Forks</option>
|
|
Ryan Lerch |
6d2e06 |
<option %}="" endif="" if="" select="='users'" selected="" value="user" {%="">Users</option>
|
|
Ryan Lerch |
6d2e06 |
<option %}="" endif="" if="" select="='groups'" selected="" value="groups" {%="">Groups</option>
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{% if select == 'projects' %}
|
|
Ryan Lerch |
6d2e06 |
<input name="direct" readonly="" type="hidden" value="1">
|
|
Ryan Lerch |
6d2e06 |
{% endif %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
if select=='projects' %}Search projects{%
|
|
Ryan Lerch |
6d2e06 |
elif select=='users' %} Search Users {%
|
|
Ryan Lerch |
6d2e06 |
elif select=='groups'%} Search Groups{%
|
|
Ryan Lerch |
6d2e06 |
endif %}" class="form-control" title="Search" />
|
|
Ryan Lerch |
6d2e06 |
<input class="btn btn-primary" style="display:none;" type="submit" value="Search">
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{% endmacro%}
|
|
Ryan Lerch |
6d2e06 |
|
|
Johan Cwiklinski |
63918a |
{% macro render_row(items) -%}
|
|
Johan Cwiklinski |
63918a |
{% for repo in items %}
|
|
Pierre-Yves Chibon |
b130e5 |
{% set url = url_for('ui_ns.view_repo',
|
|
Pierre-Yves Chibon |
ff8880 |
username=repo.user.username if repo.is_fork else None,
|
|
Pierre-Yves Chibon |
ff8880 |
repo=repo.name, namespace=repo.namespace) %}
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
3239dc |
{% if repo.avatar_email %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
3239dc |
{% else %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
3239dc |
{% endif %}
|
|
Pierre-Yves Chibon |
3239dc |
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
ff8880 |
{{ repo.namespace + '/' if repo.namespace }}{{ repo.name }}
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
3239dc |
|
|
Pierre-Yves Chibon |
3239dc |
|
|
Pierre-Yves Chibon |
ff8880 |
<small></small>
|
|
Pierre-Yves Chibon |
ff8880 |
{% if repo.description %}{{ repo.description }}{% else %}
|
|
Pierre-Yves Chibon |
ff8880 |
no description{% endif %}
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
eef090 |
|
|
Pierre-Yves Chibon |
ff8880 |
<small>created {{repo.date_created|humanize}}</small>
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Ryan Lerch |
eef090 |
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
ff8880 |
{{repo.forks|count}}
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
86242e |
|
|
Ryan Lerch |
e914ef |
|
|
Johan Cwiklinski |
63918a |
{% else %}
|
|
Ryan Lerch |
e914ef |
No projects found
|
|
Johan Cwiklinski |
63918a |
{% endfor %}
|
|
Johan Cwiklinski |
63918a |
{%- endmacro %}
|
|
Johan Cwiklinski |
63918a |
|
|
Johan Cwiklinski |
63918a |
|
|
Pierre-Yves Chibon |
a5aa6b |
{% macro pagination_link(pagetitle, page, total) -%}
|
|
Pierre-Yves Chibon |
a5aa6b |
{% set prev_page = request.url | combine_url(
|
|
Pierre-Yves Chibon |
a5aa6b |
page=page-1, pagetitle=pagetitle, **kwargs) %}
|
|
Pierre-Yves Chibon |
a5aa6b |
{% set next_page = request.url | combine_url(
|
|
Pierre-Yves Chibon |
a5aa6b |
page=page+1, pagetitle=pagetitle, **kwargs) %}
|
|
Pierre-Yves Chibon |
2cb1c6 |
<aside></aside>
|
|
Pierre-Yves Chibon |
e4ddf2 |
<nav class="text-center"></nav>
|
|
Pierre-Yves Chibon |
e4ddf2 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
e4ddf2 |
«
|
|
Pierre-Yves Chibon |
e4ddf2 |
Newer
|
|
Pierre-Yves Chibon |
e4ddf2 |
|
|
Pierre-Yves Chibon |
e4ddf2 |
|
|
Ryan Lerch |
6d2e06 |
page {{ page }} of {{ total }}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
e4ddf2 |
»
|
|
Pierre-Yves Chibon |
e4ddf2 |
Older
|
|
Pierre-Yves Chibon |
e4ddf2 |
|
|
Pierre-Yves Chibon |
e4ddf2 |
|
|
Pierre-Yves Chibon |
e4ddf2 |
|
|
Pierre-Yves Chibon |
e4ddf2 |
|
|
Pierre-Yves Chibon |
2cb1c6 |
|
|
Pierre-Yves Chibon |
2cb1c6 |
{%- endmacro %}
|
|
Pierre-Yves Chibon |
2cb1c6 |
|
|
Pierre-Yves Chibon |
2cb1c6 |
|
|
Pierre-Yves Chibon |
320864 |
{% macro render_repos(
|
|
Pierre-Yves Chibon |
a6029d |
list, total, pagetitle, page, title, count, id,
|
|
Ryan Lerch |
6d2e06 |
username=None, hide=True, sorting=None, select='projects') %}
|
|
Pierre-Yves Chibon |
a6029d |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{{
|
|
Pierre-Yves Chibon |
a57a5c |
title
|
|
Ryan Lerch |
eef090 |
}} {{ count }}
|
|
Pierre-Yves Chibon |
a57a5c |
{%- if username -%}
|
|
Pierre-Yves Chibon |
b130e5 |
|
|
Ryan Lerch |
eef090 |
<button class="btn btn-success float-right" type="button"></button>
|
|
Pierre-Yves Chibon |
a6029d |
New Project
|
|
Pierre-Yves Chibon |
a6029d |
|
|
Pierre-Yves Chibon |
a6029d |
|
|
Pierre-Yves Chibon |
a57a5c |
{%- endif -%}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{{searchbox(select)}}
|
|
Ryan Lerch |
6d2e06 |
<button aria-expanded="false" aria-haspopup="true" class="btn btn-outline-primary dropdown-toggle ml-2" data-toggle="dropdown" type="button"></button>
|
|
Ryan Lerch |
6d2e06 |
Sort
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
url_for('ui_ns.browse_projects') }}">
|
|
Ryan Lerch |
6d2e06 |
{% if not sorting or sorting == 'name'%}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{%endif%}
|
|
Ryan Lerch |
6d2e06 |
Name
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
url_for('ui_ns.browse_projects', sorting='latest') }}">
|
|
Ryan Lerch |
6d2e06 |
{% if sorting == 'latest'%}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{%endif%}
|
|
Ryan Lerch |
6d2e06 |
Recent First
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
url_for('ui_ns.browse_projects', sorting='oldest') }}">
|
|
Ryan Lerch |
6d2e06 |
{% if sorting == 'oldest'%}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{%endif%}
|
|
Ryan Lerch |
6d2e06 |
Oldest First
|
|
Ryan Lerch |
6d2e06 |
|
|
Johan Cwiklinski |
63918a |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{{ render_row(list) }}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{% if total and total > 1 %}
|
|
Ryan Lerch |
6d2e06 |
{{ pagination_link(pagetitle, page, total, sorting=sorting) }}
|
|
Ryan Lerch |
6d2e06 |
{% endif %}
|
|
Ryan Lerch |
e914ef |
{% endmacro %}
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
e914ef |
{% macro render_user_repos(
|
|
Ryan Lerch |
e914ef |
list, total, pagetitle, page, title, count, id, username=None, hide=True) %}
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
eef090 |
{{ title }} {{ count }}
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
e914ef |
{% if total and total > 1 %}
|
|
Ryan Lerch |
e914ef |
{{ pagination_link(pagetitle, page, total) }}
|
|
Ryan Lerch |
e914ef |
{% endif %}
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
e914ef |
|
|
Pierre-Yves Chibon |
e90f24 |
{% for repo in list %}
|
|
Pierre-Yves Chibon |
e90f24 |
|
|
Pierre-Yves Chibon |
e90f24 |
url_for(
|
|
Pierre-Yves Chibon |
b130e5 |
'ui_ns.view_repo',
|
|
Pierre-Yves Chibon |
08a80b |
repo=repo.name,
|
|
Pierre-Yves Chibon |
e90f24 |
username=repo.user.username if repo.is_fork else None,
|
|
Pierre-Yves Chibon |
08a80b |
namespace=repo.namespace)
|
|
Pierre-Yves Chibon |
e90f24 |
}}">
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
ff8880 |
{{ repo.namespace + '/' if repo.namespace }}{{ repo.name }}
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
ff8880 |
|
|
Pierre-Yves Chibon |
e90f24 |
|
|
Pierre-Yves Chibon |
e90f24 |
{% else %}
|
|
Pierre-Yves Chibon |
e90f24 |
No projects found
|
|
Pierre-Yves Chibon |
e90f24 |
{% endfor %}
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
e914ef |
|
|
Ryan Lerch |
e914ef |
{% if total and total > 1 %}
|
|
Ryan Lerch |
e914ef |
{{ pagination_link(pagetitle, page, total) }}
|
|
Ryan Lerch |
e914ef |
{% endif %}
|
|
Ryan Lerch |
e914ef |
|
|
Johan Cwiklinski |
63918a |
{% endmacro %}
|
|
Johan Cwiklinski |
63918a |
|
|
Johan Cwiklinski |
63918a |
|
|
Pierre-Yves Chibon |
9d1583 |
{% macro repos_switch(all=True, hide=True) %}
|
|
Johan Cwiklinski |
63918a |
<aside class="show_parts"></aside>
|
|
Pierre-Yves Chibon |
dcf26d |
|
|
Johan Cwiklinski |
160732 |
|
|
Johan Cwiklinski |
160732 |
{% if all %}My repos:{% else %}Repos:{% endif %}
|
|
Johan Cwiklinski |
160732 |
|
|
Pierre-Yves Chibon |
74bb2a |
<label class="switch"></label>
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
name="{% if all %}my{% endif %}repos"
|
|
Pierre-Yves Chibon |
74bb2a |
{%- if (
|
|
Pierre-Yves Chibon |
74bb2a |
(all and 'myrepos' in config.get('SHOW_PROJECTS_INDEX', []))
|
|
Pierre-Yves Chibon |
74bb2a |
or
|
|
Pierre-Yves Chibon |
74bb2a |
(not all and 'repos' not in config.get('SHOW_PROJECTS_INDEX', []))
|
|
Pierre-Yves Chibon |
74bb2a |
)
|
|
Pierre-Yves Chibon |
74bb2a |
or not hide %} checked {% endif %}/>
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Johan Cwiklinski |
63918a |
Forks:
|
|
Pierre-Yves Chibon |
74bb2a |
<label class="switch"></label>
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
name="{% if all %}my{% endif %}forks" {%
|
|
Pierre-Yves Chibon |
74bb2a |
if 'myforks' in config.get('SHOW_PROJECTS_INDEX', []) or not hide
|
|
Pierre-Yves Chibon |
74bb2a |
%} checked {% endif %}/>
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Johan Cwiklinski |
63918a |
{% if all %}
|
|
Johan Cwiklinski |
63918a |
All repos:
|
|
Pierre-Yves Chibon |
74bb2a |
<label class="switch"></label>
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
name="repos" id="allrepos" {%
|
|
Pierre-Yves Chibon |
74bb2a |
if 'repos' in config.get('SHOW_PROJECTS_INDEX', []) or not hide
|
|
Pierre-Yves Chibon |
74bb2a |
%} checked {% endif %}/>
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Pierre-Yves Chibon |
74bb2a |
|
|
Johan Cwiklinski |
63918a |
{% endif %}
|
|
Pierre-Yves Chibon |
dcf26d |
|
|
Johan Cwiklinski |
63918a |
|
|
Johan Cwiklinski |
63918a |
{% endmacro %}
|
|
Ryan Lerch |
83d2ee |
|
|
Pierre-Yves Chibon |
81c4fe |
{% macro render_repos_as_card(list, total, name, pagetitle, page, total_page) %}
|
|
Pierre-Yves Chibon |
81c4fe |
{% if total_page and total_page > 1 %}
|
|
Pierre-Yves Chibon |
81c4fe |
{{ pagination_link(pagetitle, page, total_page) }}
|
|
Pierre-Yves Chibon |
81c4fe |
{% endif %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
83d2ee |
|
|
Ryan Lerch |
eef090 |
{{name}} {{total}}
|
|
Ryan Lerch |
83d2ee |
|
|
Pierre-Yves Chibon |
218bb1 |
{% if list %}
|
|
Pierre-Yves Chibon |
218bb1 |
|
|
Ryan Lerch |
83d2ee |
{% for repo in list %}
|
|
Ryan Lerch |
6d2e06 |
{% set url = url_for('ui_ns.view_repo',
|
|
Ryan Lerch |
6d2e06 |
repo=repo.name,
|
|
Ryan Lerch |
6d2e06 |
username=repo.user.username if repo.is_fork else None,
|
|
Ryan Lerch |
6d2e06 |
namespace=repo.namespace) %}
|
|
Ryan Lerch |
83d2ee |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{% if repo.avatar_email %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
src="{{ repo.avatar_email | avatar_url }}"
|
|
Ryan Lerch |
6d2e06 |
width=60 height=60 />
|
|
Ryan Lerch |
6d2e06 |
{% elif repo.is_fork %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
997f5e |
|
|
Ryan Lerch |
6d2e06 |
{% else %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
83d2ee |
|
|
Ryan Lerch |
6d2e06 |
{% endif %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
{{ repo.fullname }}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
949fd2 |
|
|
Ryan Lerch |
6d2e06 |
<small></small>
|
|
Ryan Lerch |
6d2e06 |
{% if repo.description %}
|
|
Ryan Lerch |
6d2e06 |
{{ repo.description }}
|
|
Ryan Lerch |
6d2e06 |
{% else %}
|
|
Ryan Lerch |
6d2e06 |
no description
|
|
Ryan Lerch |
6d2e06 |
{% endif %}
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
6d2e06 |
|
|
Ryan Lerch |
83d2ee |
|
|
Ryan Lerch |
83d2ee |
|
|
Ryan Lerch |
83d2ee |
{% endfor %}
|
|
Pierre-Yves Chibon |
218bb1 |
|
|
Pierre-Yves Chibon |
218bb1 |
{% else %}
|
|
Pierre-Yves Chibon |
218bb1 |
|
|
Pierre-Yves Chibon |
218bb1 |
No projects found
|
|
Ryan Lerch |
83d2ee |
|
|
Pierre-Yves Chibon |
218bb1 |
{% endif %}
|
|
Ryan Lerch |
83d2ee |
|
|
Pierre-Yves Chibon |
81c4fe |
{% if total_page and total_page > 1 %}
|
|
Pierre-Yves Chibon |
81c4fe |
{{ pagination_link(pagetitle, page, total_page) }}
|
|
Pierre-Yves Chibon |
81c4fe |
{% endif %}
|
|
Ryan Lerch |
83d2ee |
{% endmacro %}
|
|
Ryan Lerch |
bda15f |
|
|
Pierre-Yves Chibon |
9b7fe0 |
{% macro render_activity_graph(username) %}
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Shengjing Zhu |
2295bf |
url_for('static', filename='vendor/jquery/jquery.min.js') }}">
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Shengjing Zhu |
2295bf |
url_for('static', filename='vendor/d3/d3.v3.min.js') }}">
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Adam Williamson |
8a161a |
url_for('static', filename='vendor/jstimezonedetect/jstz.min.js') }}">
|
|
Adam Williamson |
8a161a |
|
|
Shengjing Zhu |
2295bf |
url_for('static', filename='vendor/cal-heatmap/cal-heatmap.min.js') }}">
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Shengjing Zhu |
2295bf |
url_for('static', filename='vendor/cal-heatmap/cal-heatmap.css') }}" />
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Ryan Lerch |
eef090 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Ryan Lerch |
eef090 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Ryan Lerch |
bda15f |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
Recent Activity
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
<button class="btn btn-secondary btn-sm" id="hide_activity"></button>
|
|
Ryan Lerch |
6d2e06 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
title="Hide activity info" aria-hidden="true">
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Ryan Lerch |
bda15f |
|
|
Pierre-Yves Chibon |
9b7fe0 |
<script type="text/javascript"></script>
|
|
Pierre-Yves Chibon |
9b7fe0 |
function padStr(i) {
|
|
Pierre-Yves Chibon |
9b7fe0 |
return (i < 10) ? "0" + i : "" + i;
|
|
Pierre-Yves Chibon |
9b7fe0 |
}
|
|
Pierre-Yves Chibon |
9b7fe0 |
$('#hide_activity').click(function(){
|
|
Pierre-Yves Chibon |
9b7fe0 |
$('#user-activity').hide();
|
|
Pierre-Yves Chibon |
9b7fe0 |
});
|
|
Pierre-Yves Chibon |
9b7fe0 |
var cal = new CalHeatMap();
|
|
Adam Williamson |
8a161a |
var tz = jstz.determine().name();
|
|
Pierre-Yves Chibon |
9b7fe0 |
cal.init({
|
|
Ryan Lerch |
6d2e06 |
cellSize: 8,
|
|
Pierre-Yves Chibon |
9b7fe0 |
domain: "month",
|
|
Pierre-Yves Chibon |
9b7fe0 |
subDomain: "day",
|
|
Pierre-Yves Chibon |
484f6f |
domainLabelFormat: "%b",
|
|
Pierre-Yves Chibon |
9b7fe0 |
start: new Date(new Date().setMonth(new Date().getMonth() - 11)),
|
|
Pierre-Yves Chibon |
9b7fe0 |
data: "{{ url_for(
|
|
Pierre-Yves Chibon |
9b7fe0 |
'api_ns.api_view_user_activity_stats',
|
|
Adam Williamson |
8a161a |
username=username, format='timestamp') }}" + '&tz=' + tz,
|
|
Pierre-Yves Chibon |
a8e4e9 |
dataType: "json",
|
|
Pierre-Yves Chibon |
a8e4e9 |
highlight: "now",
|
|
Pierre-Yves Chibon |
9b7fe0 |
onClick: function(date, nb) {
|
|
Pierre-Yves Chibon |
9b7fe0 |
date = date.getFullYear() + '-' + padStr(date.getMonth() + 1)
|
|
Pierre-Yves Chibon |
9b7fe0 |
+ '-' + padStr(date.getDate());
|
|
Pierre-Yves Chibon |
9b7fe0 |
$.ajax({
|
|
Pierre-Yves Chibon |
9b7fe0 |
type: 'GET',
|
|
Pierre-Yves Chibon |
9b7fe0 |
url: "{{ url_for(
|
|
Pierre-Yves Chibon |
9b7fe0 |
'api_ns.api_view_user_activity_date',
|
|
Adam Williamson |
8a161a |
username=username, date='') }}" + date + '?grouped=1&tz=' + tz,
|
|
Pierre-Yves Chibon |
9b7fe0 |
contentType: "application/json",
|
|
Pierre-Yves Chibon |
9b7fe0 |
dataType: 'json',
|
|
Pierre-Yves Chibon |
9b7fe0 |
success: function(data) {
|
|
Pierre-Yves Chibon |
3480dd |
$('#user-activity-body').html('');
|
|
Pierre-Yves Chibon |
3480dd |
$('#user-activity-title').text('Activity on ' + date);
|
|
Pierre-Yves Chibon |
3480dd |
$('#user-activity').show();
|
|
Pierre-Yves Chibon |
9b7fe0 |
if (data.activities.length > 0){
|
|
Pierre-Yves Chibon |
3480dd |
for (var i=0; i
|
|
Pierre-Yves Chibon |
3480dd |
var d = data.activities[i];
|
|
Pierre-Yves Chibon |
3480dd |
$('#user-activity-body').append(
|
|
Pierre-Yves Chibon |
3480dd |
''
|
|
Pierre-Yves Chibon |
3480dd |
+ d.description_mk
|
|
Pierre-Yves Chibon |
3480dd |
+ ''
|
|
Pierre-Yves Chibon |
3480dd |
);
|
|
Pierre-Yves Chibon |
3480dd |
}
|
|
Pierre-Yves Chibon |
9b7fe0 |
}
|
|
Pierre-Yves Chibon |
3480dd |
else {
|
|
Pierre-Yves Chibon |
3480dd |
$('#user-activity-body').append(
|
|
Pierre-Yves Chibon |
3480dd |
'No activity recorded on that day '
|
|
Pierre-Yves Chibon |
9b7fe0 |
);
|
|
Pierre-Yves Chibon |
9b7fe0 |
}
|
|
Pierre-Yves Chibon |
9b7fe0 |
}
|
|
Pierre-Yves Chibon |
9b7fe0 |
});
|
|
Pierre-Yves Chibon |
9b7fe0 |
}
|
|
Pierre-Yves Chibon |
9b7fe0 |
});
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Ryan Lerch |
bda15f |
|
|
Pierre-Yves Chibon |
9b7fe0 |
|
|
Ryan Lerch |
bda15f |
{% endmacro%}
|
|
Ryan Lerch |
6d2e06 |
|