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 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 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)
def tags_td(self, col_num, i, item): """Generate the column for the tags. """ tag_links = [] for tag in item.sorted_tags: tag_url = '%s/tags/%s' % (self.request.application_url, tag.name) tag_class = 'label' if self.selected_tag and tag.name == self.selected_tag: tag_class += ' label-warning' else: tag_class += ' label-info' anchor = HTML.tag("a", href=tag_url, c=tag.name, class_=tag_class) tag_links.append(anchor) return HTML.td(*tag_links, _nl=True)
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 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 tags_td(self, col_num, i, item): """Generate the column for the tags. """ tag_links = [] for tag in item.sorted_tags: tag_url = '%s/tags/%s' % (self.request.application_url, tag.name) tag_class = 'label' if self.selected_tag and tag.name == self.selected_tag: tag_class += ' label-warning' else: tag_class += ' label-info' anchor = HTML.tag("a", href=tag_url, c=tag.name, class_=tag_class) tag_links.append(anchor) return HTML.td(*tag_links, _nl=True)
def tags_td(self, col_num, i, item): """Generate the column for the tags. Apply special tag CSS for currently selected tag matched route '/tags/{tag_name}' """ tag_links = [] for tag in item.sorted_tags: tag_url = self.request.route_url('taglist', tag_name=tag.name) tag_class = 'label' if self.selected_tag and tag.name == self.selected_tag: tag_class += ' label-warning' else: tag_class += ' label-info' anchor = HTML.tag("a", href=tag_url, c=tag.name, class_=tag_class) tag_links.append(anchor) return HTML.td(*tag_links, _nl=True)
def tags_td(self, col_num, i, item): """Generate the column for the tags. Apply special tag CSS for currently selected tag matched route '/tags/{tag_name}' """ tag_links = [] for tag in item.sorted_tags: tag_url = self.request.route_url('taglist', tag_name=tag.name) tag_class = 'label' if self.selected_tag and tag.name == self.selected_tag: tag_class += ' label-warning' else: tag_class += ' label-info' anchor = HTML.tag("a", href=tag_url, c=tag.name, class_=tag_class) tag_links.append(anchor) return HTML.td(*tag_links, _nl=True)