Permalink
Browse files

Readme update, testproject added and templatetags fix for doubled-slash

  • Loading branch information...
agafonovdmitry committed Aug 16, 2012
1 parent 3343026 commit fa8fc38f47a41840291147c91180f32cb86de2bb
View
@@ -10,15 +10,41 @@ convert from imagemagick to produce minimal possible size with no loss.
Total image count: 1246. Optimization: 793.8 kB => 727.8 kB (~8% less).
+Two template tags for easy usage are included via ``icons`` tag library.
+
Installation
------------
-...
+**Directly from GitHub**::
+
+ pip install git+git://github.com/agafonovdmitry/django-icons-famfamfam.git
Usage
-----
-...
+**Make sure these lines are in ``INSTALLED_APPS`` in ``settings.py``**::
+
+ 'django.contrib.staticfiles',
+ 'django-icons-famfamfam',
+
+**In your templates**:
+
+Direct images usage::
+
+ <img src="{{ STATIC_URL }}icons/thumb_up.png" />
+
+Or use special template tags bundled::
+
+ {% load icons %}
+
+ <p><a href="/login/" {% icon 'door_in' %}>Login</a></p>
+ <h2 {% icon 'user' %}>Username</h2>
+ <p>Please subscribe to our <span {% icon 'feed' %}>RSS feed</span>.</p>
+
+ <ul><li {% listicon 'bullet_picture' %}>Item</li></ul>
+
+See ``testproject`` folder which contains minimal django project and
+provided for testing and demonstration purposes.
Original author's README files with license information follows:
@@ -33,7 +33,7 @@ def icon(icon_name):
return (
'class="icon" style="background-image:url(' +
- settings.STATIC_URL + '/icons/' + icon_name + '.png);"'
+ settings.STATIC_URL + 'icons/' + icon_name + '.png);"'
)
@@ -47,6 +47,6 @@ def listicon(icon_name):
"""
return (
- 'style="list-style-image:url(' + settings.STATIC_URL +
- '/icons/' + icon_name + '.png);"'
+ 'style="list-style-image:url(' +
+ settings.STATIC_URL + 'icons/' + icon_name + '.png);"'
)
View
@@ -12,7 +12,7 @@
author='Dmitry Agafonov',
author_email='Dmitry@Agafonov.pp.ru',
url='https://github.com/agafonovdmitry/django-icons-famfamfam',
- packages=find_packages(),
+ packages=find_packages(exclude=['testproject']),
include_package_data=True,
license='Various, see README file',
description='Django staticfiles with famfamfam silk and flag icon sets',
No changes.
No changes.
@@ -0,0 +1,20 @@
+<html>
+ <head>
+ <style>
+ .icon { padding-left: 20px; background-repeat: no-repeat; line-height: 20px; }
+ </style>
+ </head>
+ <body>
+
+ <p><img src="{{ STATIC_URL }}icons/thumb_up.png"></p>
+
+ {% load icons %}
+
+ <p><a href="/login/" {% icon 'door_in' %}>Login</a></p>
+ <h2 {% icon 'user' %}>Username</h2>
+ <p>Please subscribe to our <span {% icon 'feed' %}>RSS feed</span>.</p>
+
+ <ul><li {% listicon 'bullet_picture' %}>Item</li></ul>
+
+ </body>
+</html>
@@ -0,0 +1,9 @@
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+ROOT_URLCONF = 'fam.urls'
+STATIC_URL = '/static/'
+INSTALLED_APPS = (
+ 'django.contrib.staticfiles',
+ 'django-icons-famfamfam',
+ 'fam.famfam',
+)
View
@@ -0,0 +1,6 @@
+from django.conf.urls import patterns, include, url
+from django.views.generic.simple import direct_to_template
+
+urlpatterns = patterns('',
+ url(r'^$', direct_to_template, {'template':'famfamfam.html'})
+)
View
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ == "__main__":
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fam.settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)

0 comments on commit fa8fc38

Please sign in to comment.