Compare commits

...

No commits in common. 'master' and 'refactor' have entirely different histories.

@ -5,7 +5,7 @@ Wownero yellow pages web-application - lookup the WOW address of users.
### Installation
```bash
git clone gitea@git.wownero.com:wownero/YellWOWPages.git
git clone gitea@git.wownero.com:muchwowmining/YellWOWPages.git
cd YellWOWPages
pip install -r requirements.txt

@ -1,5 +1,3 @@
peewee
quart
Quart-Keycloak
uvicorn
redis
quart_session_openid

@ -13,9 +13,7 @@ async def api_root():
@bp_api.get('/user/')
async def api_all():
q = User.select()
q = q.where(User.address.is_null(False))
return jsonify([u.to_json(ignore_key='id') for u in q])
return jsonify([u.to_json(ignore_key='id') for u in User.select()])
@bp_api.get('/user/<path:needle>')

@ -1,34 +1,28 @@
import re
import peewee
from quart import session, redirect, url_for, current_app
from quart_keycloak import Keycloak, KeycloakAuthToken, KeycloakLogoutRequest
from yellow.factory import keycloak
from quart import session, redirect, url_for
from yellow.factory import openid
from yellow.models import User
@keycloak.after_login()
async def handle_user_login(auth_token: KeycloakAuthToken):
username = auth_token.username
uid = auth_token.sub
@openid.after_token()
async def handle_user_login(resp: dict):
access_token = resp["access_token"]
openid.verify_token(access_token)
if not re.match(r"^[a-zA-Z0-9_\.-]+$", username):
raise Exception("bad username")
user = await openid.user_info(access_token)
username = user['preferred_username']
uid = user['sub']
try:
user = User.select().where(User.username == username).get()
except Exception as ex:
user = User.select().where(User.id == uid).get()
except peewee.DoesNotExist:
user = None
if not user:
# create new user if it does not exist yet
current_app.logger.info(f'User {username} not found, creating')
try:
user = User.create(id=uid, username=username)
except Exception as ex:
current_app.logger.debug(f'User {username}, creation error')
raise
user = User.create(id=uid, username=username)
# user is now logged in
session['user'] = user.to_json()
return redirect(url_for('bp_routes.dashboard'))
return redirect(url_for('bp_routes.root'))

@ -1,19 +1,17 @@
import os
import logging
from datetime import datetime
import asyncio
from quart import Quart, url_for, jsonify, render_template, session
from quart_session_openid import OpenID
from quart_session import Session
from quart_keycloak import Keycloak, KeycloakAuthToken, KeycloakLogoutRequest
from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware
import settings
app: Quart = None
peewee = None
cache = None
keycloak = None
openid: OpenID = None
async def _setup_database(app: Quart):
@ -25,8 +23,8 @@ async def _setup_database(app: Quart):
async def _setup_openid(app: Quart):
global keycloak
keycloak = Keycloak(app, **settings.OPENID_CFG)
global openid
openid = OpenID(app, **settings.OPENID_CFG)
from yellow.auth import handle_user_login
@ -54,20 +52,18 @@ async def _setup_error_handlers(app: Quart):
def create_app():
global app
app = Quart(__name__)
if settings.X_FORWARDED:
app.asgi_app = ProxyHeadersMiddleware(app.asgi_app, trusted_hosts=["127.0.0.1", "10.1.0.1"])
app.logger.setLevel(logging.INFO)
app.secret_key = settings.APP_SECRET
@app.context_processor
def template_variables():
global openid
from yellow.models import User
current_user = session.get('user')
if current_user:
current_user = User(**current_user)
now = datetime.now()
return dict(user=current_user, url_login=keycloak.endpoint_name_login, year=now.year)
return dict(user=current_user, url_login=openid.endpoint_name_login)
@app.before_serving
async def startup():

@ -12,25 +12,16 @@ db = SqliteDatabase(settings.DB_PATH)
class User(pw.Model):
id = pw.UUIDField(primary_key=True)
created: datetime = pw.DateTimeField(default=datetime.now)
created = pw.DateTimeField(default=datetime.now)
username = pw.CharField(unique=True, null=False)
address = pw.CharField(null=True)
@property
def created_dt(self):
return self.created.strftime('%Y-%m-%d')
@staticmethod
async def search(needle) -> List['User']:
if not needle:
raise Exception("need search term")
needle = needle.replace("*", "")
needle = needle.lower()
return User.select().where(
User.address.is_null(False),
User.username % f"*{needle}*"
)
if len(needle) <= 2:
raise Exception("need longer search term")
return User.select().where(User.username % f"*{needle}*")
def to_json(self, ignore_key=None):
data = {

@ -1,7 +1,7 @@
from quart import render_template, request, redirect, url_for, jsonify, Blueprint, abort, flash, send_from_directory, session
import re
from yellow import login_required
from yellow.factory import openid
from yellow.models import User
bp_routes = Blueprint('bp_routes', __name__)
@ -14,8 +14,7 @@ async def root():
@bp_routes.route("/login")
async def login():
from yellow.factory import keycloak
return redirect(url_for(keycloak.endpoint_name_login))
return redirect(url_for(openid.endpoint_name_login))
@bp_routes.route("/logout")
@ -34,6 +33,7 @@ async def dashboard():
@bp_routes.post("/dashboard/address")
@login_required
async def dashboard_address_post():
# get FORM POST value 'address'
form = await request.form
address = form.get('address')
if len(address) != 97:
@ -49,52 +49,21 @@ async def dashboard_address_post():
return await render_template('dashboard.html')
@bp_routes.post("/dashboard/address/delete")
@login_required
async def dashboard_address_delete():
from yellow.models import User
user = User.select().filter(User.id == session['user']['id']).get()
user.address = None
user.save()
session['user'] = user.to_json()
return redirect(url_for("bp_routes.dashboard"))
@bp_routes.route("/search")
async def search():
needle = request.args.get('username')
if needle:
if len(needle) <= 2:
raise Exception("Search term needs to be longer")
users = [u for u in await User.search(needle)]
if users:
return await render_template('search_results.html', users=users)
else:
return await render_template('search_results.html')
q = User.select()
q = q.where(User.address.is_null(False))
q = q.limit(100)
users = [u for u in q]
users = [u for u in User.select()]
return await render_template('search.html', users=users)
@bp_routes.route("/user/<path:name>")
async def user_page(name: str):
if not name:
raise Exception("invalid name")
name = name.lower()
try:
_user = User.select().where(
User.username == name,
User.address.is_null(False)
).get()
except:
return abort(404)
return await render_template('user.html', users=[_user])
@bp_routes.route("/about")
async def about():
return await render_template('about.html')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="375pt" height="375pt" viewBox="0 0 375 375" version="1.1">
<g id="surface3">
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 99.648438 98.910156 L 99.648438 179.484375 C 99.648438 187.300781 105.941406 193.589844 113.753906 193.589844 L 242.765625 193.589844 C 250.578125 193.589844 256.871094 187.300781 256.871094 179.484375 L 256.871094 98.910156 L 221.128906 98.910156 L 221.128906 154.394531 L 178.261719 111.53125 L 135.398438 154.394531 L 135.398438 98.910156 Z M 99.648438 98.910156 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 113.753906 36.371094 C 105.941406 36.371094 99.648438 42.660156 99.648438 50.476562 L 99.648438 85.464844 L 149.703125 85.464844 L 149.703125 120.382812 L 178.261719 91.820312 L 206.820312 120.382812 L 206.820312 85.464844 L 256.867188 85.464844 L 256.867188 50.476562 C 256.867188 42.660156 250.570312 36.371094 242.757812 36.371094 Z M 113.753906 36.371094 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 268.632812 45.644531 C 272.359375 45.644531 275.359375 48.640625 275.359375 52.375 L 275.359375 79.082031 C 275.359375 82.8125 272.359375 85.8125 268.632812 85.8125 L 265.109375 85.8125 L 265.109375 45.644531 Z M 268.632812 45.644531 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 268.632812 94.898438 C 272.359375 94.898438 275.359375 97.898438 275.359375 101.632812 L 275.359375 128.339844 C 275.359375 132.066406 272.359375 135.070312 268.632812 135.070312 L 265.109375 135.070312 L 265.109375 94.898438 Z M 268.632812 94.898438 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 268.632812 144.15625 C 272.359375 144.15625 275.359375 147.15625 275.359375 150.882812 L 275.359375 177.59375 C 275.359375 181.324219 272.359375 184.328125 268.632812 184.328125 L 265.109375 184.328125 L 265.109375 144.15625 Z M 268.632812 144.15625 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 31.40625 298.785156 L 38.140625 298.785156 L 38.140625 276.308594 L 61.617188 231.539062 L 54.242188 231.539062 L 34.683594 269.214844 L 15.570312 231.539062 L 8.109375 231.539062 L 31.40625 276.308594 Z M 31.40625 298.785156 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 68.695312 298.785156 L 105.460938 298.785156 L 105.460938 292.691406 L 75.429688 292.691406 L 75.429688 267.847656 L 104.457031 267.847656 L 104.457031 261.75 L 75.429688 261.75 L 75.429688 237.636719 L 105.460938 237.636719 L 105.460938 231.539062 L 68.695312 231.539062 Z M 68.695312 298.785156 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 117.484375 298.785156 L 152.066406 298.785156 L 152.066406 292.691406 L 124.21875 292.691406 L 124.21875 231.539062 L 117.484375 231.539062 Z M 117.484375 298.785156 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 159.507812 298.785156 L 194.085938 298.785156 L 194.085938 292.691406 L 166.242188 292.691406 L 166.242188 231.539062 L 159.507812 231.539062 Z M 159.507812 298.785156 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 230.054688 230.351562 C 210.761719 230.351562 194.472656 246.09375 194.472656 264.746094 C 194.472656 284.3125 210.308594 299.964844 230.140625 299.964844 C 249.527344 299.964844 265.542969 284.21875 265.542969 265.199219 C 265.542969 246 249.527344 230.351562 230.054688 230.351562 Z M 230.054688 236.539062 C 245.796875 236.539062 258.714844 249.550781 258.714844 265.292969 C 258.714844 280.855469 245.703125 293.773438 230.140625 293.773438 C 214.125 293.773438 201.292969 280.855469 201.292969 264.929688 C 201.292969 249.550781 214.492188 236.539062 230.054688 236.539062 Z M 230.054688 236.539062 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 288.375 298.785156 L 297.109375 298.785156 L 311.851562 243.640625 L 326.773438 298.785156 L 335.421875 298.785156 L 354.707031 231.542969 L 347.792969 231.542969 L 331.230469 290.046875 L 315.125 231.542969 L 308.753906 231.542969 L 292.648438 290.046875 L 276.089844 231.542969 L 269.171875 231.542969 Z M 288.375 298.785156 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 360.15625 298.785156 L 366.890625 298.785156 L 366.890625 287.320312 L 360.15625 287.320312 Z M 360.15625 298.785156 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 18.453125 338.078125 L 22.597656 338.078125 L 29.589844 311.917969 L 36.671875 338.078125 L 40.773438 338.078125 L 49.921875 306.175781 L 46.644531 306.175781 L 38.785156 333.9375 L 31.140625 306.175781 L 28.125 306.175781 L 20.484375 333.9375 L 12.621094 306.175781 L 9.34375 306.175781 Z M 18.453125 338.078125 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 68.515625 305.625 C 59.359375 305.625 51.636719 313.09375 51.636719 321.945312 C 51.636719 331.226562 59.144531 338.652344 68.558594 338.652344 C 77.753906 338.652344 85.351562 331.179688 85.351562 322.15625 C 85.351562 313.050781 77.753906 305.625 68.515625 305.625 Z M 68.515625 308.558594 C 75.980469 308.558594 82.113281 314.734375 82.113281 322.203125 C 82.113281 329.585938 75.941406 335.71875 68.558594 335.71875 C 60.960938 335.71875 54.875 329.585938 54.875 322.03125 C 54.875 314.734375 61.132812 308.558594 68.515625 308.558594 Z M 68.515625 308.558594 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 96.203125 338.078125 L 100.347656 338.078125 L 107.339844 311.917969 L 114.417969 338.078125 L 118.519531 338.078125 L 127.671875 306.175781 L 124.390625 306.175781 L 116.53125 333.9375 L 108.890625 306.175781 L 105.867188 306.175781 L 98.234375 333.9375 L 90.371094 306.175781 L 87.089844 306.175781 Z M 96.203125 338.078125 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 131.421875 338.078125 L 134.613281 338.078125 L 134.613281 310.019531 L 153.609375 338.078125 L 156.800781 338.078125 L 156.800781 306.175781 L 153.609375 306.175781 L 153.609375 332.636719 L 135.738281 306.175781 L 131.421875 306.175781 Z M 131.421875 338.078125 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 163.363281 338.078125 L 180.804688 338.078125 L 180.804688 335.1875 L 166.558594 335.1875 L 166.558594 323.398438 L 180.328125 323.398438 L 180.328125 320.507812 L 166.558594 320.507812 L 166.558594 309.066406 L 180.804688 309.066406 L 180.804688 306.175781 L 163.363281 306.175781 Z M 163.363281 338.078125 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 198.726562 326.148438 C 204.859375 325.5 208.140625 322.128906 208.140625 316.386719 C 208.140625 312.417969 206.453125 309.394531 203.34375 307.710938 C 201.363281 306.632812 198.636719 306.15625 194.410156 306.15625 L 186.507812 306.15625 L 186.507812 338.0625 L 189.703125 338.0625 L 189.703125 309.046875 L 194.195312 309.046875 C 197.558594 309.046875 199.804688 309.394531 201.53125 310.214844 C 203.691406 311.25 204.898438 313.40625 204.898438 316.304688 C 204.898438 319.925781 203.257812 322.21875 200.0625 323.039062 C 198.554688 323.429688 196.480469 323.597656 192.9375 323.597656 L 203.691406 338.0625 L 207.660156 338.0625 Z M 198.726562 326.148438 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 228.199219 305.625 C 219.042969 305.625 211.320312 313.09375 211.320312 321.945312 C 211.320312 331.226562 218.828125 338.652344 228.238281 338.652344 C 237.4375 338.652344 245.035156 331.179688 245.035156 322.15625 C 245.035156 313.050781 237.4375 305.625 228.195312 305.625 Z M 228.199219 308.558594 C 235.664062 308.558594 241.796875 314.734375 241.796875 322.203125 C 241.796875 329.585938 235.621094 335.71875 228.238281 335.71875 C 220.640625 335.71875 214.554688 329.585938 214.554688 322.03125 C 214.554688 314.734375 220.816406 308.558594 228.199219 308.558594 Z M 228.199219 308.558594 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 250.097656 338.078125 L 253.289062 338.078125 L 253.289062 332.636719 L 250.097656 332.636719 Z M 250.097656 338.078125 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 287.386719 329.710938 C 286.050781 331.398438 285.273438 332.257812 284.195312 333.078125 C 282.035156 334.761719 279.1875 335.710938 276.292969 335.710938 C 268.867188 335.710938 262.828125 329.625 262.828125 322.113281 C 262.828125 314.429688 268.609375 308.554688 276.25 308.554688 C 279.015625 308.554688 281.605469 309.292969 283.71875 310.71875 C 285.148438 311.621094 286.007812 312.574219 287.21875 314.472656 L 290.800781 314.472656 C 288.339844 308.988281 282.730469 305.621094 276.125 305.621094 C 266.625 305.621094 259.589844 312.699219 259.589844 322.242188 C 259.589844 331.609375 266.796875 338.648438 276.335938 338.648438 C 282.8125 338.648438 287.734375 335.625 290.929688 329.710938 Z M 287.386719 329.710938 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 310.894531 305.625 C 301.738281 305.625 294.015625 313.09375 294.015625 321.945312 C 294.015625 331.226562 301.523438 338.652344 310.9375 338.652344 C 320.132812 338.652344 327.730469 331.179688 327.730469 322.15625 C 327.730469 313.050781 320.132812 305.625 310.894531 305.625 Z M 310.894531 308.558594 C 318.359375 308.558594 324.492188 314.734375 324.492188 322.203125 C 324.492188 329.585938 318.320312 335.71875 310.9375 335.71875 C 303.339844 335.71875 297.25 329.585938 297.25 322.03125 C 297.25 314.734375 303.511719 308.558594 310.894531 308.558594 Z M 310.894531 308.558594 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 332.90625 338.078125 L 336.097656 338.078125 L 336.097656 309.671875 L 348.054688 338.078125 L 350.820312 338.078125 L 362.820312 309.671875 L 362.820312 338.078125 L 366.015625 338.078125 L 366.015625 306.175781 L 361.050781 306.175781 L 349.484375 333.328125 L 337.867188 306.175781 L 332.90625 306.175781 Z M 332.90625 338.078125 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="375pt" height="375pt" viewBox="0 0 375 375" version="1.1">
<g id="surface10">
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 32.453125 159.164062 L 32.453125 301.363281 C 32.453125 315.15625 43.554688 326.257812 57.347656 326.257812 L 285.03125 326.257812 C 298.828125 326.257812 309.925781 315.15625 309.925781 301.363281 L 309.925781 159.164062 L 246.84375 159.164062 L 246.84375 257.085938 L 171.195312 181.4375 L 95.546875 257.085938 L 95.546875 159.164062 Z M 32.453125 159.164062 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 57.347656 48.785156 C 43.554688 48.785156 32.453125 59.882812 32.453125 73.679688 L 32.453125 135.429688 L 120.785156 135.429688 L 120.785156 197.054688 L 171.191406 146.644531 L 221.597656 197.054688 L 221.597656 135.429688 L 309.921875 135.429688 L 309.921875 73.679688 C 309.921875 59.882812 298.820312 48.785156 285.023438 48.785156 Z M 57.347656 48.785156 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,80.000001%,0%);fill-opacity:1;" d="M 330.6875 65.148438 C 337.269531 65.148438 342.5625 70.445312 342.5625 77.027344 L 342.5625 124.164062 C 342.5625 130.746094 337.269531 136.046875 330.6875 136.046875 L 324.472656 136.046875 L 324.472656 65.148438 Z M 330.6875 65.148438 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 330.6875 152.078125 C 337.269531 152.078125 342.5625 157.378906 342.5625 163.953125 L 342.5625 211.097656 C 342.5625 217.679688 337.269531 222.972656 330.6875 222.972656 L 324.472656 222.972656 L 324.472656 152.078125 Z M 330.6875 152.078125 "/>
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(100%,16.470589%,83.137256%);fill-opacity:1;" d="M 330.6875 239.015625 C 337.269531 239.015625 342.5625 244.304688 342.5625 250.890625 L 342.5625 298.03125 C 342.5625 304.609375 337.269531 309.90625 330.6875 309.90625 L 324.472656 309.90625 L 324.472656 239.015625 Z M 330.6875 239.015625 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

@ -9,7 +9,6 @@
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
<link rel="stylesheet" href="{{ url_for('static', filename='colors.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='icon.css') }}">
<link rel="icon" href="{{ url_for('static', filename='1.svg') }}">
</head>
<style>
html, body{
@ -44,9 +43,6 @@
#dropdown:hover #dropdowncontent {
display: block;
}
#dropdowncontent a {
display: block;
}
#main{
width: 100%;
height: 80vh;
@ -57,19 +53,7 @@
font-size: bold;
font-size: 10rem;
}
#root{
display: flex;
gap: 1rem;
font-weight: 800;
font-size: 2rem;
align-items: center;
}
img{
width: 500px;
height: 500px;
object-fit: contain;
}
#wow{
width: 50px;
height: 50px;
object-fit: contain;
@ -81,7 +65,7 @@
}
@media (max-width: 800px) {
main{
font-size: 3rem;
font-size: 4rem;
}
}
</style>
@ -93,7 +77,7 @@
</div>
<div id="footer">
{{ year }} - ... [the future is w0w]
2022 - ... [the future is w0w]
</div>
</body>
</html>

@ -5,7 +5,7 @@
</div>
<div id="main">
<article style="min-width: 620px">
<article>
<Header>Welcome back <em>{{user.username}}</em>!</Header>
Current <u>WOW address</u>: <label>
{% if user.address %}
@ -18,10 +18,7 @@
Change <u>WOW address</u>:
<form action="{{ url_for('bp_routes.dashboard_address_post') }}" method="POST">
<input type="text" name="address">
<button data-tooltip="Make sure it is correct!">Submit</button>
</form>
<form action="{{ url_for('bp_routes.dashboard_address_delete') }}" method="POST">
<button class="secondary" data-tooltip="Remove address from YelloWOWPages">Delete</button>
<button data-tooltip="Be sure it's correct">Submit</button>
</form>
</footer>

@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="3; URL={{url}}">
<title>Such {{code}} error :(</title>
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
<link rel="stylesheet" href="../../static/colors.css">

@ -3,25 +3,23 @@
<li>
<div id="dropdown">
<i class="icon icon-menu"></i>
<div id="dropdowncontent">
<a href="{{ url_for('bp_routes.root') }}">Home</a>
{% if not user %}
<a href="{{ url_for('bp_routes.login') }}">Login</a>
{% else %}
<a href="{{ url_for('bp_routes.dashboard') }}">My Profile</a>
{% endif %}
<a href="{{ url_for('bp_routes.search') }}">Search</a>
<a href="{{ url_for('bp_routes.about') }}">About</a>
<a href="{{ url_for('bp_api.api_root') }}">Api</a>
{% if user %}
<a href="{{ url_for('bp_routes.logout') }}">Logout</a>
{% endif %}
<p>
{% if not user %}
<a href="{{ url_for('bp_routes.login') }}">Login</a>
{% else %}
<a href="{{ url_for('bp_routes.logout') }}">Logout</a>
{% endif %}
<a href="{{ url_for('bp_routes.dashboard') }}">Dashboard</a>
<a href="{{ url_for('bp_routes.search') }}">Yell<span>WOW</span>Page search</a>
<a href="{{ url_for('bp_routes.about') }}">About</a>
<a href="{{ url_for('bp_api.api_root') }}">Api</a>
</p>
</div>
</div>
</li>
</ul>
<ul>
<li><a href="https://git.wownero.com/wownero/YellWOWPages"><i class="icon icon-edit"></i></a></li>
<li><a href="https://git.wownero.com/muchwowmining/YellWOWPages"><i class="icon icon-edit"></i></a></li>
</ul>
</nav>

@ -1,3 +0,0 @@
<form action="{{ url_for('bp_routes.search') }}" method="GET">
<input type="text" name="username" placeholder="Search for an username...">
</form>

@ -1,11 +0,0 @@
<div id="addresses">
{% for user in users %}
<article>
<header>
<em><a href="{{ url_for('bp_routes.user_page', name=user.username) }}">{{user.username}}</a></em>
<small style="float: right">Added: {{ user.created_dt }}</small>
</header>
<kbd>{{user.address}}</kbd>
</article>
{% endfor %}
</div>

@ -5,19 +5,12 @@
</div>
<div id="main">
<div id="root">
<img src="{{ url_for('static', filename='1-ico.svg') }}" alt="">
<div style="flex-direction: column;">
<div>
The first <img src="{{ url_for('static', filename='wownero.png') }}" alt="" id="wow"> addresses library <br>
from the community, for the community.
</div>
<div>
<a style="text-decoration: none;" href="{{ url_for('bp_routes.search') }}">
<button style="max-width:320px;">start searching</button>
</a>
</div>
</div>
<main>
<strong>Yell<span>WOW</span>Pages</strong>
</main>
<div>
The first <img src="../../static/wownero.png" alt=""> addresses library -
from the community to the community
</div>
</div>

@ -5,9 +5,20 @@
</div>
<div id="main">
{% include 'includes/search.html' %}
<form action="{{ url_for('bp_routes.search') }}" method="GET">
<input type="text" name="username" placeholder="Search for an username...">
</form>
{% include 'includes/user_results.html' %}
<div id="addresses">
{% for user in users %}
<article>
<header>
<em>{{user.username}}</em>
</header>
<kbd>{{user.address}}</kbd>
</article>
{% endfor %}
</div>
</div>
<style>
@ -31,7 +42,13 @@
#addresses::-webkit-scrollbar {
display: none;
}
#footer {
height: 12vh;
width: 100%;
text-align: center;
}
@media (max-width: 800px) {
kbd {
width: 100vw;

@ -5,15 +5,25 @@
</div>
<div id="main">
{% include 'includes/search.html' %}
<form action="{{ url_for('bp_routes.search') }}" method="GET">
<input type="text" name="username" placeholder="Username to search">
</form>
<br>
Result(s): {{users|length}}
{% if not users %}
<br>Nothing found...
Nothing found...
{% else %}
{% include 'includes/user_results.html' %}
<div id="addresses">
{% for user in users %}
<article>
<header>
<em>{{user.username}}</em>
</header>
<kbd>{{user.address}}</kbd>
</article>
{% endfor %}
</div>
{% endif %}
</div>
@ -35,6 +45,11 @@
#addresses::-webkit-scrollbar{
display: none;
}
#footer{
height: 12vh;
width: 100%;
text-align: center;
}
@media (max-width: 800px) {
kbd{
width: 100vw;

@ -1,42 +0,0 @@
{% extends "base.html" %}
{% block content %}
<div style="display:none">
{% block title %}YellWOWPages - User{% endblock %}
</div>
<div id="main">
{% include 'includes/search.html' %}
{% if not users %}
<br>Nothing found...
{% else %}
{% include 'includes/user_results.html' %}
{% endif %}
</div>
<style>
#main{
width: 100%;
height: 80vh;
display: grid;
place-content: center;
}
form{
height: 80px;
}
#addresses{
width: 100%;
height: 50vh;
overflow-y: auto;
}
#addresses::-webkit-scrollbar{
display: none;
}
@media (max-width: 800px) {
kbd{
width: 100vw;
}
}
</style>
{% endblock %}
Loading…
Cancel
Save