-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
40 lines (39 loc) · 1.36 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{% extends "base.html" %}
{% block title %}Blog{% endblock %}
{% block content %}
{% if current_user.is_authenticated %}
<nav style="background-color: #0B4C5F">
<div class="nav-wrapper">
<ul id="nav-mobile" class="left hide-on-med-and-down">
<li><a href="{{ url_for('auth.logout') }}" class="waves-effect waves-light btn">Logout</a></li>
<li> <a href="{{ url_for('new') }}" class="waves-effect waves-light btn">New Post</a> </li>
</ul>
</div>
</nav>
{% endif %}
{% if posts %}
<div class="row">
{% for post in posts %}
<div class="col s12 m6">
<div class="card hoverable post" onclick="window.location='{{ url_for('detail', post_id=post.id) }}'"
style="cursor: pointer">
<div class="card-image">
<!--
<img src="https://materializecss.com/images/sample-1.jpg">
-->
<img src="{{ post.file_url if post.file_url else url_for('static', filename='images/feather.png') }}">
<!-- <p class="truncate body">{{ post.body | striptags }}</p> -->
</div>
<div class="card-content">
<span class="card-title title">{{ post.title }}</span>
<p class="date grey-text">{{ post.date() }}</p>
<!-- <a href="{{ url_for('detail', post_id=post.id) }}">Read</a> -->
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<h3>No posts.</h3>
{% endif %}
{% endblock %}