style tweaks, hide reply buttons until click, don't include reply-context in unread post counts

This commit is contained in:
Kyle Mahan 2015-10-13 18:13:45 +00:00
parent 44b2d61a37
commit 5e334b8a05
6 changed files with 20 additions and 11 deletions

View file

@ -62,16 +62,17 @@ $(function(){
}
function attachListeners() {
$(".reply-form, .like-form").css('display', 'none');
$("#older-link").off('click').click(clickOlderLink);
$(".show-reply-form").off('click').click(clickShowReplyForm);
$(".show-like-form").off('click').click(clickShowLikeForm);
$(".micropub-form button[type='submit']").off('click').click(submitMicropubForm);
$(".micropub-form .content").focus(function (){
$(this).animate({ height: "4em" }, 200);
$(".reply-area").hide();
$("article").off('click').click(function(evt) {
var $target = $(evt.target);
if ($target.closest("form, a, video, audio").length == 0) {
$(".reply-area", this).slideToggle(200);
}
});
}
@ -84,7 +85,7 @@ $(function(){
function foldNewEntries(entries) {
$('#fold').prepend(entries.join('\n'));
attachListeners();
$('#unfold-link').text($('#fold').children().length + " New Posts");
$('#unfold-link').text($('#fold>article:not(.reply-context)').length + " New Posts");
$('#unfold-link').off('click').click(clickUnfoldLink);
$('#unfold-link').show();
}

View file

@ -527,6 +527,8 @@ button {
.reply-area {
text-align: center;
margin-top: 0.5em; }
.reply-area .content {
height: 4em; }
.reply-area .reply-link {
display: inline-block;
padding: 0.2em;

View file

@ -247,6 +247,10 @@ button {
text-align: center;
margin-top: 0.5em;
.content {
height: 4em;
}
.reply-link {
display: inline-block;
padding: 0.2em;

View file

@ -8,7 +8,7 @@
<link rel="shortcut icon" href="{{ url_for('static', filename='logo.png') }}"/>
<link rel="apple-touch-icon" href="{{ url_for('static', filename='logo.png') }}"/>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css', version='2015-07-21') }}"/>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css', version='2015-10-07') }}"/>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/>
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="{{ url_for('static', filename='moment.min.js') }}"></script>

View file

@ -4,7 +4,7 @@
{% if ws_topic %}
<script>var WS_TOPIC = "{{ ws_topic }}";</script>
{% endif %}
<script src="{{url_for('static', filename='feed.js', version='2015-07-13')}}"></script>
<script src="{{url_for('static', filename='feed.js', version='2015-10-08')}}"></script>
{% if current_user and current_user.settings
and current_user.settings.get('reply-method') == 'indie-config' %}

View file

@ -16,6 +16,7 @@ import re
import urllib
import cgi
import sqlalchemy
import sqlalchemy.sql.expression
IMAGE_TAG_RE = re.compile(r'<img([^>]*) src="(https?://[^">]+)"')
@ -70,7 +71,8 @@ def index():
entry_query = entry_query.filter(Subscription.id == subsc_id)
ws_topic = 'subsc:{}'.format(subsc.id)
elif 'jam' in flask.request.args:
entry_query = entry_query.filter(Entry.properties['jam'] == 'true')
entry_query = entry_query.filter(
sqlalchemy.sql.expression.cast(Entry.properties['jam'], sqlalchemy.TEXT) == 'true')
else:
ws_topic = 'user:{}'.format(flask_login.current_user.id)