mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-07 00:15:10 +01:00
Fix for add/edit bookmark, some theme tweaks
This commit is contained in:
17
digimarks.py
17
digimarks.py
@@ -1,6 +1,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from utilkit import datetimeutil
|
from utilkit import datetimeutil
|
||||||
@@ -131,11 +132,11 @@ def bookmarks(userkey):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/<userkey>/<urlhash>')
|
#@app.route('/<userkey>/<urlhash>')
|
||||||
def viewbookmark(userkey, urlhash):
|
#def viewbookmark(userkey, urlhash):
|
||||||
""" Bookmark detail view """
|
# """ Bookmark detail view """
|
||||||
bookmark = Bookmark.select(Bookmark.url_hash == urlhash, Bookmark.userkey == userkey)
|
# bookmark = Bookmark.select(Bookmark.url_hash == urlhash, Bookmark.userkey == userkey)
|
||||||
return render_template('viewbookmark.html', userkey=userkey, bookmark=bookmark)
|
# return render_template('viewbookmark.html', userkey=userkey, bookmark=bookmark)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/<userkey>/<urlhash>/json')
|
@app.route('/<userkey>/<urlhash>/json')
|
||||||
@@ -145,18 +146,20 @@ def viewbookmarkjson(userkey, urlhash):
|
|||||||
return bookmark.to_dict()
|
return bookmark.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/<userkey>/<urlhash>')
|
||||||
@app.route('/<userkey>/<urlhash>/edit')
|
@app.route('/<userkey>/<urlhash>/edit')
|
||||||
def editbookmark(userkey, urlhash):
|
def editbookmark(userkey, urlhash):
|
||||||
""" Bookmark edit form """
|
""" Bookmark edit form """
|
||||||
# bookmark = getbyurlhash()
|
# bookmark = getbyurlhash()
|
||||||
bookmark = Bookmark(Bookmark.url_hash==urlhash)
|
bookmark = Bookmark.get(Bookmark.url_hash == urlhash)
|
||||||
|
print bookmark.url
|
||||||
return render_template('edit.html', action='Edit bookmark', userkey=userkey, bookmark=bookmark)
|
return render_template('edit.html', action='Edit bookmark', userkey=userkey, bookmark=bookmark)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/<userkey>/add')
|
@app.route('/<userkey>/add')
|
||||||
def addbookmark(userkey):
|
def addbookmark(userkey):
|
||||||
""" Bookmark add form """
|
""" Bookmark add form """
|
||||||
bookmark = Bookmark()
|
bookmark = Bookmark(title='', url='', tags='')
|
||||||
return render_template('edit.html', action='Add bookmark', userkey=userkey, bookmark=bookmark)
|
return render_template('edit.html', action='Add bookmark', userkey=userkey, bookmark=bookmark)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
|
|
||||||
/* label color */
|
/* label color */
|
||||||
.input-field label {
|
.input-field label {
|
||||||
color: #FFF;
|
color: #000;
|
||||||
}
|
}
|
||||||
/* label focus color */
|
/* label focus color */
|
||||||
.input-field input[type=text]:focus + label {
|
.input-field input[type=text]:focus + label {
|
||||||
color: #FFF;
|
color: #000;
|
||||||
}
|
}
|
||||||
/* label underline focus color */
|
/* label underline focus color */
|
||||||
.input-field input[type=text]:focus {
|
.input-field input[type=text]:focus {
|
||||||
border-bottom: 1px solid #FFF;
|
border-bottom: 1px solid #000;
|
||||||
box-shadow: 0 1px 0 0 #FFF;
|
box-shadow: 0 1px 0 0 #000;
|
||||||
}
|
}
|
||||||
/* valid color */
|
/* valid color */
|
||||||
.input-field input[type=text].valid {
|
.input-field input[type=text].valid {
|
||||||
border-bottom: 1px solid #FFF;
|
border-bottom: 1px solid #000;
|
||||||
box-shadow: 0 1px 0 0 #FFF;
|
box-shadow: 0 1px 0 0 #000;
|
||||||
}
|
}
|
||||||
/* invalid color */
|
/* invalid color */
|
||||||
.input-field input[type=text].invalid {
|
.input-field input[type=text].invalid {
|
||||||
border-bottom: 1px solid #FFF;
|
border-bottom: 1px solid #000;
|
||||||
box-shadow: 0 1px 0 0 #FFF;
|
box-shadow: 0 1px 0 0 #000;
|
||||||
}
|
}
|
||||||
/* icon prefix focus color */
|
/* icon prefix focus color */
|
||||||
.input-field .prefix.active {
|
.input-field .prefix.active {
|
||||||
color: #FFF;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
|
||||||
|
|
||||||
<!-- Chrome, Firefox OS and Opera -->
|
<!-- Chrome, Firefox OS and Opera -->
|
||||||
<meta name="theme-color" content="#424242" />
|
<meta name="theme-color" content="#2e7d32" />
|
||||||
<!-- Windows Phone -->
|
<!-- Windows Phone -->
|
||||||
<meta name="msapplication-navbutton-color" content="#424242">
|
<meta name="msapplication-navbutton-color" content="#2e7d32">
|
||||||
<!-- iOS Safari -->
|
<!-- iOS Safari -->
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||||
<link href="{{ url_for('static', filename='css/digimarks.css') }}" type="text/css" rel="stylesheet" media="screen,projection"/>
|
<link href="{{ url_for('static', filename='css/digimarks.css') }}" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||||
</head>
|
</head>
|
||||||
<body class="grey darken-2">
|
<body class="grey lighten-4">
|
||||||
<nav class="green darken-3" role="navigation">
|
<nav class="green darken-3" role="navigation">
|
||||||
<div class="nav-wrapper container"><a id="logo-container" href="{{ url_for('index') }}" class="brand-logo">digimarks</a>
|
<div class="nav-wrapper container"><a id="logo-container" href="{% if userkey %}{{ url_for('bookmarks', userkey=userkey) }}{% else %}{{ url_for('index') }}{% endif %}" class="brand-logo">digimarks</a>
|
||||||
<ul class="right hide-on-med-and-down">
|
<ul class="right hide-on-med-and-down">
|
||||||
{% if userkey %}
|
{% if userkey %}
|
||||||
<li><a href="{{ url_for('tags', userkey=userkey) }}">Tags</a></li>
|
<li><a href="{{ url_for('tags', userkey=userkey) }}">Tags</a></li>
|
||||||
|
|||||||
Reference in New Issue
Block a user