Source

noodle-bucket / templates / repos / repo.html

Full commit
{% extends "base.html" %}
{% load nbfilters %}

{% block title %}{{ repo.user_name }}/{{ repo.repo_name }}{% endblock %}

{% block script %}
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        var COL_WIDTH = 15;
        var changesets = {% include "pasta-scripts/cset-list.js" %}
        var cset_count = {{ repo.changeset_set.all.count }};
        var paper = Raphael("pasta-bowl", 360, (cset_count + 1) * 21);
        
        var col = 0;
        _.each(changesets, function(cset) {
            var y = 10 + 21 + (cset['index'] * 21);
            var node = paper.circle((col * COL_WIDTH + COL_WIDTH / 2), y, 3);
        });
    });
</script>
{% endblock %}

{% block content %}
    <h2>
        Noodles of
        <a href="{{ repo.bitbucket_url }}">{{ repo.user_name }}/{{ repo.repo_name }}</a>
    </h2>
    
    <div id="repo-noodles-log">
        <div class="repo-noodle noodle-header">
            <span class="noodle-hash">Changeset</span>
            <span class="noodle-author">Author</span>
            <span class="noodle-message">Message</span>
        </div>
        {% for cset in repo.changeset_set.all %}
            <div class="repo-noodle">
                <span class="noodle-hash"><a href="{{ repo.bitbucket_url }}changeset/{{ cset.cset_hash }}/">{{ cset.cset_hash }}</a></span>
                <span class="noodle-author">{{ cset.cset_author|truncate_chars:15 }}</span>
                <span class="noodle-message">{{ cset.cset_message|firstline|truncate_chars:35 }}</span>
            </div>
        {% endfor %}
    </div>
    <div id="pasta-bowl"></div>
{% endblock %}