Fix no date bug
This commit is contained in:
parent
aaaa4d4716
commit
e85a2fdda4
@ -26,6 +26,7 @@ def main():
|
||||
|
||||
def production():
|
||||
import config
|
||||
print('PRODUKTION')
|
||||
DB_HOST = os.environ.get('DB_HOST')
|
||||
DB_NAME = os.environ.get('POSTGRES_DB')
|
||||
DB_USER = os.environ.get('POSTGRES_USER')
|
||||
@ -46,6 +47,7 @@ def production():
|
||||
'lastchangeAt': note[5], 'permission': note[6], 'content': note[7]})
|
||||
return render_template('index.html', notes=notes_arr, host=config.CODI_URL)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
|
||||
@ -16,38 +16,40 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-light bg-light">
|
||||
<a class="navbar-brand" href="#">
|
||||
<h1>CodiMD notes</h1>
|
||||
</a>
|
||||
</nav>
|
||||
<nav class="navbar navbar-light bg-light">
|
||||
<a class="navbar-brand" href="#">
|
||||
<h1>CodiMD notes</h1>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<table id="example" class="table table-striped table-inverse table-bordered table-hover" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>title</th>
|
||||
<th>alias</th>
|
||||
<th>last change at</th>
|
||||
<th>permission</th>
|
||||
<th>content</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for note in notes %}
|
||||
<tr>
|
||||
<td scope="row"><a href="{{host}}/{{note['shortid']}}" target="_blank">{{note['shortid']}}</a></td>
|
||||
<td>{{note['title']}}</td>
|
||||
<td>{{note['alias']}}</td>
|
||||
<td><span class="note-date">{{note['lastchangeAt'].strftime('%d.%m.%Y %H:%M')}}</span></td>
|
||||
<td>{{note['permission']}}</td>
|
||||
<td>{%if note['content']%}💬{%else%}❌{%endif%}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="container">
|
||||
<table id="example" class="table table-striped table-inverse table-bordered table-hover" cellspacing="0"
|
||||
width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>title</th>
|
||||
<th>alias</th>
|
||||
<th>last change at</th>
|
||||
<th>permission</th>
|
||||
<th>content</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for note in notes %}
|
||||
<tr>
|
||||
<td scope="row"><a href="{{host}}/{{note['shortid']}}" target="_blank">{{note['shortid']}}</a></td>
|
||||
<td>{{note['title']}}</td>
|
||||
<td>{{note['alias']}}</td>
|
||||
<td><span class="note-date">{% if note['lastchangeAt'] %}{{note['lastchangeAt'].strftime('%d.%m.%Y %H:%M')}}{% endif %}</span>
|
||||
</td>
|
||||
<td>{{note['permission']}}</td>
|
||||
<td>{%if note['content']%}💬{%else%}❌{%endif%}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user