| |
@@ -43,6 +43,30 @@
|
| |
<div class="media-body">
|
| |
<h4 class="media-heading">{{match['markup']}}</h4>
|
| |
{{match['human_time']}}
|
| |
+ {% if match['msg_ids'] | length > 1 %}
|
| |
+ <div class="pull-right">
|
| |
+ <a id="expand-{{match['dom_id']}}" href="javascript:expand_feed_entries('{{match['dom_id']}}');">
|
| |
+ <span class="glyphicon glyphicon-chevron-down"></span>
|
| |
+ expand
|
| |
+ </a>
|
| |
+ <a id="collapse-{{match['dom_id']}}" href="javascript:collapse_feed_entries('{{match['dom_id']}}');" class="hidden">
|
| |
+ <span class="glyphicon glyphicon-chevron-up"></span>
|
| |
+ collapse
|
| |
+ </a>
|
| |
+ </div>
|
| |
+ <ul id="content-{{match['dom_id']}}" class="hidden list-unstyled">
|
| |
+ {% for idx, constituent in match['msg_ids'].items() %}
|
| |
+ <li>
|
| |
+ {{ constituent['markup'] }}
|
| |
+ {% if constituent['link'] %}
|
| |
+ <a href="{{constituent['link']}}" target="_blank">
|
| |
+ <span class="glyphicon glyphicon-new-window"></span>
|
| |
+ </a>
|
| |
+ {% endif %}
|
| |
+ </li>
|
| |
+ {% endfor %}
|
| |
+ </ul>
|
| |
+ {% endif %}
|
| |
</div>
|
| |
</div>
|
| |
</div>
|
| |
@@ -54,6 +78,28 @@
|
| |
#from hubs.widgets.chrome import panel
|
| |
#chrome = panel()
|
| |
|
| |
+ def apply_markup(match):
|
| |
+ markup = match['subtitle']
|
| |
+ for username in match['usernames']:
|
| |
+ args = (username, '<a href="{url}">@{username}</a>'.format(
|
| |
+ url=flask.url_for('hub', name=username),
|
| |
+ username=username,
|
| |
+ ))
|
| |
+ markup = markup.replace(*args)
|
| |
+ # TODO -- have to add these to conglomerate first
|
| |
+ #match['long_form'] = match['long_form'].replace(*args)
|
| |
+
|
| |
+ for package in match['packages']:
|
| |
+ args = (package, '<a href="{url}">{package}</a>'.format(
|
| |
+ url='https://apps.fedoraproject.org/packages/' + package,
|
| |
+ package=package,
|
| |
+ ))
|
| |
+ markup = markup.replace(*args)
|
| |
+ # TODO -- have to add these to conglomerate first
|
| |
+ #match['long_form'] = match['long_form'].replace(*args)
|
| |
+
|
| |
+ return markup
|
| |
+
|
| |
|
| |
@argument(name="username",
|
| |
default=None,
|
| |
@@ -67,7 +113,6 @@
|
| |
openid = '%s.id.fedoraproject.org' % username
|
| |
url = '/'.join([fmn_url, 'api', openid, fmn_context])
|
| |
log.info("Getting FMN preferences from %s" % url)
|
| |
- print(url)
|
| |
response = requests.get(url)
|
| |
messages = []
|
| |
matches = []
|
| |
@@ -113,25 +158,9 @@
|
| |
|
| |
# Apply some html markup to the subtitles for extra fanciness.
|
| |
for match in matches:
|
| |
- match['markup'] = match['subtitle']
|
| |
- for username in match['usernames']:
|
| |
- args = (username, '<a href="{url}">@{username}</a>'.format(
|
| |
- url=flask.url_for('hub', name=username),
|
| |
- username=username,
|
| |
- ))
|
| |
- match['markup'] = match['markup'].replace(*args)
|
| |
- # TODO -- have to add these to conglomerate first
|
| |
- #match['long_form'] = match['long_form'].replace(*args)
|
| |
-
|
| |
- for package in match['packages']:
|
| |
- args = (package, '<a href="{url}">{package}</a>'.format(
|
| |
- url='https://apps.fedoraproject.org/packages/' + package,
|
| |
- package=package,
|
| |
- ))
|
| |
- match['markup'] = match['markup'].replace(*args)
|
| |
- # TODO -- have to add these to conglomerate first
|
| |
- #match['long_form'] = match['long_form'].replace(*args)
|
| |
-
|
| |
+ match['markup'] = apply_markup(match)
|
| |
+ for idx, constituent in match['msg_ids'].items():
|
| |
+ constituent['markup'] = apply_markup(constituent)
|
| |
|
| |
return dict(
|
| |
matches=matches,
|
| |