Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fun-apps / templates / course_dashboard / student-map-content.html
Size: Mime:
## mako
<%! from django.core.urlresolvers import reverse %>
<%! from django.utils.translation import ugettext as _ %>

<div class="row">
    <figure>
        <div id="students-world-map" style="width: 100%; height: 600px"></div>
    </figure>
</div>

<%def name="country_stat(title, stat)">
    <h2>${title}</h2>
    <h1>${stat[2]}</h1>
    <div class="flag-icon flag-icon-${stat[1].lower()}" style="width: 100%; height: 100px;"></div>
    <h2>${_("%.2f%% of students") % (stat[0] * 100. / total_population)}</h2>
</%def>

<div class="row">
    <div class="thumbnail col-md-3 key-stats">
        <h1>${_("%d students") % total_population}</h1>
        <h2>${_("from")}</h2>
        <h1>${_("%d countries") % len(course_population)}</h1>
    </div>
    %if len(top_countries) > 0:
    <div class="thumbnail col-md-3 key-stats">${country_stat(_("Top country by enrollment"), top_countries[0])}</div>
    %endif
    %if len(top_countries) > 1:
    <div class="thumbnail col-md-3 key-stats">${country_stat(_("Second country by enrollment"), top_countries[1])}</div>
    %endif
    %if len(top_countries) > 2:
    <div class="thumbnail col-md-3 key-stats">${country_stat(_("Third country by enrollment"), top_countries[2])}</div>
    %endif
</div>

<p>${_("Note: the 'Unknown' country refers to the users who have not provided their country of origin. These data are collected on a declarative basis.")}</p>

<div class="row">
    <div class="col-md-12">
        % if course_id:
        <a class="pull-right" href="${reverse('course-dashboard:student-map', kwargs={'course_id': course_id})}?format=csv">${_("Download raw CSV data")}</a>
        % else:
        <a class="pull-right" href="${reverse('course-dashboard-global:student-map')}?format=csv">${_("Download raw CSV data")}</a>
        % endif
    </div>
</div>
<div class="row">
    <table class="table col-md-12">
        <tr>
            <th>${_("Country")}</th>
            <th>${_("Number of learners")}</th>
            <th>${_("Proportion")}</th>
        </tr>
        % for population, code, country in top_countries:
        <tr>
            <td>${country}</td>
            <td>${population}</td>
            <td>${"%.2f" % (population * 100. / total_population)}%</td>
        </tr>
        % endfor
    </table>
</div>