diasporadiaries

a platform for writing stories with personal accounts and messages
git clone git://parazyd.org/diasporadiaries.git
Log | Files | Refs | Submodules | README | LICENSE

commit 951fff7d88d7eb176a27c7daeb1b1a7efd3e3d4e
parent 87c03052619394e4a69e07e0e934752792339e44
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 23 Jan 2019 11:49:12 +0100

List countries on /following.

Diffstat:
Mdiaspora.py | 8++++++--
Mtemplates/following.html | 5+++++
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/diaspora.py b/diaspora.py @@ -372,12 +372,16 @@ def following(): Route for listing the users a user is following. """ fol = [] + cnt = [] for i in get_following(current_user.username): j = find_user_by_email(i) if j: - fol .append((j['id'], j['name'])) + countries = sql_select_col_where('disembark', 'email', j['email']) + for i in countries: + cnt.append((i[0], getcountryname(i[0]))) + fol.append((j['id'], j['name'])) - return render_template('following.html', following=fol) + return render_template('following.html', following=fol, countries=cnt) @app.route('/dashboard') diff --git a/templates/following.html b/templates/following.html @@ -21,6 +21,11 @@ <h2><a href="/profile?id={{ i[0]}}">{{ i[1] }}</a></h2> </div> <div class="col"> + {% for i in countries %} + <img style="height: 2em;" src="/static/img/flags/{{ i[0] }}.png" alt="{{ i[1] }}" title="{{ i[1] }}"> + {% endfor %} + </div> + <div class="col"> <input type="submit" class="btn btn-primary" value="Following" title="Click to unfollow"> </form> </div>