def row(self, top): return [ top.name, top.number, Table.concat([ Table.link( url_for("move_default_top", defaulttop_id=top.id, diff=1, csrf_token=get_csrf_token()), "Runter"), Table.link( url_for("move_default_top", defaulttop_id=top.id, diff=-1, csrf_token=get_csrf_token()), "Hoch"), Table.link( url_for("edit_default_top", protocoltype_id=self.protocoltype.id, defaulttop_id=top.id), "Ändern"), Table.link( url_for("delete_default_top", defaulttop_id=top.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du den Standard-TOP " "{} löschen willst?".format(top.name)) ]) ]
def row(self, document): user = current_user() links = [] if document.protocol.has_modify_right(user): links.append( Table.link(url_for("edit_document", document_id=document.id), "Bearbeiten")) if config.PRINTING_ACTIVE and document.protocol.has_modify_right(user): links.append( Table.link( url_for("print_document", document_id=document.id, csrf_token=get_csrf_token()), "Drucken")) if document.protocol.protocoltype.has_admin_right(user): links.append( Table.link( url_for("delete_document", document_id=document.id, csrf_token=get_csrf_token()), "Löschen", confirm= "Bist du dir sicher, dass du das Dokument {} löschen " "willst?".format(document.name))) general_part = [ document.id, Table.link(url_for("download_document", document_id=document.id), document.name), ] visibility_part = [] if document.protocol.has_private_view_right(user): visibility_part = [ "Intern" if document.is_private else "Öffentlich" ] action_part = [Table.concat(links)] return general_part + visibility_part + action_part
def row(self): user = current_user() row = [ self.value.get_id(), self.value.get_state_plain(), Table.concat([ Table.link(url_for("show_protocol", protocol_id=protocol.id), protocol.get_short_identifier()) for protocol in self.value.protocols ]), self.value.who, self.value.description ] if self.value.protocoltype.has_modify_right(user): row.append( Table.concat([ Table.link(url_for("edit_todo", todo_id=self.value.id), "Ändern"), Table.link( url_for("delete_todo", todo_id=self.value.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du das Todo löschen " "willst?") ])) else: row.append("") return row
def row(self, todo): user = current_user() protocol = todo.get_first_protocol() mobile_parts = [Table.glyphicon(todo.get_state_glyph())] mobile_parts.append(todo.who) if protocol is not None: mobile_parts.append( Table.link(url_for("show_protocol", protocol_id=protocol.id), todo.protocoltype.short_name)) row = [ Markup("<br>").join(mobile_parts), Table.glyphicon(todo.get_state_glyph(), todo.get_state_plain()), todo.who, Table.link(url_for("show_todo", todo_id=todo.id), todo.description), Table.link(url_for("show_protocol", protocol_id=protocol.id), protocol.get_short_identifier()) if protocol is not None else Table.link( url_for("list_protocols", protocoltype_id=todo.protocoltype.id), todo.protocoltype.short_name), ] if todo.protocoltype.has_modify_right(user): buttons = [] buttons.append( Table.button(url_for("edit_todo", todo_id=todo.id, csrf_token=get_csrf_token()), icon="pencil", style="success")) buttons.append( Table.button(url_for("delete_todo", todo_id=todo.id, csrf_token=get_csrf_token()), icon="trash", style="danger")) row.append(Table.button_group(buttons)) else: row.append("") return row
def row(self, protocol): user = current_user() protocol_link = url_for("show_protocol", protocol_id=protocol.id) result = [ # Protocol (mobile) Table.concat_lines([ Table.link(protocol_link, protocol.protocoltype.name), date_filter(protocol.date) ]), # Protocol (standard) Table.link(protocol_link, protocol.protocoltype.name), date_filter(protocol.date) ] if self.search_results is None: result.append(Markup(time_filter(protocol.start_time))) # State (mobile) result.append(Table.glyphicon(protocol.get_state_glyph())) # State (standard) result.append( Table.glyphicon(protocol.get_state_glyph(), protocol.get_state_name())) elif protocol in self.search_results: result.append(Markup(self.search_results[protocol])) result.append(Table.glyphicon(protocol.get_state_glyph())) buttons = [] if protocol.has_public_view_right(user): user_right = protocol.has_private_view_right(user) document = protocol.get_compiled_document(user_right) if document is not None: buttons.append( Table.button(url_for("download_document", document_id=document.id), icon="download", style="success")) if protocol.protocoltype.has_admin_right(user): buttons.append( Table.button( url_for("delete_protocol", protocol_id=protocol.id, csrf_token=get_csrf_token()), icon="trash", style="danger", confirm="Bist du dir sicher, dass du das Protokoll {} " "löschen möchtest?")) result.append(Table.button_group(buttons)) return result
def row(self, todomail): return [ todomail.name, todomail.mail, Table.concat([ Table.link(url_for("edit_todomail", todomail_id=todomail.id), "Ändern"), Table.link(url_for("delete_todomail", todomail_id=todomail.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du die " "Todomailzuordnung {} zu {} löschen " "willst?".format(todomail.name, todomail.mail)) ]) ]
def row(self, error): return [ Table.link(url_for("show_protocol", protocol_id=error.protocol.id), error.protocol.get_short_identifier()), error.action, Table.link(url_for("show_error", error_id=error.id), error.name), datetime_filter(error.datetime), error.get_short_description(), Table.link( url_for("delete_error", error_id=error.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du den Fehler löschen " "möchtest?") ]
def row(self, category): general_part = [category.name] action_part = [ Table.concat([ Table.link( url_for("edit_decisioncategory", decisioncategory_id=category.id), "Ändern"), Table.link(url_for("delete_decisioncategory", decisioncategory_id=category.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du die " "Beschlusskategorie {} löschen " "willst?".format(category.name)) ]) ] return general_part + action_part
def row(self, meta): general_part = [ meta.name, meta.key, meta.value, Table.bool(meta.internal), Table.bool(meta.prior) ] links = [ Table.link(url_for("edit_defaultmeta", defaultmeta_id=meta.id), "Ändern"), Table.link( url_for("delete_defaultmeta", defaultmeta_id=meta.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du das Metadatenfeld {} " "löschen willst?".format(meta.name)) ] link_part = [Table.concat(links)] return general_part + link_part
def row(self, decision): user = current_user() content_part = [ Table.link( url_for("show_protocol", protocol_id=decision.protocol.id), decision.protocol.get_short_identifier()), decision.content ] category_part = [decision.get_categories_str()] if not self.category_present: category_part = [] action_part = [ Table.link( url_for("print_decision", decisiondocument_id=decision.document.id, csrf_token=get_csrf_token()), "Drucken") if (config.PRINTING_ACTIVE and decision.protocol.protocoltype.has_modify_right(user) and decision.document is not None) else "" ] return content_part + category_part + action_part
def row(self, reminder): general_part = [ "{} Tage".format(reminder.days_before), self.get_send_summary(reminder), reminder.additional_text or "" ] action_links = [ Table.link( url_for("edit_reminder", meetingreminder_id=reminder.id), "Ändern"), Table.link( url_for("delete_reminder", meetingreminder_id=reminder.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du die Einladungsmail {} " "Tage vor der Sitzung löschen willst?".format( reminder.days_before)) ] action_part = [Table.concat(action_links)] return general_part + action_part
def row(self): user = current_user() general_part = [ self.value.name, self.value.short_name, self.value.organization, self.value.usual_time.strftime("%H:%M") if self.value.usual_time is not None else "", Table.bool(self.value.is_public), self.value.publish_group, self.value.modify_group, self.value.private_group, self.value.public_group, ] etherpad_part = [Table.bool(self.value.non_reproducible_pad_links)] if not config.ETHERPAD_ACTIVE: etherpad_part = [] mail_part = [ self.value.private_mail, self.value.public_mail, ] if not config.MAIL_ACTIVE: mail_part = [] printing_part = [self.value.printer] if not config.PRINTING_ACTIVE: printing_part = [] wiki_part = [ (Table.bool(self.value.use_wiki) + ((", " + ("Öffentlich" if self.value.wiki_only_public else "Intern")) if self.value.use_wiki else "")) ] if self.value.use_wiki: wiki_part.append(self.value.wiki_category) if not config.WIKI_ACTIVE: wiki_part = [] calendar_part = [ self.value.calendar if self.value.calendar is not None else "" ] if not config.CALENDAR_ACTIVE: calendar_part = [] network_part = [Table.bool(self.value.restrict_networks)] if self.value.allowed_networks is not None: network_part.append(", ".join( map(str.strip, self.value.allowed_networks.split(",")))) else: network_part.append("") _latex_templates = getattr(config, "LATEX_TEMPLATES", None) if _latex_templates is not None: latex_template_part = [ _latex_templates[self.value.latex_template]['name'] if (self.value.latex_template is not None and self.value.latex_template != "") else "Standardvorlage" ] else: latex_template_part = [] feed_part = [] if self.value.has_public_anonymous_view_right(): feed_part = [ Markup(", ".join([ Table.link( url_for("feed_protocols_rss", protocoltype_id=self.value.id), "Protokolle (RSS)"), Table.link( url_for("feed_protocols_atom", protocoltype_id=self.value.id), "Protokolle (Atom)"), Table.link( url_for("feed_appointments_rss", protocoltype_id=self.value.id), "Sitzungen (RSS)"), Table.link( url_for("feed_appointments_atom", protocoltype_id=self.value.id), "Sitzungen (Atom)"), Table.link( url_for("feed_appointments_ical", protocoltype_id=self.value.id), "Sitzungen (iCal)"), ])) ] action_part = [ Table.link(url_for("delete_type", protocoltype_id=self.value.id, csrf_token=get_csrf_token()), "Löschen", confirm="Bist du dir sicher, dass du den Protokolltype " "{} löschen möchtest?".format(self.value.name)) ] if not self.value.has_admin_right(user): action_part = [""] return (general_part + etherpad_part + mail_part + printing_part + wiki_part + calendar_part + network_part + latex_template_part + feed_part + action_part)