view templates/code.djhtml @ 151:c7be7def8b57

Bundles! (basic functionality) Changes made in this commit: * Added new dependencies (see pip-requirements) * Added new dependency and setup information to README * Deleted the included mptt app (in apps/mptt) in favour of just adding the dependency to pip-requirements (makes it easier to update, etc) * Changed the import convention to use `from apps.bundle.models import Bundle` rather than `from agora.apps.bundle.models import Bundle` because Celery was having problems with the latter style. Everything should still work. * Moved the syntax-highlighting and related code for snippets into separate HTML files so that they can be used by the bundle app And, of course, the ability to upload bundles. But wait! There's more! Changes still to come, for only $19.95 a month: * Bundle versioning * Automatic license integration (i.e. adding headers to files) * The ability to download bundles (zip, tar, etc) * Rating bundles * And much, much more! Batteries not included.
author dellsystem <ilostwaldo@gmail.com>
date Mon, 15 Oct 2012 00:52:00 -0400
parents b8e0bdc37e32
children 8c5810c3be63
line wrap: on
line source

{% extends "base.djhtml" %}

{% block content %}

<h1>Browse code submissions</h1>

{% if not user.is_authenticated %}
<p class="hint">
    Welcome to Agora.
</p>
{% endif %}

<div class="row">
    <div class="span3">
        <h2 class="center-align">Snippets</h2>
        <a class="pill" href="{% url snippet_new %}">
            Post a snippet
        </a>
        {% if snippets %}
        <ul>
            {% for snippet in snippets %}
            <li>
                <a href="{{ snippet.get_absolute_url }}">
                    <strong>{{ snippet.get_title }}</strong>
                </a>
                by
                <a href="{{ snippet.author.get_absolute_url }}">
                    {{ snippet.author }}
                </a>
                <br />
                {{ snippet.published }}
            </li>
            {% endfor %}
        </ul>
        <p class="right-float">
            <a href="{% url snippet_explore %}">View more &raquo;</a>
        </p>
        {% else %}
        <p>No one has yet created a snippet.
            <a href="{% url new_snippet %}">Be the first!</a>
        </p>
        {% endif %}
    </div><div class="span3">
        <h2 class="center-align">Bundles</h2>
        {% if user.is_authenticated %}
        <a class="pill" href="{% url bundle_new %}">Upload a bundle</a>
        {% else %}
        <a class="pill login-link" href="{% url login %}">
            Login to upload bundles
        </a>
        {% endif %}
        {% if bundles %}
        <ul>
            {% for bundle in bundles %}
            <li>
                <a href="{{ bundle.get_absolute_url }}">{{ bundle }}</a>
                by
                <a href="{{ bundle.uploader.get_absolute_url }}">
                    {{ bundle.uploader }}
                </a>
                <br />
                {{ bundle.pub_date }}
            </li>
            {% endfor %}
        </ul>
        <p class="right-float">
            <a href="{% url bundle_explore %}">View more &raquo;</a>
        </p>
        {% else %}
        <p>This feature is not yet available.</p>
        {% endif %}
    </div><div class="span3">
        <h2 class="center-align">Forge</h2>
        {% if user.is_authenticated %}
        <a class="pill" href="">Add a module to the forge</a>
        {% else %}
        <a class="pill login-link" href="{% url login %}">
            Login to add a module to the forge
        </a>
        {% endif %}
        {% if forge %}
        <ul>
            {% for forge_module in forge %}
            <li>{{ forge_module }}</li>
            {% endfor %}
        </ul>
        {% else %}
        <p>This feature is not yet available.</p>
        {% endif %}
    </div>
</div>

{% endblock %}