Commit 29f9b254 authored by marco's avatar marco
Browse files

UI fix and improve /protocol/list

/close 156
parent 66ead555
...@@ -31,11 +31,9 @@ class Table: ...@@ -31,11 +31,9 @@ class Table:
if confirm: if confirm:
confirmation = " onclick=\"return confirm('{}');\"".format(confirm) confirmation = " onclick=\"return confirm('{}');\"".format(confirm)
return Markup( return Markup(
'''<div class="btn-group btn-group-xs"> '''<a href="{target}" class="btn btn-{style}" {confirmation}>
<a href="{target}" class="btn btn-{style}" {confirmation}>
<span class="glyphicon glyphicon-{icon}"></span> <span class="glyphicon glyphicon-{icon}"></span>
</a> </a>'''.format(target=target, style=style, confirmation=confirmation, icon=icon))
</div>'''.format(target=target, style=style, confirmation=confirmation, icon=icon))
@staticmethod @staticmethod
def mail(target): def mail(target):
...@@ -72,24 +70,19 @@ class ProtocolsTable(Table): ...@@ -72,24 +70,19 @@ class ProtocolsTable(Table):
def headers(self): def headers(self):
user = current_user() user = current_user()
result = ["Sitzung", "Sitzung", "Datum"] result = ["Sitzung", "Sitzung", "Datum"]
state_part = ["Status"] state_part = ["Status", "Status",""]
search_part = ["Suchergebnis"] search_part = ["Suchergebnis",""]
login_part = [""]
if self.search_results is None: if self.search_results is None:
result.extend(state_part) result.extend(state_part)
else: else:
result.extend(search_part) result.extend(search_part)
if check_login():
result.extend(login_part)
return result return result
def classes(self): def classes(self):
state_or_search_class = "hidden-xs" if self.search_results is None else None if self.search_results is None:
result = ["hidden-sm hidden-md hidden-lg", "hidden-xs", "hidden-xs", None] result = ["hidden-sm hidden-md hidden-lg", "hidden-xs", "hidden-xs", "hidden-sm hidden-md hidden-lg", "hidden-xs", ""]
#result.append(state_or_search_class) else:
login_part = ["hidden-xs"] result = ["hidden-sm hidden-md hidden-lg", "hidden-xs", "hidden-xs", "", "hidden-xs","hidden-xs"]
if check_login():
result.extend(login_part)
return result return result
def row(self, protocol): def row(self, protocol):
...@@ -101,23 +94,21 @@ class ProtocolsTable(Table): ...@@ -101,23 +94,21 @@ class ProtocolsTable(Table):
date_filter(protocol.date), date_filter(protocol.date),
] ]
if self.search_results is None: if self.search_results is None:
state = "pencil" #"Geplant" result.append(Markup('<span class="glyphicon glyphicon-{state}"></span>'.format(state=protocol.get_state_glyph())))
if protocol.is_done(): result.append(Markup('<span class="glyphicon glyphicon-{glyph}"></span> {state}'.format(state=protocol.get_state_name(),glyph=protocol.get_state_glyph())))
state = "unchecked" #"Fertig"
if protocol.public:
state = "check" #"Veröffentlicht"
result.append(Markup('<span class="glyphicon glyphicon-{state}">'.format(state=state)))
elif protocol in self.search_results: elif protocol in self.search_results:
result.append(Markup(self.search_results[protocol])) result.append(Markup(self.search_results[protocol]))
result.append(Markup('<span class="glyphicon glyphicon-{state}"></span>'.format(state=protocol.get_state_glyph())))
login_part1="" login_part1=""
login_part2="" login_part2=""
if state != "pencil": if protocol.has_public_view_right(user):
document = protocol.get_compiled_document() user_right = protocol.has_private_view_right(user)
document = protocol.get_compiled_document(user_right)
if document is not None: if document is not None:
login_part1 = Table.button( login_part1 = Table.button(
url_for("download_document", document_id=document.id), url_for("download_document", document_id=document.id),
icon="download", style="") icon="download", style="success")
if protocol.protocoltype.has_admin_right(user): if protocol.protocoltype.has_admin_right(user):
login_part2 = Table.button( login_part2 = Table.button(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment