minor styling changes
This commit is contained in:
parent
2e20ead09b
commit
9cfa2e4739
5 changed files with 97 additions and 53 deletions
|
@ -438,12 +438,16 @@ article {
|
||||||
label {
|
label {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 5px;
|
margin: 5px 0 2px 0;
|
||||||
max-width: 100%; }
|
max-width: 100%; }
|
||||||
|
|
||||||
textarea, input[type="text"], input[type="url"] {
|
textarea, input[type="text"], input[type="url"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0.25em 0; }
|
margin: 0.25em 0;
|
||||||
|
background-image: none;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0x 1px 1px rgba(0, 0, 0, 0.075) inset; }
|
||||||
textarea.input-25, input[type="text"].input-25, input[type="url"].input-25 {
|
textarea.input-25, input[type="text"].input-25, input[type="url"].input-25 {
|
||||||
width: 23%; }
|
width: 23%; }
|
||||||
textarea.input-50, input[type="text"].input-50, input[type="url"].input-50 {
|
textarea.input-50, input[type="text"].input-50, input[type="url"].input-50 {
|
||||||
|
@ -451,6 +455,20 @@ textarea, input[type="text"], input[type="url"] {
|
||||||
textarea.input-75, input[type="text"].input-75, input[type="url"].input-75 {
|
textarea.input-75, input[type="text"].input-75, input[type="url"].input-75 {
|
||||||
width: 73%; }
|
width: 73%; }
|
||||||
|
|
||||||
|
button {
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
background: #efefef;
|
||||||
|
color: #003366;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 4px 10px;
|
||||||
|
margin: 5px 5px 5px 0;
|
||||||
|
box-shadow: 0 1px 1px #ccc; }
|
||||||
|
button:hover {
|
||||||
|
background: white; }
|
||||||
|
button:active {
|
||||||
|
box-shadow: 0 0;
|
||||||
|
margin: 6px 4px 4px 1px; }
|
||||||
|
|
||||||
.micropub-form .content {
|
.micropub-form .content {
|
||||||
height: 1em;
|
height: 1em;
|
||||||
width: calc(100% - 1.4em - 96px);
|
width: calc(100% - 1.4em - 96px);
|
||||||
|
|
|
@ -127,7 +127,7 @@ article {
|
||||||
label {
|
label {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 5px;
|
margin: 5px 0 2px 0;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,11 @@ textarea, input[type="text"], input[type="url"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0.25em 0;
|
margin: 0.25em 0;
|
||||||
|
|
||||||
|
background-image: none;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0x 1px 1px rgba(0, 0, 0, 0.075) inset;
|
||||||
|
|
||||||
&.input-25 {
|
&.input-25 {
|
||||||
width: 23%;
|
width: 23%;
|
||||||
}
|
}
|
||||||
|
@ -146,6 +151,24 @@ textarea, input[type="text"], input[type="url"] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
border: 1px solid rgb(204, 204, 204);
|
||||||
|
background: #efefef;
|
||||||
|
color: #003366;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 4px 10px;
|
||||||
|
margin: 5px 5px 5px 0;
|
||||||
|
box-shadow: 0 1px 1px #ccc;
|
||||||
|
&:hover {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
box-shadow: 0 0;
|
||||||
|
margin: 6px 4px 4px 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.micropub-form {
|
.micropub-form {
|
||||||
.content {
|
.content {
|
||||||
height: 1em;
|
height: 1em;
|
||||||
|
|
|
@ -235,20 +235,19 @@ def notify_feed_updated(session, feed, entries):
|
||||||
reverse=True)
|
reverse=True)
|
||||||
|
|
||||||
for s in feed.subscriptions:
|
for s in feed.subscriptions:
|
||||||
for user in s.users:
|
with flask_app.test_request_context():
|
||||||
with flask_app.test_request_context():
|
flask_login.login_user(s.user, remember=True)
|
||||||
flask_login.login_user(user, remember=True)
|
message = json.dumps({
|
||||||
message = json.dumps({
|
'user': s.user.id,
|
||||||
'user': user.id,
|
'feed': feed.id,
|
||||||
'feed': feed.id,
|
'entries': [
|
||||||
'entries': [
|
render_template('_entry.jinja2', feed=feed, entry=e)
|
||||||
render_template('_entry.jinja2', feed=feed, entry=e)
|
for e in entries
|
||||||
for e in entries
|
],
|
||||||
],
|
})
|
||||||
})
|
for topic in ('user:{}'.format(s.user.id),
|
||||||
for topic in ('user={}'.format(user.id),
|
'subsc:{}'.format(s.id)):
|
||||||
'user={}&feed={}'.format(user.id, feed.id)):
|
redis.publish('woodwind_notify:{}'.format(topic), message)
|
||||||
redis.publish('woodwind_notify:{}'.format(topic), message)
|
|
||||||
|
|
||||||
|
|
||||||
def is_content_equal(e1, e2):
|
def is_content_equal(e1, e2):
|
||||||
|
|
|
@ -20,33 +20,25 @@
|
||||||
|
|
||||||
{% for s in subscriptions %}
|
{% for s in subscriptions %}
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
|
<form class="edit-subscription" action="{{ url_for('.edit_subscription') }}" method="POST">
|
||||||
|
<input type="hidden" name="id" value="{{ s.id }}"/>
|
||||||
|
<label>Name</label>
|
||||||
|
<input type="text" name="name" value="{{ s.name }}"/>
|
||||||
|
<label>Tags</label>
|
||||||
|
<input type="text" name="tags" value="{{ (s.tags or []) | join(',') }}"/>
|
||||||
|
<label>URL</label>
|
||||||
|
<input type="text" name="feed" value="{{ s.feed.feed }}" disabled />
|
||||||
|
<button type="submit">Save Edits</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="{{ url_for('.index', subscription=s.id) }}">View only posts from this feed</a>
|
<a target="_blank" href="{{ url_for('.index', subscription=s.id) }}">View Posts</a>
|
||||||
|
<br/>
|
||||||
|
<a class="show-details" data-target="details-{{loop.index}}" href="#">Show Details</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="{{ url_for('.edit_subscription') }}" method="POST">
|
|
||||||
<input type="hidden" name="id" value="{{ s.id }}"/>
|
|
||||||
<label>Name</label>
|
|
||||||
<input type="text" name="name" value="{{ s.name }}"/>
|
|
||||||
<label>URL</label>
|
|
||||||
<input type="text" name="feed" value="{{ s.feed.feed }}" editable="false" />
|
|
||||||
<button type="submit">Save Edits</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<form action="{{ url_for('.update_feed') }}" method="POST">
|
|
||||||
<input type="hidden" name="id" value="{{ s.feed.id }}"/>
|
|
||||||
<button type="submit">Poll Now</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<form action="{{ url_for('.unsubscribe') }}" method="POST">
|
|
||||||
<input type="hidden" name="id" value="{{ s.id }}"/>
|
|
||||||
<button type="submit">Unsubscribe</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
<a class="show-details" data-target="details-{{loop.index}}" href="#">Show Details</a>
|
|
||||||
|
|
||||||
<div class="feed-details" id="details-{{loop.index}}">
|
<div class="feed-details" id="details-{{loop.index}}">
|
||||||
<strong>Details</strong>
|
<strong>Details</strong>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -59,24 +51,37 @@
|
||||||
<li>PuSH expiry: {{s.feed.push_expiry | relative_time}}</li>
|
<li>PuSH expiry: {{s.feed.push_expiry | relative_time}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<form action="{{ url_for('.update_feed') }}" method="POST" style="display:inline">
|
||||||
|
<input type="hidden" name="id" value="{{ s.feed.id }}"/>
|
||||||
|
<button type="submit">Poll Now</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="{{ url_for('.unsubscribe') }}" method="POST" style="display:inline">
|
||||||
|
<input type="hidden" name="id" value="{{ s.id }}"/>
|
||||||
|
<button type="submit">Unsubscribe</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
{% block foot %}
|
{% block foot %}
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$(".feed-details").css({display: "none"});
|
$(".feed-details").css({display: "none"});
|
||||||
|
|
||||||
$(".show-details").click(function(evt) {
|
$(".show-details").click(function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
var target = $(this).data("target");
|
var target = $(this).data("target");
|
||||||
$("#" + target).css({display: "inherit"});
|
$("#" + target).css({display: "inherit"});
|
||||||
$(this).css({display: "none"});
|
$(this).css({display: "none"});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock foot %}
|
{% endblock foot %}
|
||||||
|
|
|
@ -53,10 +53,9 @@ def index():
|
||||||
if not subsc:
|
if not subsc:
|
||||||
flask.abort(404)
|
flask.abort(404)
|
||||||
entry_query = entry_query.filter(Subscription.id == subsc_id)
|
entry_query = entry_query.filter(Subscription.id == subsc_id)
|
||||||
ws_topic = 'user={}&feed={}'.format(subsc.user.id,
|
ws_topic = 'subsc:{}'.format(subsc.id)
|
||||||
subsc.feed.id)
|
|
||||||
else:
|
else:
|
||||||
ws_topic = 'user={}'.format(flask_login.current_user.id)
|
ws_topic = 'user:{}'.format(flask_login.current_user.id)
|
||||||
|
|
||||||
entries = entry_query.order_by(Entry.retrieved.desc(),
|
entries = entry_query.order_by(Entry.retrieved.desc(),
|
||||||
Entry.published.desc())\
|
Entry.published.desc())\
|
||||||
|
@ -130,9 +129,9 @@ def update_all():
|
||||||
def unsubscribe():
|
def unsubscribe():
|
||||||
subsc_id = flask.request.form.get('id')
|
subsc_id = flask.request.form.get('id')
|
||||||
subsc = Subscription.query.get(subsc_id)
|
subsc = Subscription.query.get(subsc_id)
|
||||||
subsc.delete()
|
db.session.delete(subsc)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
flask.flash('Unsubscribed {} ({})'.format(subsc.name))
|
flask.flash('Unsubscribed {}'.format(subsc.name))
|
||||||
return flask.redirect(flask.url_for('.subscriptions'))
|
return flask.redirect(flask.url_for('.subscriptions'))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue