Package omeroweb :: Package feedback :: Package templatetags :: Module feedback_tags
[hide private]
[frames] | no frames]

Source Code for Module omeroweb.feedback.templatetags.feedback_tags

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3  #  
 4  #  
 5  #  
 6  # Copyright (c) 2008 University of Dundee.  
 7  #  
 8  # This program is free software: you can redistribute it and/or modify 
 9  # it under the terms of the GNU Affero General Public License as 
10  # published by the Free Software Foundation, either version 3 of the 
11  # License, or (at your option) any later version. 
12  #  
13  # This program is distributed in the hope that it will be useful, 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
16  # GNU Affero General Public License for more details. 
17  #  
18  # You should have received a copy of the GNU Affero General Public License 
19  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
20  #  
21  # Author: Aleksandra Tarkowska <A(dot)Tarkowska(at)dundee(dot)ac(dot)uk>, 2008. 
22  #  
23  # Version: 1.0 
24  # 
25   
26   
27  import datetime 
28  import traceback 
29  import logging 
30   
31  from django.conf import settings 
32  from django import template 
33  from django.templatetags.static import PrefixNode 
34   
35  register = template.Library() 
36   
37  logger = logging.getLogger(__name__) 
38   
39  @register.tag() 
40 -def get_static_feedback_prefix(parser, token):
41 """ 42 Populates a template variable with the static prefix, 43 ``settings.FEEDBACK_STATIC_URL``. 44 45 Usage:: 46 47 {% get_static_feedback_prefix [as varname] %} 48 49 Examples:: 50 51 {% get_static_feedback_prefix %} 52 {% get_static_feedback_prefix as STATIC_FEEDBACK_PREFIX %} 53 54 """ 55 return PrefixNode.handle_token(parser, token, "STATIC_FEEDBACK_URL")
56