From b45fe2b18e9a7c5c4f3af2fcaa5e3c1d37c4eb5c Mon Sep 17 00:00:00 2001 From: Eric Barbour Date: Jul 18 2016 16:17:49 +0000 Subject: [PATCH 1/2] Basic ellipsizing of group owners * Sort top owners by oldest * Modal shows all owners alphabetically --- diff --git a/hubs/widgets/rules.py b/hubs/widgets/rules.py index edf141a..443f07c 100755 --- a/hubs/widgets/rules.py +++ b/hubs/widgets/rules.py @@ -7,6 +7,7 @@ from hubs.widgets import templating from hubs.utils import username2avatar from hubs import validators +ELLIPSIS_LIMIT = 5 chrome = panel() template = templating.environment.get_template('templates/rules.html') position = 'both' @@ -26,10 +27,17 @@ position = 'both' help="Link to meeting minutes from past meetings..") def data(session, widget, link, schedule_text, schedule_link, minutes_link): owners = widget.hub.owners + oldest_owners = sorted(owners, key=lambda o: o.created_on)[:ELLIPSIS_LIMIT] + oldest_owners = [{ + 'username': o.username, + 'avatar': username2avatar(o.username) + } for o in oldest_owners] + owners = ordereddict([ (o.username, username2avatar(o.username)) for o in owners ]) - return dict(owners=owners, link=link, + return dict(oldest_owners=oldest_owners, + owners=owners, link=link, schedule_text=schedule_text, schedule_link=schedule_link, minutes_link=minutes_link) diff --git a/hubs/widgets/templates/rules.html b/hubs/widgets/templates/rules.html index 2d986d1..20f86a6 100644 --- a/hubs/widgets/templates/rules.html +++ b/hubs/widgets/templates/rules.html @@ -5,12 +5,23 @@ {% endif %}
group owners
- {% for owner in owners %} + {% if owners|length > 5%} + {% for owner in oldest_owners %} - {% endfor %} + {% endfor %} +
+ View All + {% else %} + {% for owner in owners %} +
+ + {{owner}} +
+ {% endfor %} + {% endif %}
{% if schedule_text or schedule_link or minutes_link %}
meetings
@@ -30,6 +41,30 @@

{% endif %} + + + + + From 337b739939bca835d810b3ffffbd46587f695bfe Mon Sep 17 00:00:00 2001 From: Eric Barbour Date: Jul 19 2016 16:10:43 +0000 Subject: [PATCH 2/2] Global rule for avatar size * Global rule for avatar size * Additional rule for large avatars --- diff --git a/hubs/static/css/style.css b/hubs/static/css/style.css index c39f680..2e0f42d 100644 --- a/hubs/static/css/style.css +++ b/hubs/static/css/style.css @@ -368,3 +368,8 @@ font-size: 32pt; .edit_widget { cursor: pointer; } + +.img-circle { + height: 2em; + width: 2em; +} diff --git a/hubs/widgets/templates/rules.html b/hubs/widgets/templates/rules.html index 20f86a6..9ab51e8 100644 --- a/hubs/widgets/templates/rules.html +++ b/hubs/widgets/templates/rules.html @@ -3,12 +3,12 @@
community rules

Community Rules and Guidelines {% endif %} -

group owners
+
group owners ({{ owners|length }})
{% if owners|length > 5%} {% for owner in oldest_owners %} {% endfor %} @@ -17,7 +17,7 @@ {% else %} {% for owner in owners %}
- + {{owner}}
{% endfor %} @@ -50,10 +50,10 @@ -