Exemple #1
0
 def show_formatted(self, value):
     
     if value==0:
         
         return '<img src="'+make_media_url_module('images/status_red.png', 'pastafari')+'" />'
     else:
         return '<img src="'+make_media_url_module('images/status_green.png', 'pastafari')+'" />'
Exemple #2
0
    def show_formatted(self, value):
        
        now=datetime.now(gmt=True)
        
        timestamp_now=datetime.obtain_timestamp(now)
        
        timestamp_value=datetime.obtain_timestamp(value)

        five_minutes=int(timestamp_now)-300
        
        if timestamp_value<five_minutes:
            
            return '<img src="'+make_media_url_module('images/status_red.png', 'pastafari')+'" />'
        else:
            return '<img src="'+make_media_url_module('images/status_green.png', 'pastafari')+'" />'
Exemple #3
0
    def js_home(self):

        final_js=[]
        
        for js in self.js:
            final_js.append('<script language="Javascript" src="'+make_media_url('js/'+js)+'"></script>')
        
        for module, arr_js in self.js_local.items():
            for js in arr_js:
                final_js.append('<script language="Javascript" src="'+make_media_url_module('js/'+js, module)+'"></script>')
        
        self.js=[]
        self.js_local=OrderedDict()
        
        return "\n".join(final_js)
Exemple #4
0
    def css_home(self):
        
        final_css=[]
        
        for css in self.css:
            final_css.append('<link href="'+make_media_url('css/'+css)+'" rel="stylesheet" type="text/css"/>')
        
        for module, arr_css in self.css_local.items():
            
            for css in arr_css:
            
                final_css.append('<link href="'+make_media_url_module('css/'+css, module)+'" rel="stylesheet" type="text/css"/>')

        self.css=[]
        self.css_local=OrderedDict()

        return "\n".join(final_css)