From 122f0cd7420461af6f18083bebc6956ef4d0799f Mon Sep 17 00:00:00 2001 From: Eric Barbour Date: Aug 10 2016 19:35:20 +0000 Subject: Hide save button if notif has already been saved.. * Remove unused files * Remove unused code in python and JSX files --- diff --git a/hubs/app.py b/hubs/app.py index ec76fdb..3036b6e 100755 --- a/hubs/app.py +++ b/hubs/app.py @@ -6,7 +6,6 @@ import os import urlparse import uuid -import bleach import flask import flask.json import fmn.lib @@ -19,7 +18,6 @@ from flask.ext.oidc import OpenIDConnect import fmn.lib import hubs.models import hubs.widgets -from hubs.widgets import clean_input import datanommer.models @@ -610,6 +608,9 @@ def stream(name): actions.append(original) actions = apply_html(actions) + for action in actions: + if any(s['markup'] == action['markup'] for s in saved): + action['saved'] = True actions = json.dumps(actions, cls=hubs.widgets.feed.PythonObjectEncoder) return flask.render_template( diff --git a/hubs/static/client/app/components/Panel.jsx b/hubs/static/client/app/components/Panel.jsx index a30eab1..3bfd96a 100644 --- a/hubs/static/client/app/components/Panel.jsx +++ b/hubs/static/client/app/components/Panel.jsx @@ -1,5 +1,4 @@ - import React from 'react'; -import $ from 'jquery'; +import React from 'react'; import Icon from './Icon.jsx'; import Markup from './Markup.jsx'; diff --git a/hubs/static/client/app/index.jsx b/hubs/static/client/app/index.jsx index 3976b89..7641684 100644 --- a/hubs/static/client/app/index.jsx +++ b/hubs/static/client/app/index.jsx @@ -2,8 +2,4 @@ * since the feed component places itself on window. * The feed will not work without it. */ -import $ from 'jquery'; - import Feed from './components/Feed.jsx'; // eslint-disable-line - -window.$ = $; diff --git a/hubs/templates/_messages.html b/hubs/templates/_messages.html deleted file mode 100644 index 7f942d3..0000000 --- a/hubs/templates/_messages.html +++ /dev/null @@ -1,294 +0,0 @@ -
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
-
-
-
- - User avatar - -
-
-

- This is some markup -

-
-
-
diff --git a/hubs/widgets/feed.py b/hubs/widgets/feed.py index 3e6b586..8ea6536 100755 --- a/hubs/widgets/feed.py +++ b/hubs/widgets/feed.py @@ -1,29 +1,12 @@ from __future__ import print_function from hubs.hinting import hint -from hubs.widgets.base import argument, cache +from hubs.widgets.base import argument from hubs.widgets import templating -import fmn.lib -import fmn.lib.hinting - -import datanommer.models - -import arrow -import munch -import requests -import six - -import pygments.formatters - -import flask - import hubs.validators as validators -import datetime -import json import logging -import uuid log = logging.getLogger('hubs') @@ -32,6 +15,7 @@ chrome = panel('Live Feed') template = templating.environment.get_template('templates/feed.html') position = 'left' + @argument(name="username", default=None, validator=validators.username, @@ -44,15 +28,9 @@ def data(session, widget, username, message_limit): # Avoid circular import from hubs.app import app feed_url = app.config['SSE_URL'] + username - return dict( - matches=[], - message_limit=message_limit, - feed_url=feed_url - ) + return dict(matches=[], message_limit=message_limit, feed_url=feed_url) + @hint(ubiquitous=True) def should_invalidate(message, session, widget): pass - - -