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 / forum-activity.html
Size: Mime:
## mako
<%inherit file="base_course.html" />
<%! from django.core.urlresolvers import reverse %>
<%! from django.template.defaultfilters import truncatechars %>
<%! from django.utils.translation import ugettext as _ %>
<%! from django.utils.formats import get_format %>

<%block name="content">
    <div class="row">
        <figure>
            <div id="forum-activity" style="width: 100%; height: 600px"></div>
        </figure>
    </div>

    <div class="row">
        <div class="thumbnail col-md-3 key-stats forum-key-stats">
            <h2>&nbsp;</h2>
            <h1>${total_threads}</h1>
            <h2>${_("forum threads created")}</h2>
        </div>
        <%def name="thread_stat(title, thread)">
            <h2>&nbsp;</h2>
            <h2>${title}</h2>
            <h1>${_("%d comments") % thread["comments_count"]}</h1>
            <h2>
                <a href="${reverse('single_thread', kwargs={'course_id': course_id, 'discussion_id': thread['commentable_id'], 'thread_id': thread['id']})}">
                    ${truncatechars(thread["title"], 30)}
                </a>
            </h2>
        </%def>
        %if most_active_thread:
        <div class="thumbnail col-md-3 key-stats forum-key-stats">${thread_stat(_("Most active forum thread:"), most_active_thread)}</div>
        %endif
        %if least_active_thread:
        <div class="thumbnail col-md-3 key-stats forum-key-stats">${thread_stat(_("Least active forum thread:"), least_active_thread)}</div>
        %endif
        %if most_active_user:
        <div class="thumbnail col-md-3 key-stats forum-key-stats">
            <h2>&nbsp;</h2>
            <h2>${_("Most active student:")}</h2>
            <h1><a href="${reverse('django_comment_client.forum.views.user_profile', args=[course_id, most_active_user.id])}">${most_active_user.username}</a></h1>
        </div>
        %endif

    <div class="row">
        <div class="col-md-12">
            <a class="pull-right" href="${reverse('course-dashboard:forum-activity', kwargs={'course_id': course_id})}?format=csv">${_("Download raw CSV data")}</a>
        </div>
    </div>
    <div class="row">
        <table class="table">
            <tr>
                <th>${_("Date")}</th>
                <th>${_("Number of new threads")}</th>
            </tr>
            % for date, count in threads_per_day[::-1]:
            <tr>
                <td>${date}</td>
                <td>${count}</td>
            </tr>
            % endfor
        </table>
    </div>
</%block>

<%block name="extra_footer">
    <% figure_label=_("New forum threads per day") %>
    <%include file="graph.html" args="stats_per_timestamp=threads_per_timestamp, figure_id='forum-activity', figure_label=figure_label" />
</%block>