mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05:10 +01:00
Fix for add/edit bookmark, some theme tweaks
This commit is contained in:
19
digimarks.py
19
digimarks.py
@@ -1,6 +1,7 @@
|
||||
import datetime
|
||||
import hashlib
|
||||
import os
|
||||
import sys
|
||||
import requests
|
||||
|
||||
from utilkit import datetimeutil
|
||||
@@ -126,16 +127,16 @@ def bookmarks(userkey):
|
||||
# return render_template('bookmarks.html', bookmarks)
|
||||
#else:
|
||||
# abort(404)
|
||||
bookmarks = Bookmark.select(Bookmark.userkey==userkey)
|
||||
bookmarks = Bookmark.select(Bookmark.userkey == userkey)
|
||||
return render_template('bookmarks.html', bookmarks=bookmarks, userkey=userkey)
|
||||
|
||||
|
||||
|
||||
@app.route('/<userkey>/<urlhash>')
|
||||
def viewbookmark(userkey, urlhash):
|
||||
""" Bookmark detail view """
|
||||
bookmark = Bookmark.select(Bookmark.url_hash == urlhash, Bookmark.userkey == userkey)
|
||||
return render_template('viewbookmark.html', userkey=userkey, bookmark=bookmark)
|
||||
#@app.route('/<userkey>/<urlhash>')
|
||||
#def viewbookmark(userkey, urlhash):
|
||||
# """ Bookmark detail view """
|
||||
# bookmark = Bookmark.select(Bookmark.url_hash == urlhash, Bookmark.userkey == userkey)
|
||||
# return render_template('viewbookmark.html', userkey=userkey, bookmark=bookmark)
|
||||
|
||||
|
||||
@app.route('/<userkey>/<urlhash>/json')
|
||||
@@ -145,18 +146,20 @@ def viewbookmarkjson(userkey, urlhash):
|
||||
return bookmark.to_dict()
|
||||
|
||||
|
||||
@app.route('/<userkey>/<urlhash>')
|
||||
@app.route('/<userkey>/<urlhash>/edit')
|
||||
def editbookmark(userkey, urlhash):
|
||||
""" Bookmark edit form """
|
||||
# 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)
|
||||
|
||||
|
||||
@app.route('/<userkey>/add')
|
||||
def addbookmark(userkey):
|
||||
""" Bookmark add form """
|
||||
bookmark = Bookmark()
|
||||
bookmark = Bookmark(title='', url='', tags='')
|
||||
return render_template('edit.html', action='Add bookmark', userkey=userkey, bookmark=bookmark)
|
||||
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
|
||||
/* label color */
|
||||
.input-field label {
|
||||
color: #FFF;
|
||||
color: #000;
|
||||
}
|
||||
/* label focus color */
|
||||
.input-field input[type=text]:focus + label {
|
||||
color: #FFF;
|
||||
color: #000;
|
||||
}
|
||||
/* label underline focus color */
|
||||
.input-field input[type=text]:focus {
|
||||
border-bottom: 1px solid #FFF;
|
||||
box-shadow: 0 1px 0 0 #FFF;
|
||||
border-bottom: 1px solid #000;
|
||||
box-shadow: 0 1px 0 0 #000;
|
||||
}
|
||||
/* valid color */
|
||||
.input-field input[type=text].valid {
|
||||
border-bottom: 1px solid #FFF;
|
||||
box-shadow: 0 1px 0 0 #FFF;
|
||||
border-bottom: 1px solid #000;
|
||||
box-shadow: 0 1px 0 0 #000;
|
||||
}
|
||||
/* invalid color */
|
||||
.input-field input[type=text].invalid {
|
||||
border-bottom: 1px solid #FFF;
|
||||
box-shadow: 0 1px 0 0 #FFF;
|
||||
border-bottom: 1px solid #000;
|
||||
box-shadow: 0 1px 0 0 #000;
|
||||
}
|
||||
/* icon prefix focus color */
|
||||
.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"/>
|
||||
|
||||
<!-- Chrome, Firefox OS and Opera -->
|
||||
<meta name="theme-color" content="#424242" />
|
||||
<meta name="theme-color" content="#2e7d32" />
|
||||
<!-- Windows Phone -->
|
||||
<meta name="msapplication-navbutton-color" content="#424242">
|
||||
<meta name="msapplication-navbutton-color" content="#2e7d32">
|
||||
<!-- iOS Safari -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<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="{{ url_for('static', filename='css/digimarks.css') }}" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||
</head>
|
||||
<body class="grey darken-2">
|
||||
<body class="grey lighten-4">
|
||||
<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">
|
||||
{% if userkey %}
|
||||
<li><a href="{{ url_for('tags', userkey=userkey) }}">Tags</a></li>
|
||||
|
||||
Reference in New Issue
Block a user