diff --git a/css/stylesheet.css b/css/stylesheet.css index 18039f3..71b7593 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -118,7 +118,8 @@ label, #action > a, #action-bar > a, -#number-of-pages > a { +#number-of-pages > a, +#number-of-pages .inactive { display: inline-block; font-size: 1.2em; min-width: 90px; @@ -178,7 +179,8 @@ label, #action-bar > a, #download, #input, -#number-of-pages > a { +#number-of-pages > a, +#number-of-pages .inactive { color: #f5f5f5; font-weight: bold; padding-left: 2em; @@ -187,6 +189,10 @@ label, text-transform: uppercase; } +#number-of-pages .inactive { + background: #7a7a7a; +} + #download { background: #d9541e; /* #e96d1f */ } diff --git a/fasi.py b/fasi.py index 568f4f5..e4136c5 100644 --- a/fasi.py +++ b/fasi.py @@ -186,6 +186,7 @@ class HttpInstance: # Group chat messages action = 'Join' messages = [] + # TODO Create configurations for group chat preview room_info_muc = await XmppXep0045.get_room_information(xmpp_instance, jid_bare, alias, maxstanzas=50) messages = room_info_muc['iq'][3] messages.reverse() @@ -196,9 +197,11 @@ class HttpInstance: page_number = int(page_number) ix = (page_number -1) * 10 except: - ix = page_number = 0 + ix = 0 + page_number = 1 else: - ix = page_number = 0 + ix = 0 + page_number = 1 messages_10 = messages[ix:][:10] number_of_pages = int(len(messages) / 10) if number_of_pages < len(messages) / 10: number_of_pages += 1 @@ -293,6 +296,7 @@ class HttpInstance: 'previous' : previous, 'request' : request, 'subject' : subject, + 'title' : jid_detail['name'], 'url' : request.url._url, 'xmpp_uri' : xmpp_uri} response = templates.TemplateResponse(template_file, template_dict) @@ -438,9 +442,11 @@ class HttpInstance: page_number = int(page_number) ix = (page_number -1) * 10 except: - ix = page_number = 0 + ix = 0 + page_number = 1 else: - ix = page_number = 0 + ix = 0 + page_number = 1 item_ids_10 = item_ids[ix:][:10] node_items = await XmppXep0060.get_node_items(xmpp_instance, jid_bare, node_name, item_ids=item_ids_10) number_of_pages = int(len(item_ids) / 10) @@ -468,7 +474,7 @@ class HttpInstance: for item in node_items['pubsub']['items']: item_payload = item['payload'] entry = Syndication.extract_items(item_payload) - entry['id'] = item['id'] + if entry: entry['id'] = item['id'] entries.append(entry) #if len(entries) > 10: break if entries: entries.reverse() @@ -542,6 +548,7 @@ class HttpInstance: 'page_number' : page_number, 'previous' : previous, 'request' : request, + 'title' : node_title, 'url' : request.url._url, 'xmpp_uri' : xmpp_uri} response = templates.TemplateResponse(template_file, template_dict) diff --git a/xhtml/conference.xhtml b/xhtml/conference.xhtml index a22a14c..739ae67 100644 --- a/xhtml/conference.xhtml +++ b/xhtml/conference.xhtml @@ -49,7 +49,7 @@

{% if jid_title %}{{jid_title}}{% else %}Group Chat{% endif %}

-

{% if jid_title %}{{jid_title}}{% else %}{{jid_bare}}{% endif %}

+

{% if jid_note %}{{jid_note}}{% else %}{{jid_bare}}{% endif %}

@@ -90,15 +90,21 @@ {% if number_of_pages %}
{% if number_of_pages > 5 %} - First - {{page_number-1}} - {% if number_of_pages > page_number %} - {{page_number}} + {% if page_number < 2 %} + First + Back + {% else %} + First + Back {% endif %} - {% if number_of_pages > page_number+1 %} - {{page_number+1}} + {{page_number}} + {% if page_number == number_of_pages %} + Proceed + Last + {% else %} + Proceed + Last {% endif %} - Last {% else %} {% for number in range(number_of_pages) %} {{number+1}} diff --git a/xhtml/node.xhtml b/xhtml/node.xhtml index dadd852..802ce48 100644 --- a/xhtml/node.xhtml +++ b/xhtml/node.xhtml @@ -97,15 +97,21 @@ {% if number_of_pages %}
{% if number_of_pages > 5 %} - First - {{page_number-1}} - {% if number_of_pages > page_number %} - {{page_number}} + {% if page_number < 2 %} + First + Back + {% else %} + First + Back {% endif %} - {% if number_of_pages > page_number+1 %} - {{page_number+1}} + {{page_number}} + {% if page_number == number_of_pages %} + Proceed + Last + {% else %} + Proceed + Last {% endif %} - Last {% else %} {% for number in range(number_of_pages) %} {{number+1}}