flask/examples/minitwit/minitwit/templates/timeline.html
Kyle Lawlor 5f009374fd Update minitwit & improve testing for examples (#1954)
* Update minitwit & improve testing for examples

* Related to #1945
* Re-works minitwit to be installed and run as:

    pip install --editable .
    export FLASK_APP=minitwit.minitwit
    export FLASK_DEBUG=1
    flask initdb
    flask run

* added flaskr and minitwit to norecursedirs
  * tests not properly run when using pytest standards
  * see: http://stackoverflow.com/questions/38313171/configuring-pytest-with-installable-examples-in-a-project
* Both flaskr and minitwit now follow pytest standards.
* Tests can for them as `py.test` or `python setup.py test`

* Update minitwit readme

* updates the instructions for running

* Fixes for updating the minitwit example

- This reverts the changes to the *docs/* (I will file separate PR).
- Running the app is now: `export FLASK_APP=minitwit` & `flask run`
  (After installing the app)

* Remove unnecessary comma from flaskr/setup.py
2016-08-22 20:52:54 +02:00

49 lines
1.7 KiB
HTML

{% extends "layout.html" %}
{% block title %}
{% if request.endpoint == 'public_timeline' %}
Public Timeline
{% elif request.endpoint == 'user_timeline' %}
{{ profile_user.username }}'s Timeline
{% else %}
My Timeline
{% endif %}
{% endblock %}
{% block body %}
<h2>{{ self.title() }}</h2>
{% if g.user %}
{% if request.endpoint == 'user_timeline' %}
<div class="followstatus">
{% if g.user.user_id == profile_user.user_id %}
This is you!
{% elif followed %}
You are currently following this user.
<a class="unfollow" href="{{ url_for('unfollow_user', username=profile_user.username)
}}">Unfollow user</a>.
{% else %}
You are not yet following this user.
<a class="follow" href="{{ url_for('follow_user', username=profile_user.username)
}}">Follow user</a>.
{% endif %}
</div>
{% elif request.endpoint == 'timeline' %}
<div class="twitbox">
<h3>What's on your mind {{ g.user.username }}?</h3>
<form action="{{ url_for('add_message') }}" method="post">
<p><input type="text" name="text" size="60"><!--
--><input type="submit" value="Share">
</form>
</div>
{% endif %}
{% endif %}
<ul class="messages">
{% for message in messages %}
<li><img src="{{ message.email|gravatar(size=48) }}"><p>
<strong><a href="{{ url_for('user_timeline', username=message.username)
}}">{{ message.username }}</a></strong>
{{ message.text }}
<small>&mdash; {{ message.pub_date|datetimeformat }}</small>
{% else %}
<li><em>There's no message so far.</em>
{% endfor %}
</ul>
{% endblock %}