Example #1
0
 def due_date_td(self, col_num, i, item):
     """Generate the column for the due date.
     """
     if item.due_date is None:
         return HTML.td('')
     span_class = 'due-date badge'
     if item.past_due:
         span_class += ' badge-important'
     due_date = localize_datetime(item.due_date, self.user_tz)
     span = HTML.tag(
         "span",
         c=HTML.literal(due_date.strftime('%Y-%m-%d %H:%M:%S')),
         class_=span_class,
     )
     return HTML.td(span)
Example #2
0
 def action_td(self, col_num, i, item):
     """Generate the column that has the actions in it.
     """
     return HTML.td(HTML.literal("""\
     <div class="btn-group">
       <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
       Action
       <span class="caret"></span>
       </a>
       <ul class="dropdown-menu" id="%s">
         <li><a class="todo-edit" href="#">Edit</a></li>
         <li><a class="todo-complete" href="#">Complete</a></li>
       </ul>
     </div>
     """ % item.id))
Example #3
0
 def due_date_td(self, col_num, i, item):
     """Generate the column for the due date.
     """
     if item.due_date is None:
         return HTML.td('')
     span_class = 'due-date badge'
     if item.past_due:
         span_class += ' badge-important'
     due_date = localize_datetime(item.due_date, self.user_tz)
     span = HTML.tag(
         "span",
         c=HTML.literal(due_date.strftime('%Y-%m-%d %H:%M:%S')),
         class_=span_class,
     )
     return HTML.td(span)
 def action_td(self, col_num, i, item):
     """Generate the column that has the actions in it.
     """
     return HTML.td(
         HTML.literal("""\
     <div class="btn-group">
       <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
       Action
       <span class="caret"></span>
       </a>
       <ul class="dropdown-menu" id="%s">
         <li><a class="todo-edit" href="#">Edit</a></li>
         <li><a class="todo-complete" href="#">Complete</a></li>
       </ul>
     </div>
     """ % item.id))
 def due_date_td(self, col_num, i, item):
     """Generate the column for the due date.
     
     Time-Zone Localization is done in the model
     """
     if item.due_date is None:
         return HTML.td('')
     span_class = 'due-date badge'
     if item.past_due:
         span_class += ' badge-important'
     due_date = item.due_date
     span = HTML.tag(
         "span",
         c=HTML.literal(due_date.strftime('%Y-%m-%d %H:%M:%S')),
         class_=span_class,
     )
     return HTML.td(span)
 def due_date_td(self, col_num, i, item):
     """Generate the column for the due date.
     
     Time-Zone Localization is done in the model
     """
     if item.due_date is None:
         return HTML.td('')
     span_class = 'due-date badge'
     if item.past_due:
         span_class += ' badge-important'
     due_date = item.due_date 
     span = HTML.tag(
         "span",
         c=HTML.literal(due_date.strftime('%Y-%m-%d %H:%M:%S')),
         class_=span_class,
     )
     return HTML.td(span)
Example #7
0
def build_paging(pages, current_page, url):
    """
    Строит пейджинг исходя из параметров
    """
    START = (current_page - (5 - abs(current_page - 5))) + 1 if current_page < 5 else current_page - 4
    END = START + 10 if (START + 10) < pages else pages
    res = ""
    if current_page > abs(START - 6):
        res += u"<a href='/%s'>Первая</a>&nbsp;" % (url)
    for page in xrange(START, END):
        if page == current_page + 1:
            res += u"<a href='/%s/%s' style='color:red;'>%s&nbsp;</a>" % (url, page, page)
        else:
            res += u"<a href='/%s/%s'>%s&nbsp;</a>" % (url, page, page)
    if pages - current_page > 6:
            res += u"&nbsp;<a href='/%s/%s'>Последняя</a>" % (url, pages - 1)
    return HTML.literal(res)