From: Patrick Samson Date: Wed, 15 Aug 2012 10:46:52 +0000 (+0200) Subject: Added a CSS example X-Git-Tag: 2.0.0~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=fe39dc91cc3ea290bab5dd3e5db04c1ea5d5a1c2;p=django-postman.git Added a CSS example --- diff --git a/CHANGELOG b/CHANGELOG index d024c13..20e0259 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ Django Postman changelog 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. diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 320066b..e0c8f4f 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -179,17 +179,25 @@ in which some blocks are expected: * content: in , to put the page contents * postman_menu: in , 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: @@ -200,8 +208,6 @@ For Django 1.2: ('^' + settings.MEDIA_URL.strip('/') + r'/(?Ppostman/.*)$', '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 -------- diff --git a/docs/views.rst b/docs/views.rst index c981125..f1b4454 100644 --- a/docs/views.rst +++ b/docs/views.rst @@ -14,6 +14,8 @@ Here is a sample of some CSS rules, usable for :file:`postman/views.html`:: .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 ----- diff --git a/postman/static/postman/css/postman.css b/postman/static/postman/css/postman.css new file mode 100644 index 0000000..62b1f39 --- /dev/null +++ b/postman/static/postman/css/postman.css @@ -0,0 +1,24 @@ +/* + This is a basic stylesheet for the django-postman application. + Called from templates/postman/base.html. + Make your own design in /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; +} diff --git a/postman/templates/postman/base.html b/postman/templates/postman/base.html index 061cf3d..3633211 100644 --- a/postman/templates/postman/base.html +++ b/postman/templates/postman/base.html @@ -2,12 +2,18 @@ {% load url from future %} {% load i18n %}{% load postman_tags %} {% block title %}{% trans "Messaging" %}{% endblock %} +{% block extrahead %}{{ block.super }} +{% endblock %} {% block postman_menu %} {% endblock %} \ No newline at end of file