buku/bukuserver/templates/bukuserver/base.html
rachmadani haryono be50451d1d Feature/server (#289)
* new: dev: version flag

fix: dev: pylint error

* chg: dev: sort route !cosmetic

* new: dev: custom BaseModelView for buku bookmark

* new: dev: formatted entry

* new: dev: url render mode

* new: dev: bookmark edit !wip

* chg: dev: use existing form for bookmark

* chg: dev: form name !refactor

* new: dev: enable details views

* new: dev:  views module

* new: dev: tag model view

* chg: dev: only split  page_size defined

* chg: dev: use SelectMultipleField

* fix: dev: Bookmark tags choices

* chg dev: configure tags

* chg: dev: tag edit form !wip

* chg: dev: update bookmark model

* chg: dev: remove unused function

* new: dev: add flask wtf and admin

* chg: dev: use SimpleNamespace instead namedtuple

* new: dev: delete tags feature

* new: dev: chatty parameter for delete_tag_at_index

* fix: dev: skip confirmation when deleting tag

* fix: dev: when update bookmark model

* new: dev: update tag

* chg: dev: use parse_tags method

* new: dev: select2 field for tagsfield

* chg: dev: remove unused code

* fix: dev: syntax

* fix: dev: update bookmark model

* chg: dev: change api based on flask-api

* fix: dev: new tags on tag_detail PUT

* chg: dev: raise error when parsing failed

* chg: dev: move server required package

* new: dev: create_model

* chg: dev: override abstract method model view class

* chg: dev: delete model for bookmark

* fix: dev: pylint ignore !cosmetic

* new: dev: filter for tag

* chg: dev: more filter for TagModel

* new: dev: new filter for tag model

* chg: dev: deduplicate filter

* fix: dev: pylint !cosmetic

* chg: dev: generalize tag, bookmark filter

* chg: dev: add filters for bookmark

* fix: dev: not equal filter

* new: dev: url basic filter

* chg: dev: configure bookmark model view

* chg: dev: reorder bookmark view method

* new: dev: tags number filter

* chg: dev: bookmark url with unknown scheme

* new: dev: network handle api

* new: dev: modal edit/create for bookmark

* chg: dev: link tag  bookmark tag search

* fix: dev: empty tag contain search

* chg: dev: buku search option

* new: dev: buku search to filter

* chg: dev: front page search

* chg: dev: move Statistic page to views module

* fix: dev: bookmark search

* new: dev: title filter

* fix: dev: statistic label

* fix: dev: link on statistic page

* chg: dev: strip search value

* fix: dev: bookmark entry fix

* fix: dev: netloc modal on

* fix: dev: pylint !cosmetic

* chg: dev: remove duplicate package

* chg: dev: move admin to root

* fix: dev: link on statistic page

* chg: dev: pin pyyaml package
2018-06-28 19:34:35 +05:30

105 lines
3.8 KiB
HTML

{% extends "bootstrap/base.html" %}
{% block title %}Buku Server{% endblock %}
{% block html_attribs %} lang="en"{% endblock %}
{% block styles %}
{{super()}}
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
{% endblock %}
{% block navbar %}
{{super()}}
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Buku Server</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="{{url_for('index')}}">Home</a></li>
<li><a href="{{url_for('bookmarks-html')}}">Bookmarks</a></li>
<li><a href="{{url_for('get_tags-html')}}">Tags</a></li>
<li><a href="{{url_for('statistic.index')}}">Statistics</a></li>
</ul>
<form class="navbar-form navbar-right" action="{{url_for('search_bookmarks-html')}}" method="GET">
<div class="form-group">
<input type="text" class="form-control" id="inputKeywords" placeholder="Search bookmark" name="keywords-0">
</div>
<button type="submit" class="btn btn-default">Search</button>
</form>
</div><!--/.nav-collapse -->
</div>
</nav>
{% endblock %}
{% block content %}
<div class="container">{{show_flash_message()}}</div>
{%- endblock %}
{% macro show_flash_message() %}
{%- with messages = get_flashed_messages(with_categories=True) %}
{%- if messages %}
{% for category, message in messages %}
<div class="alert alert-{{category}}">{{message}} </div>
{% endfor %}
{%- endif %}
{%- endwith %}
{% endmacro %}
{% macro show_bookmarks(bookmarks) %}
<table class="table" style="table-layout: fixed; width: 100%">
<caption>Bookmark table.</caption>
<thead> <tr> <th>Entry</th> </tr> </thead>
<tbody>
{% for item in bookmarks %}
<tr> <td style="overflow-wrap: break-word;">
<h3>
{% if item.url|netloc %}
<img src='http://www.google.com/s2/favicons?domain={{item.url|netloc}}'/>
{% endif %}
<a href="{{item.url}}">{{item.title}}</a>
<a href="{{url_for('bookmark_api-html', id=item.id)}}">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
</a>
</h3>
{% if url_render_mode == 'netloc' %} ({{item.url|netloc}}) {% endif %}
{% if not url_render_mode or url_render_mode == 'full' %}
<p><a href="{{item.url}}">{{item.url}}</a></p>
{% endif %}
<p>{{item.description}}</p>
<p>
{% for tag in item.tags %}
<a class="btn btn-default" href="{{url_for('bookmarks-html', tag=tag)}}" role="button">{{tag}}</a>
{% endfor %}
</p>
</td> <tr>
{% else %}
<tr> <td>No entry Found</td> </tr>
{% endfor %}
</tbody>
</table>
{% endmacro %}
{% macro show_bookmarks_search_form(checkbox_class=None) %}
<form class="form-horizontal" action="{{url_for('search_bookmarks-html')}}" method="GET">
<div class="form-group">
{{search_bookmarks_form.keywords.label}}
{% for entry in search_bookmarks_form.keywords %}
{{ entry() }}
{% endfor %}
</div>
<div class="{{checkbox_class}}">
<div class="form-group"> {{search_bookmarks_form.all_keywords()}} {{search_bookmarks_form.all_keywords.label}} </div>
<div class="form-group"> {{search_bookmarks_form.deep()}} {{search_bookmarks_form.deep.label}} </div>
<div class="form-group"> {{search_bookmarks_form.regex()}} {{search_bookmarks_form.regex.label}} </div>
</div>
<button type="submit" class="btn btn-default">Search</button>
</form>
{% endmacro %}