From dcf9e424c47f376bdd99566baeaecd793f4a806c Mon Sep 17 00:00:00 2001 From: Matt Webb Date: Sun, 1 Mar 2015 13:29:46 +0000 Subject: [PATCH] prettifying overview page --- sirius/web/landing.py | 4 +- sirius/web/templates/overview.html | 141 +++++++++++++++-------------- 2 files changed, 76 insertions(+), 69 deletions(-) diff --git a/sirius/web/landing.py b/sirius/web/landing.py index ba5382b..af655cb 100644 --- a/sirius/web/landing.py +++ b/sirius/web/landing.py @@ -61,9 +61,9 @@ def overview(): 'overview.html', form=form, my_printers=my_printers, - signed_up_friends=signed_up_friends, + signed_up_friends=list(signed_up_friends), friends=friends, - friends_printers=friends_printers, + friends_printers=list(friends_printers), seconds_to_next_refresh=user.twitter_oauth.seconds_to_next_refresh(), last_friend_refresh=user.twitter_oauth.last_friend_refresh, ) diff --git a/sirius/web/templates/overview.html b/sirius/web/templates/overview.html index 6f35a07..0792ffa 100644 --- a/sirius/web/templates/overview.html +++ b/sirius/web/templates/overview.html @@ -3,79 +3,86 @@ {% block title %}Overview{% endblock %} {% block page_content %} -

My printers

-{% if not my_printers %} -
- No printers yet - - - claim one here - . -
-{% else %} -{% for printer in my_printers %} - -{% endfor %} - -
- - Claim another printer - -
+
+
-

Friends' printers

-
    -{% for x in friends_printers %} -
  • - {{ x.owner.username }} - {{ x.name }} +

    Printers

    + + {% if not my_printers and not friends_printers %} +

    None available

    + {% endif %} + +
      - (send message) - -{% else %} -
    • No printers yet.
    • -{% endfor %} -
    + {% for p in my_printers %} +
  • {{ p.name }} (owned by you) + Overview + Send message +
  • + {% endfor %} + + {% for p in friends_printers %} +
  • {{ p.name }} (owned by @{{ p.owner.username }}) + Send message +
  • + {% endfor %} -{% endif %} -

    People who can print on my printers

    -
      -{% for x in signed_up_friends %} -
    • {{ x.username }}
    • -{% else %} -
    • No one yet
    • -{% endfor %} -
    -

    - The above list is the {{ friends|length }} people you follow on Twitter who also have accounts here. -

    -

    - The list of people you folow was last refreshed on {{ last_friend_refresh }}. -

    -

    -

    +
+ +

+ + Claim a printer + +

+

+ (You need the claim code from a new or reset Little Printer to do this. Important: Your Berg Cloud Bridge must be configured to connect to alpha.littleprinter.com otherwise this won't work.) +

+ + +

Messaging permissions

+ +

Anybody you follow on Twitter can send a message to any of your printers. These are the {{ friends|length }} account(s) you follow who also have accounts here:

+ + {% if signed_up_friends %} +
    + {% for f in signed_up_friends %} +
  • @{{ f.username }}
  • + {% endfor %} +
+ {% else %} +

No-one yet

+ {% endif %} + + {{ form.csrf_token }} +

{% if seconds_to_next_refresh > 0 %} - + {% else %} - + {% endif %} +

+

+ (The list of people you follow on Twitter was last refreshed on {{ last_friend_refresh }}.) +

+ - -

+
+
{% endblock %} -- 2.47.3