From cc7d55933a977604c37e275cdb81d018cc7b3086 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 2 Jan 2012 16:53:45 -0400 Subject: [PATCH] Move tag literals to their own module --- apps/tags/literals.py | 41 +++++++++++++++++++++++++++++++++++++++++ apps/tags/utils.py | 21 --------------------- 2 files changed, 41 insertions(+), 21 deletions(-) create mode 100644 apps/tags/literals.py delete mode 100644 apps/tags/utils.py diff --git a/apps/tags/literals.py b/apps/tags/literals.py new file mode 100644 index 0000000000..4053c3273a --- /dev/null +++ b/apps/tags/literals.py @@ -0,0 +1,41 @@ +from __future__ import absolute_import + +from django.utils.translation import ugettext_lazy as _ + + +COLOR_RED = u'red' +COLOR_BLUE = u'blu' +COLOR_MAGENTA = u'mag' +COLOR_CYAN = u'cya' +COLOR_YELLOW = u'yel' +COLOR_GREENYELLOW = u'gry' +COLOR_CORAL = u'crl' +COLOR_KHAKI = u'kki' +COLOR_LIGHTGREY = u'lig' +COLOR_ORANGE = u'org' + +COLOR_CHOICES = ( + (COLOR_BLUE, _(u'Blue')), + (COLOR_CYAN, _(u'Cyan')), + (COLOR_CORAL, _(u'Coral')), + (COLOR_GREENYELLOW, _(u'Green-Yellow')), + (COLOR_KHAKI, _(u'Khaki')), + (COLOR_LIGHTGREY, _(u'LightGrey')), + (COLOR_MAGENTA, _(u'Magenta')), + (COLOR_RED, _(u'Red')), + (COLOR_ORANGE, _(u'Orange')), + (COLOR_YELLOW, _(u'Yellow')) +) + +COLOR_CODES = ( + (COLOR_RED, u'red'), + (COLOR_BLUE, u'blue'), + (COLOR_MAGENTA, u'magenta'), + (COLOR_CYAN, u'cyan'), + (COLOR_YELLOW, u'yellow'), + (COLOR_GREENYELLOW, u'greenyellow '), + (COLOR_CORAL, u'coral'), + (COLOR_KHAKI, u'khaki'), + (COLOR_ORANGE, u'orange'), + (COLOR_LIGHTGREY, u'lightgrey'), +) diff --git a/apps/tags/utils.py b/apps/tags/utils.py deleted file mode 100644 index 476b5bd17a..0000000000 --- a/apps/tags/utils.py +++ /dev/null @@ -1,21 +0,0 @@ -from __future__ import absolute_import - -from django.utils.translation import ugettext_lazy as _ - -from . import tag_document_remove, tag_tagged_item_list - - -def get_tags_subtemplate(obj): - """ - Return all the settings to render a subtemplate containing an - object's tags - """ - return { - 'name': 'generic_list_subtemplate.html', - 'context': { - 'title': _(u'tags'), - 'object_list': obj.tags.all(), - 'hide_link': True, - 'navigation_object_links': [tag_tagged_item_list, tag_document_remove], - } - }