start stubbing out endpoints
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
<footer class="plank secondary-bg bottom">
|
||||
<span>Pyrom commit <a href="{{ "https://git.poto.cafe/yagich/pyrom/commit/" + __commit }}">{{ __commit[:8] }}</a></span>
|
||||
<ul class="horizontal">
|
||||
{#-
|
||||
<li><a href="#">Contact</a></li>
|
||||
<li><a href="#">Guides</a></li>
|
||||
-#}
|
||||
<li><a href="{{url_for('guides.contact')}}">Contact</a></li>
|
||||
<li><a href="{{url_for('guides.index')}}">Guides</a></li>
|
||||
</ul>
|
||||
</footer>
|
||||
|
||||
@@ -1,3 +1,67 @@
|
||||
{% macro timestamp(unix_ts) -%}
|
||||
<span class="timestamp" data-utc="{{ unix_ts }}">{{ unix_ts | ts_datetime('%Y-%m-%d %H:%M')}} <abbr title="Server Time">ST</abbr></span>
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro subheader(title, desc='') -%}
|
||||
<div id="subheader" class="plank secondary-bg">
|
||||
<h1 class="info">{{title}}</h1>
|
||||
{%- if desc -%}<span>{{desc}}</span>{%- endif -%}
|
||||
<div class="actions-group">{% if caller %}{{- caller() -}}{% endif %}</div>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro pager(current_page, page_count, classes='', url='', args={}) -%}
|
||||
{%- if args -%}
|
||||
{#- remove the page query argument -#}
|
||||
{%- set fargs = dict(args.items() | rejectattr(0, 'equalto', 'page')) -%}
|
||||
{%- set url = url + (fargs | dict_to_query_string) + '&page=' -%}
|
||||
{%- else -%}
|
||||
{%- set url = url + '?page=' -%}
|
||||
{%- endif -%}
|
||||
<span class="button-row {{classes}}">
|
||||
{%- if current_page == 0 -%}
|
||||
{%- if page_count <= 3 -%}
|
||||
{%- for i in range(page_count) -%}
|
||||
<a href="{{url}}{{i+1}}" class="linkbutton minimal">{{i+1}}</a>
|
||||
{%- endfor -%}
|
||||
{%- else -%}
|
||||
<a href="{{url}}1" class="linkbutton minimal">1</a>
|
||||
<a href="{{url}}2" class="linkbutton minimal">2</a>
|
||||
<button class="minimal" disabled>…</button>
|
||||
<a href="{{url}}{{page_count - 1}}" class="linkbutton minimal">{{page_count - 1}}</a>
|
||||
<a href="{{url}}{{page_count}}" class="linkbutton minimal">{{page_count}}</a>
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- set left_start = [2, current_page - 1] | max -%}
|
||||
{%- set right_end = [page_count - 1, current_page + 1] | min -%}
|
||||
|
||||
{%- if current_page != 1 -%}
|
||||
<a href="{{url}}1" class="linkbutton minimal">1</a>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if left_start > 2 -%}
|
||||
<button class="minimal" disabled>…</button>
|
||||
{%- endif -%}
|
||||
|
||||
{%- for i in range(left_start, current_page) -%}
|
||||
<a href="{{url}}{{i}}" class="linkbutton minimal">{{i}}</a>
|
||||
{%- endfor -%}
|
||||
|
||||
{%- if page_count > 0 -%}
|
||||
<button class="minimal" disabled>{{current_page}}</button>
|
||||
{%- endif -%}
|
||||
|
||||
{%- for i in range(current_page + 1, right_end + 1) -%}
|
||||
<a href="{{url}}{{i}}" class="linkbutton minimal">{{i}}</a>
|
||||
{%- endfor -%}
|
||||
|
||||
{%- if right_end < page_count - 1 -%}
|
||||
<button class="minimal" disabled>…</button>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page_count > 1 and current_page != page_count -%}
|
||||
<a href="{{url}}{{page_count}}" class="linkbutton minimal">{{page_count}}</a>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
</span>
|
||||
{%- endmacro %}
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
<nav id="header" class="plank top">
|
||||
<a class="site-title" href=#>Porom</a>
|
||||
<a class="site-title" href="/">Porom</a>
|
||||
<span>anti-social media</span>
|
||||
{%- if is_logged_in() -%}
|
||||
no
|
||||
{%- with user = get_active_user() -%}
|
||||
<ul class="horizontal wrap">
|
||||
<li class="mobile-fill-flex">Welcome, <a href="{{url_for('users.user_page', username=user.username)}}">{{ user.get_readable_name() }}</a></li>
|
||||
<li><a class="linkbutton" href="{{url_for('users.settings', username=user.username)}}">Settings</a></li>
|
||||
<li><a class="linkbutton" href="{{url_for('users.inbox', username=user.username)}}">Inbox</a></li>
|
||||
<li><a class="linkbutton" href="{{url_for('users.bookmarks', username=user.username)}}">Bookmarks</a></li>
|
||||
{% if user.is_mod() -%}
|
||||
<li><a class="linkbutton" href="{{url_for('mod.index')}}">Moderation</a></li>
|
||||
{%- endif %}
|
||||
</ul>
|
||||
{%- endwith -%}
|
||||
{%- else -%}
|
||||
<form class="horizontal wrap">
|
||||
<form class="horizontal wrap" method="POST" action="{{url_for('users.log_in')}}">
|
||||
<input type="hidden" name="return_to" value="{{request.path}}">
|
||||
<input type="text" placeholder="Username">
|
||||
<input type="password" placeholder="Password">
|
||||
<input type="text" placeholder="Username" name="username" autocomplete="username" required>
|
||||
<input type="password" placeholder="Password" name="password" autocomplete="current-password" required>
|
||||
<input type="submit" value="Log in">
|
||||
<a href="#" class="linkbutton">Register</a>
|
||||
<a href="{{url_for('users.sign_up')}}" class="linkbutton">Sign up</a>
|
||||
</form>
|
||||
{%- endif -%}
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user