Patrick Samson avatar Patrick Samson committed a73fe2c

Added a CSS example

Comments (0)

Files changed (5)

 Version 2.0.0, August 2012
 --------------------------
 * Add an API.
+* Add a CSS example, for view.html.
 * Rename the extra context variables passed to the notifier app to avoid name clash:
 	pm_message and pm_action
 * More adjustments for Django 1.4.

docs/quickstart.rst

 * content: in <html><body>, to put the page contents
 * postman_menu: in <html><body>, to put a navigation menu
 
+.. _static files:
+
 Static Files
 ~~~~~~~~~~~~
+
 A CSS file is provided with the application, for the Admin site: :file:`postman/css/admin.css`.
 It is not obligatory but makes the display more confortable.
 
-The file is provided under :file:`postman/static/`.
+A basic CSS file is provided to style the views: :file:`postman/css/postman.css`.
+You may use it as a starting point to make your own design.
+
+These files are provided under :file:`postman/static/`.
+
+See also :ref:`styles` for the stylesheets of views.
 
 For Django 1.3+, just follow the instructions related to the staticfiles app.
 
 For Django 1.2:
-	It's up to you to make it visible to the URL resolver.
+	It's up to you to make the files visible to the URL resolver.
 
 	For example:
 
 		('^' + settings.MEDIA_URL.strip('/') + r'/(?P<path>postman/.*)$', 'django.views.static.serve',
 			{'document_root': os.path.join(imp.find_module('postman')[1], 'medias')}),
 
-See also :ref:`styles` for the stylesheets of views.
-
 Examples
 --------
 
     .pm_message.pm_pending .pm_header  { background-color: #FFC; }
     .pm_message.pm_rejected .pm_header { background-color: #FDD; }
 
+These rules are provided with the application, as an example, in a static file (See :ref:`static files`).
+
 forms
 -----
 

postman/static/postman/css/postman.css

+/*
+	This is a basic stylesheet for the django-postman application.
+	Called from templates/postman/base.html.
+	Make your own design in <settings.STATIC_ROOT>/postman/css/postman.css
+*/
+.pm_message.pm_deleted {
+ text-decoration: line-through;
+}
+.pm_message.pm_deleted .pm_body{
+ display: none;
+}
+.pm_message.pm_archived {
+ font-style: italic;
+ color: grey;
+}
+.pm_message.pm_unread .pm_subject {
+ font-weight: bolder;
+}
+.pm_message.pm_pending .pm_header {
+ background-color: #FFC;
+}
+.pm_message.pm_rejected .pm_header {
+ background-color: #FDD;
+}

postman/templates/postman/base.html

 {% load url from future %}
 {% load i18n %}{% load postman_tags %}
 {% block title %}{% trans "Messaging" %}{% endblock %}
+{% block extrahead %}{{ block.super }}
+<link type="text/css" media="all" rel="stylesheet" href="
+{# dj v1.4 #}{% load static %}{% static 'postman/css/postman.css' %}
+{# dj v1.3 #}{# {{ STATIC_URL }}postman/css/postman.css #}
+{# dj v1.2 #}{# {{ MEDIA_URL }}postman/css/postman.css #}
+" />{% endblock %}
 {% block postman_menu %}
 <ul id="postman_menu">{% postman_unread as unread_count %}
- <li><a href="{% url 'postman_inbox' %} ">&raquo;&nbsp;{% trans "Inbox" %}{% if unread_count %} <strong>({{ unread_count }})</strong>{% endif %}</a></li>
- <li><a href="{% url 'postman_sent' %} ">&raquo;&nbsp;{% trans "Sent Messages" %}</a></li>
- <li><a href="{% url 'postman_write' %} ">&raquo;&nbsp;{% trans "Write" %}</a></li>
- <li><a href="{% url 'postman_archives' %} ">&raquo;&nbsp;{% trans "Archives" %}</a></li>
- <li><a href="{% url 'postman_trash' %} ">&raquo;&nbsp;{% trans "Trash" %}</a></li>
+ <li><a href="{% url 'postman_inbox' %}">&raquo;&nbsp;{% trans "Inbox" %}{% if unread_count %} <strong>({{ unread_count }})</strong>{% endif %}</a></li>
+ <li><a href="{% url 'postman_sent' %}">&raquo;&nbsp;{% trans "Sent Messages" %}</a></li>
+ <li><a href="{% url 'postman_write' %}">&raquo;&nbsp;{% trans "Write" %}</a></li>
+ <li><a href="{% url 'postman_archives' %}">&raquo;&nbsp;{% trans "Archives" %}</a></li>
+ <li><a href="{% url 'postman_trash' %}">&raquo;&nbsp;{% trans "Trash" %}</a></li>
 </ul>
 {% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.