1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +00:00
This commit is contained in:
Steffo 2018-07-22 17:02:42 +02:00
parent f633f2f82f
commit 898400ef40
5 changed files with 71 additions and 7 deletions

View file

@ -18,10 +18,12 @@ h1, h2, h3, h4, h5, h6 {
a { a {
color: @link-color; color: @link-color;
text-decoration: none;
} }
a:active { a:hover, a:active {
color: @link-color; color: @link-color;
text-decoration: underline;
} }
a:visited { a:visited {
@ -32,14 +34,13 @@ blockquote {
border-left: 3px solid @quote-color; border-left: 3px solid @quote-color;
color: @quote-color; color: @quote-color;
background-color: rgba(red(@quote-color), green(@quote-color), blue(@quote-color), 0.1); background-color: rgba(red(@quote-color), green(@quote-color), blue(@quote-color), 0.1);
padding-left: 8px; padding: 2px 4px 2px 8px;
margin-left: 8px; margin-left: 8px;
} }
blockquote p { blockquote p {
padding-top: 4px; padding-top: 2px;
padding-bottom: 2px; margin: 4px 0;
margin: 6px 0;
} }
blockquote.spoiler { blockquote.spoiler {
@ -171,13 +172,13 @@ nav {
} }
@media (min-width:600px) { @media (min-width:600px) {
.desktop-only { .mobile-only {
display: none; display: none;
} }
} }
@media (max-width:600px) { @media (max-width:600px) {
.mobile-only { .desktop-only {
display: none; display: none;
} }
} }
@ -570,6 +571,28 @@ nav {
} }
} }
.diario blockquote {
display: grid;
.left {
grid-column: 1;
}
.right {
grid-column: 2;
text-align: right;
margin-top: auto;
}
cite {
font-size: smaller;
}
.entry-id {
text-align: right;
}
}
#edit-css { #edit-css {
font-size: medium; font-size: medium;
} }

View file

@ -0,0 +1,13 @@
<blockquote id="entry-{{ entry.id }}" class="entry">
<div class="left">
<p>
<span class="text">{{ entry.text }}</span>
</p>
<p>
<cite>— {% if entry.author is not none %}<a class="author" href="/profile/{{ entry.author.royal.username }}">{{ entry.author.royal.username }}</a>{% else %}<span class="author anonymous">Anonimo</span>{% endif %}, <span class="timestamp">{{ entry.timestamp.strftime('%Y-%m-%d %H:%M:%S %Z') }}</span> {% if entry.saver is not none and entry.saver != entry.author %}<span class="saver">(salvato da <a href="/profile/{{ entry.saver.royal.username }}">{{ entry.saver.royal.username }}</a>)</span>{% endif %}</cite>
</p>
</div>
<div class="right">
<a class="entry-id" href="#{{ entry.id }}">#{{ entry.id }}</a>
</div>
</blockquote>

16
templates/diario.html Normal file
View file

@ -0,0 +1,16 @@
{% extends 'base.html' %}
{% block pagetitle %}
Diario
{% endblock %}
{% block body %}
<h1>
Diario
</h1>
<div class="diario">
{% for entry in entries %}
{% include "components/diarioentry.html" %}
{% endfor %}
</div>
{% endblock %}

View file

@ -33,4 +33,8 @@
<li><a href="/wiki/{{ page.key }}">{{ page.key }}</a></li> <li><a href="/wiki/{{ page.key }}">{{ page.key }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
<h2>Diario</h2>
<ul>
<a href="/diario">Nuovo</a>
</ul>
{% endblock %} {% endblock %}

View file

@ -236,6 +236,14 @@ def page_wiki(key: str):
return redirect(url_for("page_wiki", key=key)) return redirect(url_for("page_wiki", key=key))
@app.route("/diario")
def page_diario():
db_session = db.Session()
diario_entries = db_session.query(db.Diario).all()
db_session.close()
return render_template("diario.html", config=config, entries=diario_entries)
if __name__ == "__main__": if __name__ == "__main__":
try: try:
app.run(host="0.0.0.0", port=1235, debug=__debug__) app.run(host="0.0.0.0", port=1235, debug=__debug__)