Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40f3182
commit 9b7827b
Showing
29 changed files
with
658 additions
and
41 deletions.
There are no files selected for viewing
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding:utf-8 -*- | ||
import os | ||
PROJECT_ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
from settings import * | ||
|
||
MAIN_TEMPLATE_DIR=os.path.join(PROJECT_ROOT_PATH, 'templates') | ||
WEB_TEMPLATE_DIR=os.path.join(MAIN_TEMPLATE_DIR, 'mobile') | ||
TEMPLATE_DIRS = ( | ||
WEB_TEMPLATE_DIR, | ||
os.path.join(WEB_TEMPLATE_DIR, 'tips') | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{% extends "base_site.html" %} | ||
|
||
{% block main %} | ||
|
||
{% load truncate %} | ||
|
||
{% if not tips %} | ||
<div id="error404"> | ||
<img src="{{ MEDIA_URL }}css/images/sadpenguin.png" width="150" height="137" alt="Sad penguin"/> | ||
<p>Sorry, no tips found.</p> | ||
</div> | ||
{% endif %} | ||
|
||
{% load pagination_tags %} | ||
{% autopaginate tips 10 %} | ||
|
||
|
||
<ul class="list_data"> | ||
{% for tip in tips %} | ||
<li> | ||
<a href="{{ tip.get_absolute_url }}" title="{{ tip.title }}"> | ||
{% include 'post_title.html' %} | ||
<span class="description">{{ tip.body|striptags|truncate:100|removetags:"div b span a p br table"|safe }}</span> | ||
</a> | ||
<br class="clear"/> | ||
</li> | ||
<!-- | ||
{% if tip.body|striptags|truncate:100|length > 100 %} | ||
<div class="post-footer reply"> | ||
<a href="{{ tip.get_absolute_url }}" class="button">keep reading...</a> | ||
</div> | ||
{% endif %} | ||
--> | ||
{% endfor %} | ||
</ul> | ||
|
||
<br class="clear"/> | ||
|
||
{% paginate %} | ||
|
||
|
||
{% endblock %} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% load truncate %} | ||
|
||
<span class="header"> | ||
{{ tip.title|upper|truncate:47 }} | ||
</span><br/> | ||
|
||
<!-- | ||
<h1 class="post-title"><a href="{{ tip.get_absolute_url }}" title="{{ tip.title }}"><strong>{{ tip.title|upper|truncate:47 }}</strong></a></h1> | ||
<h2 class="post-header-line1">{{ tip.pub_date|date:"F j, Y" }} by {{ tip.author }} {% if tip.get_tags %}| {{ tip.get_tags|safeseq|join:", " }} {% endif %}</h2> | ||
{% ifequal request.user tip.author %} | ||
<a href="{% url tip-edit tip.id %}" title="Edit"><div class="edit" style="float:left;margin-right:5px;"></div><noscript>Edit</noscript></a> | ||
<a href="{% url tip-delete tip.id %}" title="Delete"><div class="delete" style="float:left;"></div><noscript>Delete</noscript></a> | ||
<br/> | ||
{% endifequal %} | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% extends 'base_site.html' %} | ||
|
||
{% load comments %} | ||
{% load gravatar %} | ||
{% load truncate %} | ||
|
||
{% block meta_keywords %}{{ tip.title }}{% endblock %} | ||
|
||
{% block title %} | ||
{{ block.super }} - {{ tip.title|lower }} | ||
{% endblock %} | ||
|
||
{% block main %} | ||
<div class="inner"> | ||
<h2 class="header">{{ tip.title|upper|truncate:47 }}</h2> | ||
<p> | ||
{{ tip.body|striptags|linebreaksbr|safe }} | ||
</p> | ||
</div> | ||
|
||
<br class="clear"/><br/> | ||
|
||
<ul class="list_data"> | ||
{% get_comment_list for tip as comment_list %} | ||
{% for comment in comment_list %} | ||
<li> | ||
<span class="avatar"> | ||
{% gravatar comment.user_email 48 %} | ||
</span> | ||
<span class="header with_avatar">{{ comment.name }} says</span><br/> | ||
<span class="description">{{ comment.comment|linebreaks }}</span> | ||
<br class="clear"/> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% extends 'base_site.html' %} | ||
|
||
{% block main %} | ||
|
||
<div class="info"> | ||
<h1>Edit Tip</h1> | ||
</div> | ||
|
||
<form id="formTipEdit" name="formTipEdit" action="{% url tip-update %}" method="post" class="genericform"> | ||
{% include 'form.html' %} | ||
|
||
<div> | ||
<input type="submit" value="Save" class="button"> | ||
<input type="button" value="Cancel" class="button" onclick="history.go(-1);"> | ||
</div> | ||
|
||
</form> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% csrf_token %} | ||
|
||
{{ form.id }} | ||
<label class="title" for="id_title" accesskey="t">Title</label> {{ form.title }} <span class="errormessage">{{ form.title.errors }}</span> | ||
<label class="title" for="id_body" accesskey="b">Tip</label> {{ form.body }} <span class="errormessage">{{ form.body.errors }}</span> | ||
<label class="title" for="id_tags" accesskey="d">Tags</label> {{ form.tags }} <span class="errormessage">{{ form.tags.errors }}</span> | ||
<label class="title" ></label>{{ form.is_public }}<label class="desc" for="id_is_public"> Is public?</label> | ||
<label class="title" ></label>{{ form.enable_comments }}<label class="desc" for="id_enable_comments"> Enable comments?</label> | ||
<p class="terms">Attention: Your tip may be rejected if it is considered improper or duplicate by Administrator.</p> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{% extends 'base_site.html' %} | ||
|
||
{% block main %} | ||
|
||
{% load pagination_tags %} | ||
|
||
{% autopaginate tips 10 %} | ||
|
||
<div class="tips"> | ||
<div class="info"><h1>My Tips</h1></div> | ||
|
||
{% if tips %} | ||
{% paginate %} | ||
<table cellpadding="0" cellspacing="0" border="1"> | ||
<thead> | ||
<td width="80">Posted in</td> | ||
<td width="400">Title</td> | ||
<td class="center">Hits</td> | ||
<td class="center">Approved?</td> | ||
<td> </td> | ||
<td> </td> | ||
</thead> | ||
<tbody> | ||
{% for tip in tips %} | ||
<tr style="background:{% cycle '#ffffff' '#f8f8f8' %}"> | ||
<td>{{ tip.pub_date }}</td> | ||
<td><a href="{{ tip.get_absolute_url }}">{{ tip.title }}</a></td> | ||
<td class="center">{{ tip.hits }}</td> | ||
<td class="center" style="color:{% if tip.approved %}green{% else %}red{% endif %}">{{ tip.approved|yesno }}</td> | ||
<td><a href="{% url tip-edit tip.id %}" title="Edit"><div class="edit"></div><noscript>Edit</noscript></a></td> | ||
<td><a href="{% url tip-delete tip.id %}" title="Delete"><div class="delete"></div><noscript>Delete</noscript></a></td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
{% else %} | ||
<p style="font-size:0.8em">No tips.</p> | ||
{% endif %} | ||
|
||
</div> | ||
|
||
<br><br> | ||
|
||
{% autopaginate bookmarked_tips 10 %} | ||
|
||
<div class="tips"> | ||
<div class="info"><h1>Bookmarked Tips</h1></div> | ||
|
||
{% if bookmarked_tips %} | ||
<table cellpadding="0" cellspacing="0" border="1"> | ||
<thead> | ||
<td width="80">Posted in</td> | ||
<td width="400">Title</td> | ||
<td width="150" class="center">Author</td> | ||
<td> </td> | ||
</thead> | ||
<tbody> | ||
{% for b in bookmarked_tips %} | ||
<tr style="background:{% cycle '#ffffff' '#f8f8f8' %}"> | ||
<td>{{ b.tip.pub_date }}</td> | ||
<td><a href="{{ b.tip.get_absolute_url }}">{{ b.tip.title }}</a></td> | ||
<td class="center">{{ b.tip.author }}</td> | ||
<td><a href="{% url tip-bookmark b.tip.id %}?action=delete" title="Delete"><div class="delete"></div><noscript>Delete</noscript></a></td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% paginate %} | ||
|
||
{% else %} | ||
<p style="font-size:0.8em">No bookmarked tips. You can't add on bookmark yourself tips.</p> | ||
{% endif %} | ||
|
||
</div> | ||
|
||
<br><br> | ||
|
||
<div class="info"> | ||
<h1>New Tip</h1> | ||
<div></div> | ||
</div> | ||
|
||
<form id="formTipAdd" name="formTipAdd" action="{% url tip-add %}" method="post" class="genericform"> | ||
{% include 'form.html' %} | ||
|
||
<div> | ||
<input type="submit" value="Add" class="button"> | ||
</div> | ||
|
||
</form> | ||
|
||
{% endblock %} |
File renamed without changes.
File renamed without changes.