mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05:10 +01:00
Refactoring to simpler html with alpine.js
This commit is contained in:
@@ -482,5 +482,7 @@ def page_user_landing(
|
|||||||
raise HTTPException(status_code=404, detail='User not found')
|
raise HTTPException(status_code=404, detail='User not found')
|
||||||
language = 'en'
|
language = 'en'
|
||||||
return templates.TemplateResponse(
|
return templates.TemplateResponse(
|
||||||
request=request, name='user_index.html', context={'language': language, 'version': DIGIMARKS_VERSION}
|
request=request,
|
||||||
|
name='user_index.html',
|
||||||
|
context={'language': language, 'version': DIGIMARKS_VERSION, 'user_key': user_key},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,64 +4,3 @@
|
|||||||
|
|
||||||
/** Navigation **/
|
/** Navigation **/
|
||||||
|
|
||||||
nav .sidenav-trigger
|
|
||||||
{
|
|
||||||
/* Fix for misalignment of hamburger icon */
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav .sidenav-trigger i
|
|
||||||
{
|
|
||||||
/* Make the hamburger icon great again */
|
|
||||||
font-size: 2.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Cards and tags **/
|
|
||||||
|
|
||||||
.card .card-content,
|
|
||||||
.card .card-reveal
|
|
||||||
{
|
|
||||||
padding: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card.tiny
|
|
||||||
{
|
|
||||||
height: 140px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card.tiny .card-title
|
|
||||||
{
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card .card-reveal .digimark-card-header,
|
|
||||||
.card .digimark-card-header.activator,
|
|
||||||
.chip.clickable
|
|
||||||
{
|
|
||||||
cursor: pointer;
|
|
||||||
/*display: block;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.card .digimark-card-header-tags
|
|
||||||
{
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-image
|
|
||||||
{
|
|
||||||
min-width: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-image i,
|
|
||||||
.list-image i
|
|
||||||
{
|
|
||||||
padding: 5px 0 0 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card.horizontal .card-image img.favicon,
|
|
||||||
.list-image img.favicon
|
|
||||||
{
|
|
||||||
height: 60px;
|
|
||||||
width: 60px;
|
|
||||||
}
|
|
||||||
|
|||||||
3
src/digimarks/static/css/digui.css
Normal file
3
src/digimarks/static/css/digui.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/**
|
||||||
|
* digui structure
|
||||||
|
*/
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/* global M */
|
|
||||||
|
|
||||||
var options = {};
|
|
||||||
var elem = document.querySelector(".sidenav");
|
|
||||||
var instance = M.Sidenav.init(elem, options);
|
|
||||||
|
|
||||||
elem = document.querySelector(".collapsible");
|
|
||||||
instance = M.Collapsible.init(elem, {
|
|
||||||
// inDuration: 1000,
|
|
||||||
// outDuration: 1000
|
|
||||||
});
|
|
||||||
@@ -1,126 +1,35 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="{{ language }}">
|
||||||
<head>
|
<head>
|
||||||
<title>{% block title %}{% endblock %} - digimarks</title>
|
<title>{% block title %}{% endblock %} - digimarks</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
|
<link rel="stylesheet" href="/static/css/digui.css?v={{ version }}">
|
||||||
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"/>
|
<link rel="stylesheet" href="/static/css/digimarks.css?v={{ version }}">
|
||||||
|
<link id="favicon" rel="icon" type="image/x-icon" href="/static/images/favicon.ico">
|
||||||
<!-- Chrome, Firefox OS and Opera -->
|
<link rel="apple-touch-icon" sizes="180x180" href="/static/images/apple-touch-icon.png">
|
||||||
<meta name="theme-color" content="{{ theme.BROWSERCHROME }}" />
|
<link rel="icon" type="image/png" sizes="32x32" href="/static/images/favicon-32x32.png">
|
||||||
<!-- Windows Phone -->
|
<link rel="icon" type="image/png" sizes="16x16" href="/static/images/favicon-16x16.png">
|
||||||
<meta name="msapplication-navbutton-color" content="{{ theme.BROWSERCHROME }}">
|
<link rel="manifest" href="/static/images/site.webmanifest">
|
||||||
<!-- iOS Safari -->
|
<script src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<script src="https://cdn.jsdelivr.net/npm/@ryangjchandler/alpine-clipboard@2.x.x/dist/alpine-clipboard.js"
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
defer></script>
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
||||||
<meta name="referrer" content="never">
|
|
||||||
<meta name="referrer" content="no-referrer">
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
||||||
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
|
||||||
<style>
|
|
||||||
a
|
|
||||||
{
|
|
||||||
color: {{ theme.LINK_TEXT }};
|
|
||||||
}
|
|
||||||
.card-content a
|
|
||||||
{
|
|
||||||
color: {{ theme.CARD_LINK }};
|
|
||||||
}
|
|
||||||
.chip a
|
|
||||||
{
|
|
||||||
color: {{ theme.CHIP_TEXT }};
|
|
||||||
}
|
|
||||||
/* label color */
|
|
||||||
.input-field .prefix ~ input, .input-field .prefix ~ textarea, .input-field .prefix ~ label, .input-field .prefix ~ .validate ~ label, .input-field .prefix ~ .autocomplete-content, .input-field input[type=text]
|
|
||||||
{
|
|
||||||
color: {{ theme.TEXTHEX }};
|
|
||||||
}
|
|
||||||
/* label focus color */
|
|
||||||
.input-field input[type=text]:focus + label,
|
|
||||||
.input-field .prefix ~ input[type=text]:focus + label
|
|
||||||
{
|
|
||||||
color: {{ theme.BUTTON }};
|
|
||||||
}
|
|
||||||
/* label underline focus color */
|
|
||||||
.input-field input[type=text]:focus,
|
|
||||||
.input-field .prefix ~ input[type=text]:focus,
|
|
||||||
.input-field input[type=text].autocomplete:focus
|
|
||||||
{
|
|
||||||
border-bottom: 1px solid {{ theme.BUTTON }};
|
|
||||||
box-shadow: 0 1px 0 0 {{ theme.BUTTON }};
|
|
||||||
}
|
|
||||||
/* icon prefix focus color */
|
|
||||||
.input-field .prefix.active
|
|
||||||
{
|
|
||||||
color: {{ theme.BUTTON }};
|
|
||||||
}
|
|
||||||
.btn, .btn:visited
|
|
||||||
{
|
|
||||||
background-color: {{ theme.BUTTON }};
|
|
||||||
}
|
|
||||||
.btn:hover, .btn:active
|
|
||||||
{
|
|
||||||
background-color: {{ theme.BUTTON_ACTIVE }};
|
|
||||||
}
|
|
||||||
.deletebtn
|
|
||||||
{
|
|
||||||
background-color: red;
|
|
||||||
}
|
|
||||||
.deletebtn:hover
|
|
||||||
{
|
|
||||||
background-color: #ef5350; /* red lighten-1 */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<link href="{{ url_for('static', filename='css/digimarks.css') }}?20180330" type="text/css" rel="stylesheet" media="screen,projection"/>
|
|
||||||
{% if not sortmethod %}
|
|
||||||
{% set sortmethod = None %}
|
|
||||||
{% endif %}
|
|
||||||
{% if not show_as %}
|
|
||||||
{% set show_as = None %}
|
|
||||||
{% endif %}
|
|
||||||
</head>
|
</head>
|
||||||
<body class="{{ theme.BODY }} {{ theme.TEXT }}">
|
<body>
|
||||||
<nav class="{{ theme.NAV }}" role="navigation">
|
|
||||||
<div class="nav-wrapper container"><a id="logo-container" href="{% if userkey %}{{ url_for('bookmarks_page', userkey=userkey, sortmethod=sortmethod, show_as=show_as) }}{% else %}{{ url_for('index') }}{% endif %}" class="brand-logo">digimarks</a>
|
<div id="container" x-data="">
|
||||||
<ul class="right hide-on-med-and-down">
|
|
||||||
{% if userkey %}
|
|
||||||
<li><a href="{{ url_for('tags_page', userkey=userkey) }}" class="waves-effect waves-light btn"><i class="material-icons left">label</i>Tags</a></li>
|
|
||||||
<li><a href="{{ url_for('addbookmark', userkey=userkey) }}" class="waves-effect waves-light btn"><i class="material-icons left">add</i>Add bookmark</a></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{% if userkey %}
|
|
||||||
<ul id="nav-mobile" class="sidenav">
|
|
||||||
<li><a class="waves-effect" href="{{ url_for('bookmarks_page', userkey=userkey) }}"><i class="material-icons left">turned_in</i>Home</a></li>
|
|
||||||
<li><a class="waves-effect" href="{{ url_for('tags_page', userkey=userkey) }}"><i class="material-icons left">label</i>Tags</a></li>
|
|
||||||
<li><a class="waves-effect" href="{{ url_for('addbookmark', userkey=userkey) }}"><i class="material-icons left">add</i>Add bookmark</a></li>
|
|
||||||
</ul>
|
|
||||||
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<div class="section no-pad-bot" id="index-banner">
|
|
||||||
<div class="container">
|
|
||||||
<div class="header {{ theme.PAGEHEADER }}">
|
|
||||||
<h1>{% block pageheader %}Bookmarks{% endblock %}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="container">
|
|
||||||
<div class="section">
|
|
||||||
{% block pagecontent %}
|
{% block pagecontent %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
<script src="/static/js/digimarks.js?v={{ version }}"></script>
|
||||||
<script src="{{ url_for('static', filename='js/init.js') }}?20180309"></script>
|
|
||||||
|
|
||||||
{% block extrajs %}{% endblock %}
|
{% block extrajs %}{% endblock %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
<div class="card-panel orange lighten-2">
|
<div class="card-panel orange lighten-2">
|
||||||
<span class="black-text">
|
<span class="black-text">
|
||||||
If you forgot/lost your personal url, contact your digimarks administrator. On startup, the personal codes are printed to the standard output (so should be findable in a log). Of course, bookmarks.db contains the user information too.
|
If you forgot/lost your personal url, contact your digimarks administrator.{# On startup, the personal codes are printed to the standard output (so should be findable in a log). Of course, bookmarks.db contains the user information too.#}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
10
src/digimarks/templates/user_index.html
Normal file
10
src/digimarks/templates/user_index.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% block title %}Bookmarks{% endblock %}
|
||||||
|
{% block pageheader %}Bookmarks{% endblock %}
|
||||||
|
{% block pagecontent %}
|
||||||
|
|
||||||
|
Welcome user!
|
||||||
|
|
||||||
|
<div x-init="userKey = '{{ user_key }}'"></div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user