Compare commits
59 Commits
graphs-n-s
...
master
@ -0,0 +1,15 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
setup:
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
|
||||
dev:
|
||||
./bin/dev
|
||||
|
||||
prod:
|
||||
./bin/prod
|
@ -1,40 +1,99 @@
|
||||
# SuchWow!
|
||||
|
||||
TBD
|
||||
Yo. This is a goofy little CRUD app that interacts with wownero-wallet-rpc to allow people to post memes and get tipped in WOW. It uses [Wownero's SSO & Identity service](https://login.wownero.com/developer/docs/backend) as an authentication backend.
|
||||
|
||||
It's lacking a lot of advanced functionality and features....but is pretty rock solid in operation. I rarely have to interact w/ my VPS, it just goes...
|
||||
|
||||
It was created haphazardly and drunkenly (at varying times). It (hopefully) stays true to the core ethos of Wownero (I feel) which is, "fuck it, lgtm, ship it". Rough around the edges but overall works great. Was fun to whip together and a blast to see it grow with a community behind it! Thanks all!
|
||||
|
||||
## Design
|
||||
|
||||
Using the "account" mechanism in the wallets (not subaddresses). Every post gets it's own Wownero account within that running wallet RPC process and is mapped to it. Funds go into the account when tipped. The payout script just checks the balances of each account on an interval and sends funds to the user associated with the artwork associated with said account.
|
||||
|
||||
## Setup
|
||||
|
||||
There are quite a few prerequisites to run the web service:
|
||||
* [register](https://login.wownero.com/developer/register) your app on [Wownero SSO](https://login.wownero.com/developer/docs/backend)
|
||||
* install Wownero binaries/software
|
||||
* setup secrets and config
|
||||
* initialize new Wownero wallet and retain seed
|
||||
* run the wownero-wallet-rpc process
|
||||
* install local system Python dependencies
|
||||
* initialize new sqlite db
|
||||
* setup scheduled tasks to run payouts
|
||||
|
||||
I like to ship with Docker, adjust how you'd prefer.
|
||||
|
||||
```
|
||||
# initialize new wallet and retain seed
|
||||
docker run --rm -it --name suchwow-wallet-init \
|
||||
-v $(pwd)/data:/root \
|
||||
lalanza808/wownero \
|
||||
wownero-wallet-cli \
|
||||
--daemon-address https://node.suchwow.xyz:443 \
|
||||
--generate-new-wallet /root/wow \
|
||||
--password zzzzzz \
|
||||
|
||||
# setup rpc process
|
||||
docker run --rm -d --name suchwow-wallet \
|
||||
-v $(pwd)/data:/root \
|
||||
-p 8888:8888 \
|
||||
lalanza808/wownero \
|
||||
wownero-wallet-rpc \
|
||||
--daemon-address https://node.suchwow.xyz:443 \
|
||||
--wallet-file /root/wow \
|
||||
--password zzzzzz \
|
||||
--rpc-bind-port 8888 \
|
||||
--rpc-bind-ip 0.0.0.0 \
|
||||
--confirm-external-bind \
|
||||
--rpc-login xxxx:yyyy \
|
||||
--log-file /root/rpc.log
|
||||
|
||||
# install python dependencies
|
||||
# setup secrets in env file outside of git
|
||||
cp env-example .env
|
||||
|
||||
# register on wownero sso
|
||||
# https://login.wownero.com/developer/register
|
||||
|
||||
# inject generated keys into suchwow config
|
||||
# create new secrets for new wallet, flask server, data, etc
|
||||
vim .env
|
||||
|
||||
# install docker
|
||||
sudo apt-get install docker.io docker-compose -y
|
||||
usermod -aG docker ubuntu
|
||||
sudo -u ubuntu bash # login w/ new group perms
|
||||
|
||||
# run wownero wallets via docker - store seed, ensure rpc running `docker ps`
|
||||
./run_wallets.sh
|
||||
|
||||
# install python dependencies locally
|
||||
sudo apt-get install python3-venv -y
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
|
||||
# setup secrets in config file outside of git
|
||||
cp suchwow/config.example.py suchwow/config.py
|
||||
vim !$
|
||||
# initialize a new sqlite db
|
||||
./manage.sh init
|
||||
|
||||
# setup recurring payouts
|
||||
# see crontab.txt for cron syntax example
|
||||
crontab -e
|
||||
|
||||
# run a dev server
|
||||
./manage.sh run # access on localhost:5000 - flask local dev, not for prod
|
||||
|
||||
# run a prod server
|
||||
./manage.sh prod # run gunicorn on loopback - pass to nginx reverse proxy
|
||||
|
||||
# kill prod server
|
||||
pkill -e -f gunicorn
|
||||
```
|
||||
|
||||
# Operational Tasks
|
||||
|
||||
You'll want to promote a user as a moderator to review posts:
|
||||
|
||||
```
|
||||
./manage.sh add_admin lza_menace
|
||||
```
|
||||
|
||||
or remove them:
|
||||
|
||||
```
|
||||
./manage.sh remove_admin lza_menace
|
||||
```
|
||||
|
||||
Wallets bug out fairly often. Sometimes you might need to punch in a new daemon or restart a wallet:
|
||||
|
||||
```
|
||||
docker stop suchwow-wallet-rpc
|
||||
docker rm suchwow-wallet-rpc
|
||||
vim .env
|
||||
# modify DAEMON_URI
|
||||
./run_wallets.sh
|
||||
```
|
||||
|
||||
Manually run a payout:
|
||||
|
||||
```
|
||||
./manage.py payout_users
|
||||
```
|
||||
|
||||
There's other shit, but this is the most common. You'll get the hang of it.
|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=suchwow/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=1
|
||||
flask $@
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=suchwow/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=1
|
||||
flask run
|
@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASE=data/gunicorn
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=suchwow/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=0
|
||||
export FLASK_ENV=production
|
||||
|
||||
mkdir -p $BASE
|
||||
|
||||
gunicorn \
|
||||
--bind 0.0.0.0:4000 "suchwow.app:app" \
|
||||
--daemon \
|
||||
--log-file $BASE/gunicorn.log \
|
||||
--pid $BASE/gunicorn.pid \
|
||||
--reload
|
||||
|
||||
echo "Starting gunicorn"
|
@ -0,0 +1,25 @@
|
||||
OIDC_URL=https://login.wownero.com/auth/realms/master/protocol/openid-connect
|
||||
OIDC_CLIENT_ID=suchwow-dev
|
||||
OIDC_CLIENT_SECRET=yyy-yyyyy-yyyyy-yy
|
||||
OIDC_REDIRECT_URL=http://localhost:5000/auth
|
||||
SECRET_KEY=ssssssssssss
|
||||
DATA_FOLDER=/absolute/path/to/the/place/you/store/images
|
||||
SERVER_NAME=localhost:5000
|
||||
WALLET_PATH=/absolute/path/to/the/place/you/store/wallet
|
||||
WALLET_PASS=mytopsecretpass
|
||||
WALLET_HOST=localhost
|
||||
WALLET_PORT=8888
|
||||
WALLET_PROTO=http
|
||||
WALLET_RPC_USER=suchwow
|
||||
WALLET_RPC_PASS=again
|
||||
DAEMON_URI=http://node.suchwow.xyz:34568
|
||||
PRAW_CLIENT_SECRET=xxxx
|
||||
PRAW_CLIENT_ID=xxxxx
|
||||
PRAW_USER_AGENT=xxxxx
|
||||
PRAW_USERNAME=xxxxx
|
||||
PRAW_PASSWORD=xxxx
|
||||
DISCORD_URL=https://xxxx
|
||||
MM_ICON=https://xxxx
|
||||
MM_CHANNEL=xxxx
|
||||
MM_USERNAME=xxxx
|
||||
MM_ENDPOINT=https://xxxx
|
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .venv/bin/activate
|
||||
export FLASK_APP=suchwow/app.py
|
||||
export FLASK_SECRETS=config.py
|
||||
export FLASK_DEBUG=0
|
||||
export FLASK_ENV=production
|
||||
|
||||
# override
|
||||
export $(cat .env)
|
||||
|
||||
if [[ ${1} == "prod" ]];
|
||||
then
|
||||
export BASE=./data/gunicorn
|
||||
mkdir -p $BASE
|
||||
pgrep -F $BASE/gunicorn.pid
|
||||
if [[ $? != 0 ]]; then
|
||||
gunicorn \
|
||||
--bind 127.0.0.1:4000 "suchwow.app:app" \
|
||||
--daemon \
|
||||
--log-file $BASE/gunicorn.log \
|
||||
--pid $BASE/gunicorn.pid \
|
||||
--reload
|
||||
sleep 2
|
||||
echo "Started gunicorn on 127.0.0.1:4000 with pid $(cat $BASE/gunicorn.pid)"
|
||||
fi
|
||||
else
|
||||
flask $@
|
||||
fi
|
@ -0,0 +1,95 @@
|
||||
from os import makedirs
|
||||
|
||||
import click
|
||||
from flask import Blueprint, url_for, current_app
|
||||
|
||||
from suchwow.models import Post, Profile, Comment, Notification, db, Moderator, Ban, AuditEvent
|
||||
from suchwow.utils.helpers import get_latest_tipped_posts
|
||||
from suchwow.utils.helpers import get_top_posters, get_top_posts
|
||||
from suchwow.reddit import make_post
|
||||
from suchwow import wownero
|
||||
from suchwow import config
|
||||
|
||||
bp = Blueprint('cli', 'cli', cli_group=None)
|
||||
|
||||
|
||||
@bp.cli.command("init")
|
||||
def init():
|
||||
# create subdirs
|
||||
for i in ["uploads", "db", "wallet"]:
|
||||
makedirs(f"{config.DATA_FOLDER}/{i}", exist_ok=True)
|
||||
|
||||
# init db
|
||||
db.create_tables([Post, Profile, Comment, Notification, Moderator, Ban, AuditEvent])
|
||||
|
||||
|
||||
@bp.cli.command("post_reddit")
|
||||
@click.argument('last_hours')
|
||||
def post_reddit(last_hours):
|
||||
posts = Post.select().where(
|
||||
Post.approved==True,
|
||||
Post.to_reddit==False
|
||||
).order_by(Post.timestamp.asc())
|
||||
for p in posts:
|
||||
if p.hours_elapsed() < int(last_hours):
|
||||
if not p.to_reddit:
|
||||
_p = make_post(p)
|
||||
if _p:
|
||||
p.to_reddit = True
|
||||
p.save()
|
||||
return
|
||||
|
||||
|
||||
@bp.cli.command("create_accounts")
|
||||
def create_accounts():
|
||||
wallet = wownero.Wallet()
|
||||
for post in Post.select():
|
||||
if post.account_index not in wallet.accounts():
|
||||
account = wallet.new_account()
|
||||
print(f"Created account {account}")
|
||||
|
||||
|
||||
@bp.cli.command("payout_users")
|
||||
def payout_users():
|
||||
wallet = wownero.Wallet()
|
||||
_fa = wownero.from_atomic
|
||||
_aw = wownero.as_wownero
|
||||
for post in Post.select():
|
||||
try:
|
||||
submitter = Profile.get(username=post.submitter)
|
||||
balances = wallet.balances(post.account_index)
|
||||
url = url_for('post.read', id=post.id, _external=True)
|
||||
if balances[1] > 0.05:
|
||||
print(f"Post #{post.id} has {balances[1]} funds unlocked and ready to send. Sweeping all funds to user's address ({submitter.address}).")
|
||||
sweep = wallet.sweep_all(account=post.account_index, dest_address=submitter.address)
|
||||
print(sweep)
|
||||
if "tx_hash_list" in sweep:
|
||||
amount = 0
|
||||
for amt in sweep["amount_list"]:
|
||||
amount += int(amt)
|
||||
except Exception as e:
|
||||
print(f"Failed because: {e}")
|
||||
|
||||
|
||||
@bp.cli.command("show")
|
||||
@click.argument("post_id")
|
||||
def post_id(post_id):
|
||||
p = Post.filter(id=post_id).first()
|
||||
if p:
|
||||
print(p.show())
|
||||
else:
|
||||
print("That post doesn't exist")
|
||||
|
||||
|
||||
@bp.cli.command("load_cache")
|
||||
def load_cache():
|
||||
current_app.logger.info('loading top posters into cache')
|
||||
get_top_posters()
|
||||
current_app.logger.info('done')
|
||||
current_app.logger.info('loading latest tipped into cache')
|
||||
get_latest_tipped_posts()
|
||||
current_app.logger.info('done')
|
||||
for i in [1, 3, 7, 30, 9999]:
|
||||
current_app.logger.info(f'loading top posts last {i} days into cache')
|
||||
get_top_posts(i)
|
||||
current_app.logger.info('done')
|
@ -1,30 +0,0 @@
|
||||
from os import getenv
|
||||
|
||||
|
||||
OIDC_URL = 'https://login.wownero.com/auth/realms/master/protocol/openid-connect',
|
||||
OIDC_CLIENT_ID = 'suchwowxxx',
|
||||
OIDC_CLIENT_SECRET = 'xxxxxxxxxx',
|
||||
OIDC_REDIRECT_URL = 'http://localhost:5000/auth'
|
||||
SECRET_KEY = 'yyyyyyyyyyyyy',
|
||||
SESSION_TYPE = 'filesystem'
|
||||
DATA_FOLDER = '/path/to/the/uploads'
|
||||
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
|
||||
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
|
||||
WALLET_HOST = 'localhost'
|
||||
WALLET_PORT = 8888
|
||||
WALLET_PROTO = 'http'
|
||||
WALLET_USER = 'suchwow'
|
||||
WALLET_PASS = 'zzzzzzzzzzzzzzz'
|
||||
PRAW_CLIENT_SECRET = 'xxxxxxxx'
|
||||
PRAW_CLIENT_ID = 'xxxxxxxx'
|
||||
PRAW_USER_AGENT = 'suchwow-yyyy-python'
|
||||
PRAW_USERNAME = 'xxxxxxxx'
|
||||
PRAW_PASSWORD = 'xxxxxxxx'
|
||||
SERVER_NAME = 'localhost'
|
||||
DISCORD_URL = 'xxxxxxx'
|
||||
BANNED_USERS = {'username': 'reason for the ban'}
|
||||
|
||||
MM_ICON = getenv('MM_ICON', 'https://funding.wownero.com/static/wowdoge-a.jpg')
|
||||
MM_CHANNEL = getenv('MM_CHANNEL', 'suchwow')
|
||||
MM_USERNAME = getenv('MM_USERNAME', 'SuchWow!')
|
||||
MM_ENDPOINT = getenv('MM_ENDPOINT', 'ppppppppppppppppppppppppp')
|
@ -0,0 +1,45 @@
|
||||
from os import getenv
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# generated from https://login.wownero.com/developer/register
|
||||
OIDC_URL = getenv('OIDC_URL', 'https://login.wownero.com/auth/realms/master/protocol/openid-connect')
|
||||
OIDC_CLIENT_ID = getenv('OIDC_CLIENT_ID', 'suchwow-dev')
|
||||
OIDC_CLIENT_SECRET = getenv('OIDC_CLIENT_SECRET', '')
|
||||
OIDC_REDIRECT_URL = getenv('OIDC_REDIRECT_URL', 'http://localhost:5000/auth')
|
||||
|
||||
# you specify something
|
||||
SECRET_KEY = getenv('SECRET_KEY', 'yyyyyyyyyyyyy') # whatever you want it to be
|
||||
DATA_FOLDER = getenv('DATA_FOLDER', '/path/to/uploads') # some stable storage path
|
||||
SERVER_NAME = getenv('SERVER_NAME', 'localhost') # name of your DNS resolvable site (.com)
|
||||
SUPER_ADMIN = getenv('SUPER_ADMIN', 'lza_menace') # top dawg you cannot delete
|
||||
WALLET_HOST = getenv('WALLET_HOST', 'localhost') #
|
||||
WALLET_PORT = int(getenv('WALLET_PORT', 8888)) #
|
||||
WALLET_PROTO = getenv('WALLET_PROTO', 'http') #
|
||||
WALLET_RPC_USER = getenv('WALLET_RPC_USER', 'suchwow') #
|
||||
WALLET_RPC_PASS = getenv('WALLET_RPC_PASS', 'suchwow') #
|
||||
WALLET_PASS = getenv('WALLET_PASS', 'zzzzzzz') # You specify all these wallet details in .env
|
||||
|
||||
# Optional for posting to Reddit
|
||||
PRAW_CLIENT_SECRET = getenv('PRAW_CLIENT_SECRET', None)
|
||||
PRAW_CLIENT_ID = getenv('PRAW_CLIENT_ID', None)
|
||||
PRAW_USER_AGENT = getenv('PRAW_USER_AGENT', None)
|
||||
PRAW_USERNAME = getenv('PRAW_USERNAME', None)
|
||||
PRAW_PASSWORD = getenv('PRAW_PASSWORD', None)
|
||||
|
||||
# Optional for posting to Discord
|
||||
DISCORD_URL = getenv('DISCORD_URL', None)
|
||||
|
||||
# Optional for posting to Mattermost
|
||||
MM_ICON = getenv('MM_ICON', 'https://funding.wownero.com/static/wowdoge-a.jpg')
|
||||
MM_CHANNEL = getenv('MM_CHANNEL', 'suchwow')
|
||||
MM_USERNAME = getenv('MM_USERNAME', 'SuchWow!')
|
||||
MM_ENDPOINT = getenv('MM_ENDPOINT', 'ppppppppppppppppppppppppp')
|
||||
|
||||
# defaults
|
||||
SESSION_TYPE = 'filesystem'
|
||||
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif', 'svg', 'mp4'}
|
||||
MAX_CONTENT_LENGTH = 32 * 1024 * 1024
|
||||
TEMPLATES_AUTO_RELOAD = getenv('TEMPLATES_AUTO_RELOAD', True)
|
@ -0,0 +1,24 @@
|
||||
from flask import Blueprint
|
||||
from arrow import get as arrow_get
|
||||
|
||||
from suchwow.models import Moderator
|
||||
|
||||
|
||||
bp = Blueprint('filters', 'filters')
|
||||
|
||||
@bp.app_template_filter('shorten_address')
|
||||
def shorten_address(a):
|
||||
_p = a[0:4]
|
||||
_s = a[-4:]
|
||||
return f'{_p}...{_s}'
|
||||
|
||||
@bp.app_template_filter('humanize')
|
||||
def humanize(d):
|
||||
return arrow_get(d).humanize()
|
||||
|
||||
@bp.app_template_filter('is_moderator')
|
||||
def is_moderator(s):
|
||||
m = Moderator.select().where(Moderator.username == s)
|
||||
if m:
|
||||
return True
|
||||
return False
|
@ -1,30 +0,0 @@
|
||||
from flask import render_template, Blueprint, flash
|
||||
from flask import request, redirect, url_for, session
|
||||
from suchwow.models import Post, Comment, Profile
|
||||
from suchwow.utils.decorators import login_required
|
||||
|
||||
|
||||
bp = Blueprint("comment", "comment")
|
||||
|
||||
@bp.route("/comment/create/post/<post_id>", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def create(post_id):
|
||||
if not Post.filter(id=post_id):
|
||||
flash("WTF, that post doesn't exist. Stop it, hackerman.")
|
||||
return redirect(url_for("index"))
|
||||
|
||||
if request.method == "POST":
|
||||
comment_text = request.form.get("comment")
|
||||
if len(comment_text) > 300:
|
||||
flash("WTF, too many characters to post, asshole.")
|
||||
return redirect(request.url)
|
||||
commenter = Profile.get(username=session["auth"]["preferred_username"])
|
||||
post = Post.get(id=post_id)
|
||||
c = Comment(
|
||||
comment=comment_text,
|
||||
commenter=commenter,
|
||||
post=post,
|
||||
)
|
||||
c.save()
|
||||
return redirect(url_for("post.read", id=post_id))
|
||||
return render_template("comment/create.html")
|
@ -1,28 +1,25 @@
|
||||
from os import path
|
||||
from flask import render_template, Blueprint, request, session, flash
|
||||
from flask import send_from_directory, redirect, url_for, current_app
|
||||
from werkzeug.utils import secure_filename
|
||||
from suchwow import wownero
|
||||
from suchwow.models import Post
|
||||
from flask import render_template, Blueprint, request
|
||||
|
||||
from suchwow.utils.helpers import get_top_posters, get_top_posts
|
||||
|
||||
|
||||
bp = Blueprint("leaderboard", "leaderboard")
|
||||
|
||||
@bp.route("/leaderboard")
|
||||
def leaderboard():
|
||||
top_posters = {}
|
||||
posts = Post.select().where(Post.approved==True)
|
||||
for post in posts:
|
||||
transfers = []
|
||||
incoming = wownero.Wallet().incoming_transfers(post.account_index)
|
||||
if "transfers" in incoming:
|
||||
for xfer in incoming["transfers"]:
|
||||
transfers.append(wownero.from_atomic(xfer["amount"]))
|
||||
total = sum(transfers)
|
||||
if post.submitter not in top_posters:
|
||||
top_posters[post.submitter] = {"amount": 0, "posts": []}
|
||||
@bp.route("/leaderboards/top_posters")
|
||||
def top_posters():
|
||||
top_posters = get_top_posters()
|
||||
return render_template("leaderboard.html", posters=top_posters)
|
||||
|
||||
@bp.route("/leaderboards/top_posts")
|
||||
def top_posts():
|
||||
days = request.args.get('days', 1)
|
||||
try:
|
||||
days = int(days)
|
||||
except:
|
||||
days = 1
|
||||
|
||||
top_posters[post.submitter]["amount"] += float(total)
|
||||
top_posters[post.submitter]["posts"].append(post)
|
||||
if days not in [1, 3, 7, 30, 9999]:
|
||||
days = 7
|
||||
|
||||
return render_template("leaderboard.html", posters=top_posters)
|
||||
posts = get_top_posts(days)
|
||||
return render_template("post/top.html", posts=posts, days=days)
|
||||
|
@ -0,0 +1,50 @@
|
||||
from math import ceil
|
||||
|
||||
from flask import Blueprint, request, render_template, flash
|
||||
|
||||
from suchwow.models import Post, Profile, Moderator
|
||||
from suchwow.utils.helpers import get_latest_tipped_posts
|
||||
|
||||
bp = Blueprint('main', 'main')
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
def index():
|
||||
itp = 15
|
||||
page = request.args.get("page", 1)
|
||||
submitter = request.args.get("submitter", None)
|
||||
content = request.args.get("content", None)
|
||||
|
||||
if content == 'latest_tipped':
|
||||
posts = get_latest_tipped_posts()
|
||||
return render_template(
|
||||
"index.html",
|
||||
posts=posts[0:30],
|
||||
title="Latest Tipped Memes"
|
||||
)
|
||||
|
||||
try:
|
||||
page = int(page)
|
||||
except:
|
||||
flash("Wow, wtf hackerman. Cool it.", "is-danger")
|
||||
page = 1
|
||||
|
||||
posts = Post.select().where(Post.approved==True).order_by(Post.timestamp.desc())
|
||||
if submitter:
|
||||
posts = posts.where(Post.submitter==submitter)
|
||||
|
||||
paginated_posts = posts.paginate(page, itp)
|
||||
total_pages = ceil(posts.count() / itp)
|
||||
return render_template(
|
||||
"index.html",
|
||||
posts=paginated_posts,
|
||||
page=page,
|
||||
total_pages=total_pages,
|
||||
title="Latest Memes"
|
||||
)
|
||||
|
||||
|
||||
@bp.route("/about")
|
||||
def about():
|
||||
mods = Profile.select().join(Moderator, on=(Profile.username == Moderator.username))
|
||||
return render_template("about.html", mods=mods)
|
@ -0,0 +1,114 @@
|
||||
from flask import Blueprint, render_template, redirect, url_for, flash, request
|
||||
|
||||
from suchwow.models import AuditEvent, Post, Profile, Moderator, Ban, get_ban_reason
|
||||
from suchwow.utils.decorators import moderator_required
|
||||
from suchwow.utils.helpers import get_session_user, audit_event
|
||||
from suchwow import config
|
||||
|
||||
|
||||
bp = Blueprint("mod", "mod")
|
||||
|
||||
@bp.route('/mods')
|
||||
@moderator_required
|
||||
def main():
|
||||
live_posts = Post.select().where(Post.approved == True).count()
|
||||
pending_posts = Post.select().where(Post.approved == False).count()
|
||||
active_posters = Profile.select().join(Post, on=Post.submitter == Profile.username).distinct().count()
|
||||
mods = Moderator.select().count()
|
||||
return render_template(
|
||||
'mod/main.html',
|
||||
live_posts=live_posts,
|
||||
pending_posts=pending_posts,
|
||||
active_posters=active_posters,
|
||||
mods=mods
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/mods/pending')
|
||||
@moderator_required
|
||||
def pending_posts():
|
||||
posts = Post.select().where(Post.approved == False).order_by(Post.timestamp.asc())
|
||||
if not posts:
|
||||
flash('no posts pending', 'is-warning')
|
||||
return redirect(url_for('mod.main'))
|
||||
return render_template('mod/posts.html', posts=posts)
|
||||
|
||||
|
||||
@bp.route('/mods/manage', methods=['GET', 'POST'])
|
||||
@moderator_required
|
||||
def manage_mods():
|
||||
to_delete = request.args.get('delete')
|
||||
if to_delete:
|
||||
m = Moderator.select().where(Moderator.username == to_delete).first()
|
||||
if not m:
|
||||
flash('No moderator exists with that name', 'is-danger')
|
||||
elif m.username == get_session_user():
|
||||
flash('Cannot remove yourself.', 'is-danger')
|
||||
elif m.username == config.SUPER_ADMIN:
|
||||
flash('Cannot delete super admin you son-of-a-bitch.', 'is-danger')
|
||||
else:
|
||||
m.delete_instance()
|
||||
audit_event(f'Deleted {to_delete} from mods')
|
||||
flash(f'Removed {to_delete} from mods!', 'is-success')
|
||||
return redirect(url_for('mod.manage_mods'))
|
||||
if request.method == 'POST':
|
||||
to_add = request.form.get('username', None)
|
||||
if to_add:
|
||||
u = Profile.select().where(Profile.username == to_add).first()
|
||||
if not u:
|
||||
flash('That user does not appear to exist (no profile setup yet)', 'is-danger')
|
||||
elif Moderator.select().where(Moderator.username == to_add).first():
|
||||
flash(f'{to_add} is already a mod, ya dingus.', 'is-warning')
|
||||
else:
|
||||
m = Moderator(username=to_add)
|
||||
m.save()
|
||||
audit_event(f'Added {to_add} to mods')
|
||||
flash(f'Added {to_add} to mods!', 'is-success')
|
||||
mods = Profile.select().join(Moderator, on=(Profile.username == Moderator.username))
|
||||
return render_template('mod/manage.html', mods=mods)
|
||||
|
||||
|
||||
@bp.route('/mods/bans', methods=['GET', 'POST'])
|
||||
@moderator_required
|
||||
def manage_bans():
|
||||
to_delete = request.args.get('delete')
|
||||
if to_delete:
|
||||
ban = Ban.select().join(Profile).where(Profile.username == to_delete).first()
|
||||
if not ban:
|
||||
flash('No ban exists for that user', 'is-danger')
|
||||
elif ban.user == get_session_user():
|
||||
flash('Cannot ban yourself.', 'is-danger')
|
||||
elif ban.user == config.SUPER_ADMIN:
|
||||
flash('Cannot ban super admin you son-of-a-bitch.', 'is-danger')
|
||||
else:
|
||||
ban.delete_instance()
|
||||
audit_event(f'Removed ban on {to_delete}')
|
||||
flash(f'Unbanned {to_delete}!', 'is-success')
|
||||
return redirect(url_for('mod.manage_bans'))
|
||||
if request.method == 'POST':
|
||||
to_add = request.form.get('username', None)
|
||||
if to_add:
|
||||
u = Profile.select().where(Profile.username == to_add).first()
|
||||
if not u:
|
||||
flash('That user does not appear to exist (no profile setup yet)', 'is-danger')
|
||||
elif Ban.select().join(Profile).where(Profile.username == to_add).first():
|
||||
flash(f'{to_add} is already banned, ya dingus.', 'is-warning')
|
||||
elif to_add == config.SUPER_ADMIN:
|
||||
flash('Cannot ban the super admin you son-of-a-bitch.', 'is-danger')
|
||||
else:
|
||||
reason = request.form.get('reason')
|
||||
if not reason:
|
||||
reason = get_ban_reason()
|
||||
ban = Ban(user=u, reason=reason)
|
||||
ban.save()
|
||||
audit_event(f'Banned {to_add} ({reason})')
|
||||
flash(f'Banned {to_add}!', 'is-success')
|
||||
bans = Ban.select()
|
||||
return render_template('mod/bans.html', bans=bans)
|
||||
|
||||
|
||||
@bp.route('/mods/logs')
|
||||
@moderator_required
|
||||
def view_logs():
|
||||
events = AuditEvent.select().order_by(AuditEvent.timestamp.desc()).limit(50)
|
||||
return render_template('mod/logs.html', logs=events)
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,342 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.0.0-beta.2 (https://getbootstrap.com)
|
||||
* Copyright 2011-2017 The Bootstrap Authors
|
||||
* Copyright 2011-2017 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.15;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
-ms-overflow-style: scrollbar;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
@-ms-viewport {
|
||||
width: device-width;
|
||||
}
|
||||
|
||||
article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: #212529;
|
||||
text-align: left;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
[tabindex="-1"]:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
hr {
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title],
|
||||
abbr[data-original-title] {
|
||||
text-decoration: underline;
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
address {
|
||||
margin-bottom: 1rem;
|
||||
font-style: normal;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: .5rem;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
background-color: transparent;
|
||||
-webkit-text-decoration-skip: objects;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #0056b3;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
-ms-overflow-style: scrollbar;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: middle;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
a,
|
||||
area,
|
||||
button,
|
||||
[role="button"],
|
||||
input:not([type="range"]),
|
||||
label,
|
||||
select,
|
||||
summary,
|
||||
textarea {
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
caption {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
color: #868e96;
|
||||
text-align: left;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
outline: 1px dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
button,
|
||||
html [type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
input[type="radio"],
|
||||
input[type="checkbox"] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input[type="date"],
|
||||
input[type="time"],
|
||||
input[type="datetime-local"],
|
||||
input[type="month"] {
|
||||
-webkit-appearance: listbox;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: .5rem;
|
||||
font-size: 1.5rem;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[type="search"] {
|
||||
outline-offset: -2px;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
[type="search"]::-webkit-search-cancel-button,
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
output {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-reboot.css.map */
|
@ -1,8 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.0.0-beta.2 (https://getbootstrap.com)
|
||||
* Copyright 2011-2017 The Bootstrap Authors
|
||||
* Copyright 2011-2017 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}
|
||||
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
body {
|
||||
background-image: url("/static/bg.png");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
|
||||
.current-page-btn {
|
||||
color: blue;
|
||||
border: 1px blue solid;
|
||||
}
|
@ -1,793 +0,0 @@
|
||||
body {
|
||||
padding-top: 54px;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
body {
|
||||
padding-top: 56px;
|
||||
}
|
||||
}
|
||||
.center {
|
||||
text-align: center;
|
||||
margin: 0 auto 0 auto;
|
||||
}
|
||||
.navbar {
|
||||
padding: .1rem 1rem;
|
||||
}
|
||||
|
||||
.navbar .navbar-brand img#logo{
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.navbar .navbar-brand img#text{
|
||||
width:235px;
|
||||
margin-top: -4px;
|
||||
padding-top: 0px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.navbar-nav .nav-link{
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif
|
||||
}
|
||||
|
||||
.container>div:first-child {
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.mb-4, .my-4{
|
||||
margin-top:0 !important;
|
||||
}
|
||||
|
||||
.mt-4, .my-4 {
|
||||
margin-top: 0rem !important;
|
||||
}
|
||||
|
||||
.proposal-info-table td {
|
||||
padding: .35rem !important;
|
||||
}
|
||||
|
||||
.proposal_address {
|
||||
white-space: pre-wrap;
|
||||
padding: 2px;
|
||||
border-radius: 2px;
|
||||
margin-top: 6px;
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
font-size: 18px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.proposal_content blockquote {
|
||||
background-color: #efefef;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.proposal_content h1, .proposal_content h2, .proposal_content h3, .proposal_content h4{
|
||||
margin-bottom: 16px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.proposal_content p {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.proposal_content img {
|
||||
margin-top:8px;
|
||||
margin-bottom:8px;
|
||||
max-width: 70%;
|
||||
}
|
||||
|
||||
.proposal_content code {
|
||||
background: #ebebeb;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.table td, .table th {
|
||||
padding: 0.35rem;
|
||||
}
|
||||
|
||||
/* Sticky footer styles
|
||||
-------------------------------------------------- */
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
body {
|
||||
margin-bottom: 60px; /* Margin bottom by footer height */
|
||||
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;
|
||||
background-image: url("/static/bg.png");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.bg-dark {
|
||||
background: linear-gradient(90deg, #d253c8, #ffa93e);
|
||||
}
|
||||
|
||||
.navbar-dark .navbar-brand {
|
||||
color: #fff;
|
||||
font-size: 18pt;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
text-shadow: 2px 2px #667ff952;
|
||||
font-family: "Comic Sans MS", "Comic Sans", cursive;
|
||||
}
|
||||
|
||||
.table-proposal td {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.table-proposal tbody td:first-child{
|
||||
word-break: break-word;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.table-hover tbody tr:hover {
|
||||
background-color: rgba(0,0,0,.055);
|
||||
}
|
||||
|
||||
.table th, .table td {
|
||||
border-top: 1px solid #00000029;
|
||||
padding-top: .65rem;
|
||||
}
|
||||
|
||||
.table-tilted{
|
||||
-ms-transform: rotate(0.5deg);
|
||||
-webkit-transform: rotate(0.5deg);
|
||||
transform: rotate(0.5deg);
|
||||
}
|
||||
|
||||
.table-tilted-v{
|
||||
-ms-transform: rotate(-0.2deg);
|
||||
-webkit-transform: rotate(-0.2deg);
|
||||
transform: rotate(-0.2deg);
|
||||
}
|
||||
|
||||
.table-no-header thead{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.table-wow{
|
||||
background-image: url(https://wownero.win/static/game-table-bg.png);
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.table a{
|
||||
color: #006400;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
border-bottom: 1px solid #00000029 !important;
|
||||
border-top: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.table tbody td.date {
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
.table tbody td.user {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.table tbody td{
|
||||
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
|
||||
color: #495057;
|
||||
background-color: #fff;
|
||||
border-left-color: #008926;
|
||||
border-left-width: 2px;
|
||||
border-top-color: #008926;
|
||||
border-top-width: 1px;
|
||||
border-right-color: #008926;
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link {
|
||||
border: 1px solid transparent;
|
||||
border-top-left-radius: .25rem;
|
||||
border-top-right-radius: .25rem;
|
||||
border-bottom-color: #008926;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover {
|
||||
border-color: #e9ecef #e9ecef #dee2e6;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover {
|
||||
border-color: #00892630 #00892630 #008926;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #008926;
|
||||
}
|
||||
|
||||
.btn-group-toggle a{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-group-toggle a:hover{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.btn-primary{
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.btn-primary:hover{
|
||||
color: #fff;
|
||||
background-color: #1e7e34;
|
||||
border-color: #1c7430;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
background-color: #00000008;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #ffffff00;
|
||||
border: 0px solid rgba(0,0,0,.125);
|
||||
border-radius: .25rem;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
padding: 0.5rem;
|
||||
padding-left: 1.0rem;
|
||||
font-size: 16px;
|
||||
margin-bottom: 0;
|
||||
background-color: rgba(0,0,0,.03);
|
||||
background: linear-gradient(90deg, #d253c829, #ffa93e69);
|
||||
/*background: linear-gradient(90deg, #40d61e1f, #ffa93e69);*/
|
||||
border-radius: calc(.25rem - 1px) calc(.25rem - 1px) 0 0;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
border-bottom: 0px;
|
||||
}
|
||||
|
||||
.proposal_content{
|
||||
background-color: #00000008;
|
||||
padding: 1.25rem 1.25rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
padding: .375rem .75rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: #495057;
|
||||
background-color: #fff;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #008926;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.form-group:last-of-type {
|
||||
margin-bottom:2.5rem;
|
||||
}
|
||||
/*fuku chrome*/
|
||||
input {
|
||||
outline:none;
|
||||
}
|
||||
input:focus {
|
||||
outline: 0;
|
||||
}
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
input[type="text"], textarea {
|
||||
outline: none;
|
||||
box-shadow:none !important;
|
||||
border: 1px solid #008926 !important;
|
||||
}
|
||||
|
||||
.navbar-dark .navbar-nav .nav-link {
|
||||
color: white;
|
||||
padding-top: 0.4rem;
|
||||
padding-bottom: 0.4rem;
|
||||
font-size: 15px;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
.navbar-nav .nav-item {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
nav .nav-link{
|
||||
color: white;
|
||||
}
|
||||
|
||||
nav .nav-link .active{
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.proposal-info-table td{
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.proposal-info-table td span.badge{
|
||||
font-size:20px;
|
||||
}
|
||||
|
||||
.table-proposal .progress {
|
||||
max-width: 70px !important;
|
||||
min-width: 50px !important;
|
||||
float:right;
|
||||
}
|
||||
|
||||
.table-proposal .progress-bar {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px #000000;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
background-color: #009845;
|
||||
transition: width .6s ease;
|
||||
font-family: monospace;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
#point-wow-left{
|
||||
display: inline;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
.proposal-info-table tr:first-child>td, .proposal-info-table tr:first-child>td>span {
|
||||
font-size: 28px !important;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
.navbar-dark .navbar-brand {
|
||||
font-size: 13pt;
|
||||
}
|
||||
|
||||
.proposal-info-table tr:first-child>td, .proposal-info-table tr:first-child>td>span {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
.proposal-info-table td span.badge {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.proposal_content {
|
||||
background-color: #00000008;
|
||||
padding: 0.1rem 0.75rem;
|
||||
}
|
||||
|
||||
.card-body{
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
#point-wow-left{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.table-proposal thead th#date, .table-proposal tbody td#date{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.table-proposal, .table-proposal td{
|
||||
font-size:14px !important;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-brand-mobile{
|
||||
display: block !important;
|
||||
color: white;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
pre.proposal_address{
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size:12px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
#point-wow-left {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
textarea.comment{
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
padding-bottom: 6px;
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.votearrow {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border: 0px;
|
||||
margin: 3px 2px 6px;
|
||||
margin-right: 10px;
|
||||
margin-top: 7px;
|
||||
background: url(/static/grayarrow.gif) no-repeat;
|
||||
}
|
||||
|
||||
span.username a{
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
font-size: 12pt;
|
||||
color: #828282;
|
||||
}
|
||||
|
||||
.comment-container a.reply{
|
||||
margin-bottom:2px;
|
||||
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;
|
||||
font-size: 11pt;
|
||||
text-decoration: underline;
|
||||
color: black;
|
||||
}
|
||||
|
||||
span.date_posted a{
|
||||
color: #828282;
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
font-size: 10pt;
|
||||
margin-left:2px;
|
||||
}
|
||||
|
||||
.comment-container .comment-container{
|
||||
margin-top: 0.4rem !important;
|
||||
}
|
||||
|
||||
.comment-container, .comment-container .comment-container{
|
||||
margin-bottom: 0.4rem !important;
|
||||
font-family: serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
span.username a.author{
|
||||
color: #008926;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
:target {
|
||||
background: linear-gradient(90deg, #ff606008, #ffa93e2b);
|
||||
}
|
||||
|
||||
.form-admin{
|
||||
border: 1px solid #b60000;
|
||||
}
|
||||
|
||||
ul.b {
|
||||
list-style-type: square;
|
||||
padding-left: 1.0rem;
|
||||
}
|
||||
|
||||
.media-body #comment{
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.api_documentation code{
|
||||
background-color: #f3f3f3;
|
||||
padding: 4px;
|
||||
padding-top:2px;
|
||||
padding-bottom:2px;
|
||||
}
|
||||
|
||||
.api_documentation pre{
|
||||
margin-top:0;
|
||||
background-color: #f3f3f3;
|
||||
padding: 4px;
|
||||
font-size: 12px;
|
||||
padding-left:8px;
|
||||
|
||||
white-space: pre-wrap; /* Since CSS 2.1 */
|
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
||||
.api_documentation .api_container hr{
|
||||
margin-bottom: 14px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.api_documentation .api_container{
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.sidebar .card-body{
|
||||
padding-top: 1rem;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.sidebar .card-body ul.b{
|
||||
margin-bottom:0;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
border-radius: 10px 0 0 !important;
|
||||
}
|
||||
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-1.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-2.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-3.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-4.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-5.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-6.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/static/fonts/roboto-7.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
.proposal-overview .table-proposal[data-status="4"] {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.proposal-overview .table-proposal[data-status="4"] thead th {
|
||||
border-bottom: 1px solid #4b4b4b !important;
|
||||
}
|
||||
|
||||
.proposal-overview .table-proposal[data-status="4"] td {
|
||||
border-top: 1px solid #4b4b4b;
|
||||
}
|
||||
|
||||
.proposal-overview .table-proposal[data-status="4"], .proposal-overview .table-proposal[data-status="4"] a {
|
||||
color: #4b4b4b;
|
||||
}
|
||||
|
||||
.comments-panel {
|
||||
background-color: #ffffffb0;
|
||||
}
|
||||
|
||||
.wow_addy{
|
||||
color: red;
|
||||
cursor: pointer;
|
||||
font-family: monospace;
|
||||
background: #f6f6f6;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.wow_addy[data-active="true"]{
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.proposal_qr{
|
||||
margin-top:8px;
|
||||
margin-bottom:8px;
|
||||
}
|
||||
|
||||
.table-proposal tr {
|
||||
background: #00000005;
|
||||
}
|
||||
|
||||
.tx_item {
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
background: #ffffff80;
|
||||
}
|
||||
|
||||
.tx_item .amount {
|
||||
float:right;
|
||||
font-weight:bold;
|
||||
color:#890000;
|
||||
}
|
||||
|
||||
.tx_item .amount.in {
|
||||
color:#008926;
|
||||
}
|
||||
|
||||
.tx_item .datetime {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.tx_item .height b {
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.container>.content h1,
|
||||
.container>.content h2,
|
||||
.container>.content h3,
|
||||
.container>.content h4{
|
||||
margin-bottom:20px;
|
||||
}
|
||||
|
||||
|
||||
.comment-container .media-body span.body {
|
||||
word-wrap: break-word;
|
||||
display: block;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.comment-container .media-body span.body img {
|
||||
width: 100%;
|
||||
max-width:500px;
|
||||
max-height:600px;
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
margin-top:0
|
||||
margin-bottom:0
|
||||
padding-top:0
|
||||
padding-bottom:0;
|
||||
}
|
||||
|
||||
.card h5{
|
||||
color: #0000009e;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.wowtable{
|
||||
width:100%;
|
||||
display: block;
|
||||
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
|
||||
}
|
||||
.wowtable .trow{
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
display: table;
|
||||
}
|
||||
.wowtable .trow .item{
|
||||
float:right;
|
||||
width:100px;
|
||||
}
|
||||
.wowtable .trow .item.one{
|
||||
width:30%;
|
||||
min-width: 200px;
|
||||
}
|
||||
.wowtable .trow .item.small{
|
||||
max-width:100px;
|
||||
text-align:right;
|
||||
}
|
||||
.wowtable .trow.header .item span {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
padding-top:6px;
|
||||
display: block;
|
||||
}
|
||||
.wowtable .trow .item.comments{
|
||||
max-width:70px;
|
||||
text-align: center;
|
||||
}
|
||||
.wowtable .trow .item.big{
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
float: left;
|
||||
width: auto;
|
||||
max-width: 50%;
|
||||
}
|
||||
.wowtable .trow.header .item.big span{
|
||||
padding-left:7px;
|
||||
padding-top:3px;
|
||||
font-size:18px;
|
||||
word-break: break-word;
|
||||
}
|
||||
.trow.divider{
|
||||
height:1px;
|
||||
background: #00000029 !important;
|
||||
}
|
||||
.wowtable .trow.body .item span {
|
||||
font-size:14px;
|
||||
padding-top:6px;
|
||||
display: block;
|
||||
}
|
||||
.wowtable .trow.body .item.big a {
|
||||
display: block;
|
||||
padding-left: 7px;
|
||||
color: #006400;
|
||||
padding-top: 6px;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
word-break: break-word;
|
||||
}
|
||||
.wowtable .trow span.alignl{
|
||||
text-align:left;
|
||||
padding-left:7px;
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 990px) {
|
||||
|
||||
.wowtable .small{
|
||||
display:none
|
||||
}
|
||||
.wowtable .trow .item.big{
|
||||
max-width: 88%;
|
||||
}
|
||||
}
|
||||
|
||||
.subtext {
|
||||
color: grey;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.flashes {
|
||||
text-align: center;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.navbar-nav {
|
||||
flex-direction: row;
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
After Width: | Height: | Size: 174 KiB |
@ -1,19 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container" style="width:40%;">
|
||||
<div class="submit">
|
||||
<h1>Leave a Comment</h1>
|
||||
<form method=post enctype=multipart/form-data class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="inlineFormInput">Text</label>
|
||||
<input type="text" class="form-control mb-2 mr-sm-2 mb-sm-0" id="inlineFormInput" placeholder="Comment text (max 300 chars)" name="comment">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -0,0 +1,51 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container" style="text-align:center;">
|
||||
<h1 class="title">Manage Mods</h1>
|
||||
<section class="section">
|
||||
{% for ban in bans %}
|
||||
<article class="message" style="width: 30%; margin: 2em auto;">
|
||||
<div class="message-header">
|
||||
<p>{{ ban.user.username }}</p>
|
||||
<a href="?delete={{ ban.user.username }}" class="delete"></a>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
{{ ban.reason }}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</section>
|
||||
<div class="container" style="text-align:left; width: 30%;">
|
||||
<form method="post">
|
||||
<div class="field">
|
||||
<label class="label">Ban User</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" placeholder="Username" name="username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Reason</label>
|
||||
<div class="control">
|
||||
<textarea class="textarea" placeholder="Reason for ban" name="reason"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-link">Submit</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-link is-light">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}{% endblock %}
|
@ -0,0 +1,23 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container" style="text-align:center;">
|
||||
<h1 class="title">View Logs</h1>
|
||||
<section class="section">
|
||||
{% for log in logs %}
|
||||
<article class="message" style="width: 40%; margin: 1em auto;">
|
||||
<div class="message-header">
|
||||
<p>{{ log.user.username }} - {{ log.timestamp | humanize }} </p>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
{{ log.action }}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}{% endblock %}
|
@ -0,0 +1,72 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container content" style="padding-top: 4em;">
|
||||
|
||||
|
||||
<nav class="level">
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Live Memes</p>
|
||||
<p class="title">{{ live_posts }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Pending Memes</p>
|
||||
<p class="title">{{ pending_posts }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Active Posters</p>
|
||||
<p class="title">{{ active_posters }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Mods</p>
|
||||
<p class="title">{{ mods }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="tabs is-toggle is-fullwidth">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ url_for('mod.pending_posts') }}">
|
||||
<span class="icon is-small"></span>
|
||||
<span>Manage Queue</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('mod.manage_bans') }}">
|
||||
<span class="icon is-small"></span>
|
||||
<span>Manage Bans</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('mod.manage_mods') }}">
|
||||
<span class="icon is-small"></span>
|
||||
<span>Manage Mods</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('mod.view_logs') }}">
|
||||
<span class="icon is-small"></span>
|
||||
<span>View Logs</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<figure>
|
||||
<img src="https://suchwow.xyz/uploads/pg1VwHJWeKT5dWXy-wowcomfysemifinal.gif">
|
||||
</figure>
|
||||
<div style="padding-bottom:10em;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}{% endblock %}
|
@ -0,0 +1,42 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container" style="text-align:center;">
|
||||
<h1 class="title">Manage Mods</h1>
|
||||
<section class="section">
|
||||
{% for mod in mods %}
|
||||
<div class="block">
|
||||
<span class="tag is-large">
|
||||
{{ mod.username }}
|
||||
<a href="?delete={{ mod.username }}" class="delete"></a>
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
<div class="container" style="text-align:left; width: 30%;">
|
||||
<form method="post">
|
||||
<div class="field">
|
||||
<label class="label">Add New Mod</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" placeholder="Username" name="username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-link">Submit</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-link is-light">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}{% endblock %}
|
@ -0,0 +1,61 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container" style="text-align:center;">
|
||||
|
||||
<h1 class="title">Pending Posts</h1>
|
||||
<section class="section">
|
||||
{% if posts %}
|
||||
{% for row in posts | batch(4) %}
|
||||
<div class="columns">
|
||||
{% for p in row %}
|
||||
{% set post = p.show() %}
|
||||
<div class="column">
|
||||
<div class="card">
|
||||
<div class="card-image">
|
||||
<a href="{{ url_for('post.read', id=p.id) }}">
|
||||
{% if p.get_image_path().endswith('mp4') %}
|
||||
<video style="max-height: 100vh!important;" controls>
|
||||
<source src="{{ url_for('post.uploaded_file', filename=p.image_name) }}" type="video/mp4">
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
{% else %}
|
||||
<img alt="SuchWow #{{ post.id }} - {{ post.title }} by {{ post.submitter }}" src="{{ url_for('post.uploaded_file', filename=post.thumbnail_name) }}" />
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="media">
|
||||
<div class="media-content">
|
||||
<p class="title is-4">
|
||||
<a href="{{ url_for('post.read', id=p.id) }}">{{ post.title }}</a>
|
||||
</p>
|
||||
<p class="subtitle is-6"><a href="/?submitter={{ post.submitter }}">{{ post.submitter }}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
{{ post.text | truncate(60) }}
|
||||
<time datetime="2016-1-1">{{ post.timestamp.year }}-{{ post.timestamp.month }}-{{ post.timestamp.day }} {{ post.timestamp.hour }}:{{ post.timestamp.minute }} UTC</time>
|
||||
<p>({{ post.timestamp | humanize }})</p>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="card-footer">
|
||||
<a href="{{ url_for('post.approve', id=post.id) }}" class="card-footer-item" style="color:green;"><strong>Approve</strong></a>
|
||||
<a href="{{ url_for('post.delete', id=post.id) }}" class="card-footer-item" style="color:red;"><strong>Deny</strong></a>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>No posts pending!</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}{% endblock %}
|
@ -1,77 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container" style="text-align:center;">
|
||||
|
||||
<h3>Stats</h3>
|
||||
|
||||
<div style="width: 100%; text-align: center;">
|
||||
<div class="charts">
|
||||
<canvas id="wow_wallet"></canvas>
|
||||
<canvas id="wow_earnings"></canvas>
|
||||
<canvas id="swap_stats"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/Chart.bundle.min.js"></script>
|
||||
<script>
|
||||
var monero = '#f96b0e';
|
||||
var set_title = function(t){
|
||||
return {
|
||||
display: true,
|
||||
text: t,
|
||||
fontColor: 'white',
|
||||
}
|
||||
}
|
||||
|
||||
{% for i in wow_txes %}
|
||||
// console.log("{{ i['in'] }}")
|
||||
{% endfor %}
|
||||
|
||||
{#
|
||||
var ctx = document.getElementById('wow_wallet').getContext('2d');
|
||||
new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [0, {% for i in wow_txes %}'{{ wow_txes[i].timestamp }}',{% endfor %}],
|
||||
datasets: [{
|
||||
label: 'Balance',
|
||||
backgroundColor: wownero,
|
||||
borderColor: wownero,
|
||||
data: [
|
||||
0, {% for i in wow_txes %}{{ wow_txes[i].total }},{% endfor %}
|
||||
],
|
||||
fill: false,
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
title: set_title('Wownero Wallet Balance')
|
||||
}
|
||||
});
|
||||
|
||||
var ctx = document.getElementById('wow_earnings').getContext('2d');
|
||||
new Chart(ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['WOW', 'USD'],
|
||||
datasets: [{
|
||||
label: 'Wownero Earnings',
|
||||
backgroundColor: wownero,
|
||||
borderColor: wownero,
|
||||
data: [
|
||||
{{ earnings['wow'] | from_atomic_wow }}, {{ earnings['wow_as_ausd'] | from_atomic_usd }}
|
||||
],
|
||||
fill: false,
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
title: set_title('Wownero Earnings')
|
||||
}
|
||||
});
|
||||
#}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue