Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

Commit

Permalink
Added base template, added minimu UI kit
Browse files Browse the repository at this point in the history
  • Loading branch information
nylar committed May 16, 2015
1 parent c9e9a35 commit 5c8d523
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 19 deletions.
6 changes: 5 additions & 1 deletion fora/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'fora/templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -103,3 +103,7 @@
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'fora/static/'),
)
1 change: 1 addition & 0 deletions fora/static/css/minimu.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions fora/static/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$(document).ready(function() {
$(".chosen").chosen({
width: "250px",
"disable_search": true
});
});
20 changes: 20 additions & 0 deletions fora/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% load staticfiles %}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<title>Fora</title>

{% block extra_css %}{% endblock extra_css %}

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400,600">
<link rel="stylesheet" type="text/css" href="{% static 'css/minimu.min.css' %}">
</head>
<body>
{% block content %}{% endblock content %}
{% block extra_js %}{% endblock extra_js %}
</body>
</html>
11 changes: 8 additions & 3 deletions forums/templates/forums/forum_detail.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<a href="{% url 'forums:update' object.slug %}">Update</a>
<a href="{% url 'forums:visibility' object.slug %}">Change Visibility</a>
{% extends "base.html" %}

{% block content %}
<a href="{% url 'threads:new' %}" class="btn btn-green">New Thread</a>
<a href="{% url 'forums:update' object.slug %}" class="btn btn-grey">Update</a>
<a href="{% url 'forums:visibility' object.slug %}" class="btn btn-grey">Change Visibility</a>

<h1>{{ object.name }}</h1>
<p>{{ object.description }}</p>
<p>{{ object.description }}</p>
{% endblock content %}
12 changes: 10 additions & 2 deletions forums/templates/forums/forum_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% extends "base.html" %}

{% block content %}
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Create Forum" />
</form>
{% if object %}
<input type="submit" value="Update Forum" class="btn btn-green" />
{% else %}
<input type="submit" value="Create Forum" class="btn btn-green" />
{% endif %}
</form>
{% endblock content %}
35 changes: 26 additions & 9 deletions forums/templates/forums/forum_list.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
<a href="{% url 'forums:new' %}">New Forum</a>
{% extends "base.html" %}

{% for forum in object_list %}
<div>
<h1>{{ forum.name }}</h1>
<p>{{ forum.description }}</p>
</div>
{% empty %}
<p>No forums found</p>
{% endfor %}
{% block content %}
<a href="{% url 'forums:new' %}" class="btn btn-green">New Forum</a>


<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for forum in object_list %}
<tr>
<td><a href="{% url 'forums:show' forum.slug %}">{{ forum.name }}</a></td>
<td>{{ forum.description }}</td>
</tr>
{% empty %}
<tr>
<td colspan="2">No forums found</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock content %}
8 changes: 6 additions & 2 deletions threads/templates/threads/thread_detail.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{% extends "base.html" %}

{% block content %}
<h1>{{ object.subject }}</h1>
<p>Forum: <a href="{% url 'forums:show' object.forum.slug %}"></a></p>
<p>{{ object.created }}</p>
<p>Forum: <a href="{% url 'forums:show' object.forum.slug %}">{{ object.forum.name }}</a></p>
<p>{{ object.created }}</p>
{% endblock content %}
12 changes: 10 additions & 2 deletions threads/templates/threads/thread_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% extends "base.html" %}

{% block content %}
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Create Thread" />
</form>
{% if object %}
<input type="submit" value="Update Thread" class="btn btn-green" />
{% else %}
<input type="submit" value="Create Thread" class="btn btn-green" />
{% endif %}
</form>
{% endblock content %}

0 comments on commit 5c8d523

Please sign in to comment.