Decoupled the "reddit" application from the main program

This commit is contained in:
2010-12-20 12:17:14 +00:00
parent 0aef422d9a
commit cc4f986edb
15 changed files with 113 additions and 103 deletions

View File

@@ -2,6 +2,7 @@
{% load humanize %}
{% load if_extra %}
{% load installed %}
{% block title %}View Application{% endblock %}
@@ -88,7 +89,7 @@
{% endfor %}
{% endfor %}
</table>
{% if "reddit"|installed %}
{% if app.user.redditaccount_set.all %}
<h3>Reddit Accounts</h3>
<table>
@@ -151,7 +152,7 @@ function handleResponse() {
<div id="redditposts">
</div>
{% endif %}
{% endif %}
{% endif %}
{% endblock %}

View File

@@ -70,15 +70,16 @@
</table>
{% endif %}
{% if "reddit"|installed %}
<br/>
<h2>Reddit Accounts</h2>
{% if reddits %}
{% if user.redditaccount_set.all %}
<table>
<thead>
<tr><th>Username</th><th>Created Date</th><th>Validated</th></tr>
</thead>
<tbody>
{% for acc in reddits %}
{% for acc in user.redditaccount_set.all %}
<tr><td><a href="http://reddit.com/user/{{ acc.username }}/">{{ acc.username }}</a></td>
<td>{{ acc.date_created }}</td>
<td>{% if acc.validated %}Yes{% else %}No{% endif %}</td>
@@ -88,5 +89,6 @@
</table>
{% endif %}
{% endif %}
{% endif %}
{% endblock %}

View File

@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load naturaltimediff %}
{% load installed %}
{% block title %}Your Profile{% endblock %}
@@ -119,6 +120,7 @@ setup.</p>
<br/>
{% if "reddit"|installed %}
<h2>Reddit Accounts</h2>
<p>This is a list of all your current linked Reddit accounts</p>
{% if user.redditaccount_set.all %}
@@ -140,6 +142,7 @@ setup.</p>
<p>
<a href="{% url sso.views.reddit_add %}">Add a Reddit account</a>
</p>
{% endif %}
<p>If you encounter any errors during using this service, copy the massive
error message into <a href="http://pastebin.com/">Pastebin</a> and give