remove default styles, make new.html bulma styled, first rough version of stream

This commit is contained in:
Inhji 2019-12-07 20:48:44 +01:00
parent 07e39866df
commit 1cab097cd1
5 changed files with 519 additions and 414 deletions

View file

@ -1,9 +1,21 @@
.note-container p:first-child { main#wrapper {
margin: 1rem 1rem 0 1rem;
max-width: 50rem;
}
#header {
margin-bottom: 3rem;
}
/*.note-container p:first-child {
margin-top: 0; margin-top: 0;
} }
html, body {
height: 100%; // html, body {
} // height: 100%;
// }
@media only screen and (max-width: 480px) { @media only screen and (max-width: 480px) {
#menu-item-following { #menu-item-following {
@ -413,3 +425,5 @@ li.answer {
width:70px; width:70px;
display:inline-block; display:inline-block;
} }
*/

View file

@ -24,17 +24,16 @@
</div> </div>
<div class="menu"> <div class="tabs">
<ul> <ul>
<li><a href="/" {% if request.path == "/" %}class="selected"{% endif %}>Notes <small class="badge">{{ notes_count }}</small></a></li> <li {% if request.path == "/" %}class="is-active"{% endif %}><a href="/">Notes [{{ notes_count }}]</a></li>
{% if session.logged_in %}<li><a href="/all" {% if request.path == url_for("all") %}class="selected"{% endif %}>All <small class="badge">{{ with_replies_count }}</small></a></li> <li {% if request.path == url_for("all") %}class="is-active"{% endif %}><a href="/all">All [{{ with_replies_count }}]</a></li>
<li><a href="/liked" {% if request.path == "/liked" %}class="selected"{% endif %}>Liked <small class="badge">{{ liked_count }}</small></a></li> <li {% if request.path == "/liked" %}class="is-active"{% endif %}><a href="/liked">Liked [{{ liked_count }}]</a></li>
{% endif %} <li {% if request.path == "/followers" %} class="is-active" {% endif %}><a href="/followers">Followers [{{ followers_count }}]</a></li>
<li><a href="/followers"{% if request.path == "/followers" %} class="selected" {% endif %}>Followers <small class="badge">{{ followers_count }}</small></a></li> <li {% if request.path == "/following" %} class="is-active" {% endif %}><a href="/following">Following [{{ following_count }}]</a></li>
{% if not config.HIDE_FOLLOWING or session.logged_in %}<li id="menu-item-following"><a href="/following"{% if request.path == "/following" %} class="selected" {% endif %}>Following <small class="badge">{{ following_count }}</small></a></li>{% endif %}
<!-- <li><a href="/about"{% if request.path == "/about" %} class="selected" {% endif %}>/about</a></li>
-->
</ul> </ul>
</div> </div>
</div>
</header> </header>

View file

@ -103,9 +103,9 @@ dt, dd { font-size: 0.9em; }
{% endif %} {% endif %}
<div class="base-container"> <main id="wrapper">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </main>
<footer class="footer"> <footer class="footer">
<div> <div>
Powered by <a href="https://microblog.pub">microblog.pub</a> <small class="microblogpub-version"><code>{{ microblogpub_version }}</code></small> (<a href="https://github.com/tsileo/microblog.pub">source code</a>) and the <a href="https://activitypub.rocks/">ActivityPub</a> protocol Powered by <a href="https://microblog.pub">microblog.pub</a> <small class="microblogpub-version"><code>{{ microblogpub_version }}</code></small> (<a href="https://github.com/tsileo/microblog.pub">source code</a>) and the <a href="https://activitypub.rocks/">ActivityPub</a> protocol

View file

@ -11,56 +11,136 @@
<h3 style="padding-bottom: 30px">Replying to {{ content }}</h3> <h3 style="padding-bottom: 30px">Replying to {{ content }}</h3>
{{ utils.display_thread(thread) }} {{ utils.display_thread(thread) }}
{% else %} {% else %}
<div class="tabbar">
<div class="tabs is-toggle is-rounded">
{% if request.args.get("question") == "1" %} {% if request.args.get("question") == "1" %}
<a href="{{ url_for('admin.admin_new') }}" class="tab">Note</a><a href="{{ url_for('admin.admin_new') }}?question=1" class="tab selected">Question</a> <ul>
<li><a href="{{ url_for('admin.admin_new') }}">Note</a></li>
<li class="is-active"><a href="{{ url_for('admin.admin_new') }}?question=1">Question</a></li>
</ul>
{% else %} {% else %}
<a href="{{ url_for('admin.admin_new') }}" class="tab selected">Note</a><a href="{{ url_for('admin.admin_new') }}?question=1" class="tab">Question</a> <ul>
<li class="is-active"><a href="{{ url_for('admin.admin_new') }}">Note</a></li>
<li><a href="{{ url_for('admin.admin_new') }}?question=1">Question</a></li>
</ul>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
<form id="new-activity" action="/api/new_{% if request.args.get("question") == "1" %}question{%else%}note{%endif%}" method="POST" enctype="multipart/form-data"> <form id="new-activity" action="/api/new_{% if request.args.get("question") == "1" %}question{%else%}note{%endif%}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="redirect" value="/"> <input type="hidden" name="redirect" value="/">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="field is-horizontal">
<div class="field-body">
<!-- Visibility -->
<div class="field">
<label for="visibility" class="label">Visibility</label>
<div class="control">
<div class="select">
<select name="visibility" style="padding:8px 10px;"> <select name="visibility" style="padding:8px 10px;">
{% for v in visibility %} {% for v in visibility %}
<option value="{{v.name}}" {% if v == default_visibility %}selected="selected"{% endif %}>{{ v.value }}</option> <option value="{{v.name}}" {% if v == default_visibility %}selected="selected"{% endif %}>{{ v.value }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div>
</div>
</div>
<!-- Content Warning -->
<div class="field">
<label for="summary" class="label">Summary</label>
<p class="control">
<input class="input" name="summary" type="summary" placeholder="summary/CW (optional)">
</p>
</div>
</div>
</div>
{% if reply %}<input type="hidden" name="reply" value="{{reply}}">{% endif %} {% if reply %}<input type="hidden" name="reply" value="{{reply}}">{% endif %}
<p><input type="text" name="summary" placeholder="summary/CW (optional)"></p> <div class="field">
<div class="control">
<p> <div class="buttons">
{% for emoji in emojis %} {% for emoji in emojis %}
<span class="ji">{{ emoji | emojify | safe }}</span> <span class="button is-dark ji">{{ emoji | emojify | safe }}</span>
{% endfor %} {% endfor %}
</div>
<div class="buttons">
{% for emoji in custom_emojis %} {% for emoji in custom_emojis %}
<span class="ji"><img src="{{emoji.get_icon_url()}}" alt="{{emoji.name}}" title="{{emoji.name}}" class="custom-emoji"></span> <span class="button is-dark ji"><img src="{{emoji.get_icon_url()}}" alt="{{emoji.name}}" title="{{emoji.name}}" class="custom-emoji"></span>
{% endfor %} {% endfor %}
</p> </div>
</div>
</div>
<textarea name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" style="font-size:1.2em;width:95%;">{{ content }}</textarea> <div class="field">
<div class="control">
<textarea class="textarea" name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" style="font-size:1.2em;width:95%;">{{ content }}</textarea>
</div>
</div>
<p> <div class="field is-horizontal">
<input type="file" name="file"> <div class="field-body">
<p> <div class="field">
<p> <div class="file">
<input type="text" name="file_description" placeholder="attachment description (optional)"> <label class="file-label">
</p> <input class="file-input" type="file" name="name">
<span class="file-cta">
<span class="file-label">
Choose a file…
</span>
</span>
</label>
</div>
</div>
<div class="field">
<div class="control">
<input type="text" class="input" name="file_description" placeholder="attachment description (optional)">
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-body">
<div class="field">
<div class="control">
<input type="text" class="input" name="location_lat" id="location_lat" placeholder="latitude (optional)">
</div>
</div>
<div class="field">
<div class="control">
<input type="text" class="input" name="location_lng" id="location_lng" placeholder="longitude (optional)">
</div>
</div>
<div class="field">
<div class="control">
<input type="text" class="input" name="location_name" placeholder="location name (optional)">
</div>
</div>
</div>
</div>
<div class="field">
<div class="control">
<a href="#" class="location_autofill button is-info">ask browser for location</a>
</div>
</div>
<p>
<input type="text" name="location_lat" id="location_lat" placeholder="latitude (optional)">
<input type="text" name="location_lng" id="location_lng" placeholder="longitude (optional)">
<a href="#" class="location_autofill">ask browser for location</a>
</p>
<p>
<input type="text" name="location_name" placeholder="location name (optional)">
</p>
{% if request.args.get("question") == "1" %} {% if request.args.get("question") == "1" %}
<div style="margin-top:20px;"> <div class="field is-horizontal">
<p>Open for: <select name="open_for"> <div class="field-body">
<div class="field">
<label for="open_for" class="label">Open for</label>
<div class="control">
<div class="select">
<select name="open_for">
<option value="5">5 minutes</option> <option value="5">5 minutes</option>
<option value="10">10 minutes</option> <option value="10">10 minutes</option>
<option value="15">15 minutes</option> <option value="15">15 minutes</option>
@ -70,21 +150,39 @@
<option value="1440" selected>1 day</option> <option value="1440" selected>1 day</option>
<option value="4320">3 days</option> <option value="4320">3 days</option>
<option value="10080">7 days</option> <option value="10080">7 days</option>
</select></p> </select>
</div>
</div>
</div>
<p><select name="of"> <div class="field">
<label for="of" class="label">Choices</label>
<div class="control">
<div class="select">
<select name="of">
<option value="oneOf">Single choice</option> <option value="oneOf">Single choice</option>
<option value="anyOf">Multiple choices</option> <option value="anyOf">Multiple choices</option>
</select></p> </select>
</div>
</div>
</div>
</div>
</div>
{% for i in range(4) %} {% for i in range(4) %}
<p><input type="text" name="answer{{i}}" placeholder="Answer #{{i+1}}"></p> <div class="field">
<div class="control">
<input type="text" class="input" name="answer{{i}}" placeholder="Answer #{{i+1}}">
</div>
</div>
{% endfor %} {% endfor %}
</div>
{% endif %} {% endif %}
<input type="submit" value="post"> <div class="field">
<div class="control">
<input type="submit" value="post" class="button is-primary">
</div>
</div> </div>
</form> </form>

View file

@ -96,22 +96,22 @@
{% set real_end_time = obj.closed or obj.endTime %} {% set real_end_time = obj.closed or obj.endTime %}
<article class="note-box"> <article class="note h-entry" id="activity-{{ obj.id | permalink_id }}">
<div class="note h-entry" id="activity-{{ obj.id | permalink_id }}"> <div class="media h-card p-author">
<figure class="media-left">
<div class="h-card p-author"> <a class="u-url u-uid no-hover image is-64x64" rel="author" href="{{ actor | url_or_id | get_url }}">
<a class="u-url u-uid no-hover" rel="author" href="{{ actor | url_or_id | get_url }}"><img class="u-photo" src="{% if not actor.icon %}/static/nopic.png{% else %}{{ actor.icon.url | get_actor_icon_url(50) }}{% endif %}"> <img class="u-photo" src="{% if not actor.icon %}/static/nopic.png{% else %}{{ actor.icon.url | get_actor_icon_url(50) }}{% endif %}">
</a> </a>
</figure>
<data class="p-name" value="{{ actor.name or actor.preferredUsername }}"></data> <data class="p-name" value="{{ actor.name or actor.preferredUsername }}"></data>
</div> <div class="media-content">
<aside>
<div class="note-wrapper"> <a href="{{ actor | url_or_id | get_url }}" class="no-hover">
<aside style="clear:both;height:20px;">
<a href="{{ actor | url_or_id | get_url }}" style="margin:0;text-decoration:none;margin: 0;text-decoration: none;display: block;width: 75%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float: left;" class="no-hover">
<strong>{{ (actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }}</strong> <strong>{{ (actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }}</strong>
<span class="l">@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}</span>{% else %}{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}{% endif %}@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor | url_or_id | get_url | domain }}</span>{% else %}{{ actor | url_or_id | get_url | domain }}{% endif %}</span></a> <span class="l">@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}</span>{% else %}{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}{% endif %}@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor | url_or_id | get_url | domain }}</span>{% else %}{{ actor | url_or_id | get_url | domain }}{% endif %}</span>
</a>
<span style="float:right;width: 25%;text-align: right;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;display: block;"> <span class="is-pulled-right">
<a rel="noopener" class="u-url u-uid note-permalink l" href="{{ obj | url_or_id | get_url }}"> <a rel="noopener" class="u-url u-uid note-permalink l" href="{{ obj | url_or_id | get_url }}">
<time class="dt-published" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a> <time class="dt-published" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a>
</span> </span>
@ -280,20 +280,16 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<aside class="bottom-bar buttons">
<aside class="bottom-bar">
{% if meta.count_reply and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a> {% if meta.count_reply and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a>
{% elif meta.count_reply and session.logged_in %} {% elif meta.count_reply and session.logged_in %}
<a class="bar-item" href="/admin/thread?oid={{aid}}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a>{% endif %} <a class="button" href="/admin/thread?oid={{aid}}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a>{% endif %}
{% if not perma and meta.count_boost and obj.id | is_from_outbox %}<a class ="button" href="{{ obj.url | get_url }}"><strong>{{ meta.count_boost }}</strong> boost{% if meta.count_boost > 1 %}s{% endif %}</a>{% endif %}
{% if not perma and meta.count_boost and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_boost }}</strong> boost{% if meta.count_boost > 1 %}s{% endif %}</a>{% endif %} {% if not perma and meta.count_like and obj.id | is_from_outbox %}<a class ="button" href="{{ obj.url | get_url }}"><strong>{{ meta.count_like }}</strong> like{% if meta.count_like > 1 %}s{% endif %}</a>{% endif %}
{% if not perma and meta.count_like and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_like }}</strong> like{% if meta.count_like > 1 %}s{% endif %}</a>{% endif %}
{% if session.logged_in %} {% if session.logged_in %}
<a class="bar-item" href="/admin/new?reply={{ aid }}">reply</a> <a class="button" href="/admin/new?reply={{ aid }}">reply</a>
{% if meta | get_visibility | visibility_is_public %} {% if meta | get_visibility | visibility_is_public %}
{% if meta.boosted %} {% if meta.boosted %}
@ -301,14 +297,14 @@
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ meta.boosted }}"> <input type="hidden" name="id" value="{{ meta.boosted }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">unboost</button> <button type="submit" class="button">unboost</button>
</form> </form>
{% else %} {% else %}
<form action="/api/boost" class="action-form" method="POST"> <form action="/api/boost" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">boost</button> <button type="submit" class="button">boost</button>
</form> </form>
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -318,14 +314,14 @@
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ meta.liked }}"> <input type="hidden" name="id" value="{{ meta.liked }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">unlike</button> <button type="submit" class="button">unlike</button>
</form> </form>
{% else %} {% else %}
<form action="/api/like" class="action-form" method="POST"> <form action="/api/like" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">like</button> <button type="submit" class="button">like</button>
</form> </form>
{% endif %} {% endif %}
@ -335,39 +331,37 @@
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="undo" value="yes"> <input type="hidden" name="undo" value="yes">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">unbookmark</button> <button type="submit" class="button">unbookmark</button>
</form> </form>
{% else %} {% else %}
<form action="/api/bookmark" class="action-form" method="POST"> <form action="/api/bookmark" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">bookmark</button> <button type="submit" class="button">bookmark</button>
</form> </form>
{% endif %} {% endif %}
{% if obj.id | is_from_outbox %} {% if obj.id | is_from_outbox %}
<form action="/api/note/delete" class="action-form" method="POST"> <form action="/api/note/delete" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item" onclick="return confirm('Confirm the delete action?');">delete</button> <button type="submit" class="button" onclick="return confirm('Confirm the delete action?');">delete</button>
</form> </form>
{% if meta.pinned %} {% if meta.pinned %}
<form action="/api/note/unpin" class="action-form" method="POST"> <form action="/api/note/unpin" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">unpin</button> <button type="submit" class="button">unpin</button>
</form> </form>
{% else %} {% else %}
<form action="/api/note/pin" class="action-form" method="POST"> <form action="/api/note/pin" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">pin</button> <button type="submit" class="button">pin</button>
</form> </form>
{% endif %} {% endif %}
@ -375,22 +369,22 @@
{% endif %} {% endif %}
{% if session.logged_in and obj.inReplyTo and not meta.count_reply and not perma %} {% if session.logged_in and obj.inReplyTo and not meta.count_reply and not perma %}
<a class="bar-item" href="/admin/thread?oid={{aid}}">thread</a> <a class="button" href="/admin/thread?oid={{aid}}">thread</a>
{% endif %} {% endif %}
{% if meta | get_visibility | visibility_is_public %} {% if meta | get_visibility | visibility_is_public %}
{% if obj | url_or_id | get_url | is_from_outbox %} {% if obj | url_or_id | get_url | is_from_outbox %}
{% if not perma %} {% if not perma %}
<a class="bar-item" href="{{ obj | url_or_id | get_url }}">permalink</a> <a class="button" href="{{ obj | url_or_id | get_url }}">permalink</a>
{% endif %} {% endif %}
{% else %} {% else %}
<a class="bar-item" href="{{ obj | url_or_id | get_url }}" rel="external noreferrer">source</a> <a class="button" href="{{ obj | url_or_id | get_url }}" rel="external noreferrer">source</a>
{% if session.logged_in %} {% if session.logged_in %}
<a class="bar-item" href="/admin/profile?actor_id={{actor.id}}">profile</a> <a class="button" href="/admin/profile?actor_id={{actor.id}}">profile</a>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
<a class="bar-item bar-item-no-border">{{ meta | get_visibility | visibility }}</a> <a class="button bar-item-no-border">{{ meta | get_visibility | visibility }}</a>
</aside> </aside>