first commit of the varia library website
This commit is contained in:
commit
6bb95fb52e
BIN
library/csvparser/__pycache__/csvparser.cpython-39.pyc
Normal file
BIN
library/csvparser/__pycache__/csvparser.cpython-39.pyc
Normal file
Binary file not shown.
24
library/csvparser/csvparser.py
Normal file
24
library/csvparser/csvparser.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import csv
|
||||||
|
import os
|
||||||
|
|
||||||
|
script_dir = os.path.dirname(__file__)
|
||||||
|
|
||||||
|
|
||||||
|
def parsecsv():
|
||||||
|
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r")
|
||||||
|
with libcsv:
|
||||||
|
csv_as_dict = csv.DictReader(libcsv)
|
||||||
|
return csv_as_dict
|
||||||
|
|
||||||
|
|
||||||
|
def getpublications():
|
||||||
|
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r")
|
||||||
|
with libcsv:
|
||||||
|
csv_as_dict = csv.DictReader(libcsv)
|
||||||
|
listofbooks = []
|
||||||
|
for row in csv_as_dict:
|
||||||
|
listofbooks.append(row["Publication"])
|
||||||
|
return listofbooks
|
||||||
|
|
||||||
|
|
||||||
|
parsecsv()
|
22
library/csvparser/varlib.csv
Normal file
22
library/csvparser/varlib.csv
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
Id,Publication,Author,Year,Custodian,Fields,Pubtype,Publishers,License,Highlights,Comments,"Borrowedby"
|
||||||
|
1,"The Economics of Anarchism",Anarcho,2012,Varia,"Economics, Anarchism",Zine,theanarchistlibrary.org,Anti-copyright,"""The labourer retains, even after he has recieved his wages, a natural right in the thing he has produced""",,
|
||||||
|
2,"Identity Politics - An Anthology","The Anarchist Library",,Varia,"Identity politics",Zine,"Paper Jam Collective","No license mentioned",,"Skipping through, I'm not sure if this is in line with our own politics. (ccl)",
|
||||||
|
3,"The mythology of work",CrimeThinc.com,,Varia,"Work, Anticapitalism",Zine,CrimeThinc.com,"No license mentioned",,"A selection from 'Work', a 376-page analysis of contemporary capitalism",
|
||||||
|
4,"Forget Shorter Showers - Why Personal Change Does Not Equal Political Change","Derrick Jensen",2009,Varia,"Environmental justice",Zine,,"No license mentioned","""Green consumerism isn't enough.""",,
|
||||||
|
5,Choreo-Graphic-Hypothesis,"<meta-author=""Joana Chicau"";>",2018,Varia,"Live Coding, Choreography",Paperback,"Self published: Joana Chicau","Free Art Liceense 1.3","""Theatrical actions are not necessary to the performance, Avoid if at all possible""",,
|
||||||
|
6,"Point of no Return",,2013,Varia,"Anarchism in the West",Zine,,"No license mentioned",,"Stories about becoming an anarchist in the West in the 80s",
|
||||||
|
7,"Waar slapen de kroegtijgers van Oud Charlois","Jacco Weener",,Varia,"Oud Charlois, Drawing",Paperback,Self-published,"No license mentioned",,,
|
||||||
|
8,"Dubbeldruk Play with me","Editorial team: Karin de Jong, Giulia de Giovanelli, Floor van Luijk",2019,Varia,"Copyright, Publishing, Printing",Parazine,Printroom,"Free art license",,"Confusing licenses mentioned in the about text on the back of the publication, FAL, Copy-left and copy right all mentioned",
|
||||||
|
9,"To Boldly Go: a starters guide to hand made and diy films","Film Werkplaats Worm Rotterdam",2008,Varia,"Experimental film, Analog film, DIY, Hand-made",Paperback,"Knust (Nijmegen)","'No license mentioned",,,
|
||||||
|
10,"Anarchism: Basic concepts and ideas","Peter Storm",2018,Varia,"Anarchism, Dutch Theory",Zine,"Ravotr Editions in collaboration with Paper Jam","""Feel free to use and copy this text as you see fit. Mentioning source and author would be greatly appreciated.""",,"Revised text of a transcribed lecture Storm gave in Rotterdam.",
|
||||||
|
11,"Queering Anarchism","Deric Shannon, Abbey Willis",,Varia,"Anarchism, Queer Theory",Zine,"Paper Jam Collective","No license mentioned",,,
|
||||||
|
12,"Abolish restaurants",Prole.info,2010,Varia,"Labour, Food industry",Paperback,"Pm Press","Copyright 2010","""Drawing on a range of anti-capitalist ideas as well as a heaping plate of personal experience""",,
|
||||||
|
13,"Elk Woord Een Vonk: Verboden Teksten, verwerpelijke vervolging: de zaak Joke Kaviaar","Steungroep 13 September",2014,"Varia (or Luke?)","Joke Kaviaar, Immigration, Activism, Forbidden Texts, Incarceration","Soft cover",Self-published,Copyleft,,https://13-september.nl,
|
||||||
|
14,"A NO BORDERS manifesto","Ill Will Editions",2015,Varia,"Migrant justice",Zine,Self-published,"No license mentioned",,,
|
||||||
|
15,"Short Circuit: Towards an Arnarchist to Gentrification",,,Varia,"Gentrification, Anarchism",Zine,Self-published,"No license mentioned","""Anarchists understandably feel an intrinsic and visceral opposition to gentrification",,
|
||||||
|
16,"Futur Musique","De fanfare voor vooruit strevende volksmuziek",2018,Varia,"Musical Instruments, DIY",Zine,Self-published,"No license mentioned",,"Copied instructions on building one's own musical instruments",
|
||||||
|
17,"Franchir le cap","Quentin Juhel",2019,Varia,"Convivial computation",Zine,Self-publsihed,"Creative commons CC-BY-SA",,,
|
||||||
|
18,"Consensus: Decision Making","Seeds For Change UK",2010,Varia,"Decision making, Consensus",Zine,Self-published,"No license mentioned",,"Short guide ",
|
||||||
|
19,"Waar ook op gestemd wordt, wij laten ons niet regeren","Anarchistische Groep Nijmegen",2014,Varia,Democracy,Zine,Self-published,"No license mentioned",,,
|
||||||
|
20,"The NGO sector: the trojan horse of capitalism","Crn Blok",,Varia,"Anti-capitalism, NGO",Zine,Self-published,Copyleft,,,
|
||||||
|
21,"Messing Around With Packet Radio",,,,,,,,,,
|
|
36
library/page.py
Normal file
36
library/page.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
"""This is the main flask page code"""
|
||||||
|
|
||||||
|
|
||||||
|
import flask
|
||||||
|
from flask import render_template
|
||||||
|
|
||||||
|
from csvparser.csvparser import getpublications
|
||||||
|
|
||||||
|
APP = flask.Flask(__name__, static_folder="static")
|
||||||
|
|
||||||
|
|
||||||
|
@APP.route("/")
|
||||||
|
def index():
|
||||||
|
"""Main path"""
|
||||||
|
# parse csv, render template with a few elements from the csv
|
||||||
|
titles = getpublications()
|
||||||
|
return render_template("index.html", titles=titles)
|
||||||
|
|
||||||
|
|
||||||
|
@APP.route("/<publication>")
|
||||||
|
def show_book(publication):
|
||||||
|
"""Path for a publication"""
|
||||||
|
# parse csv, render template with full list.
|
||||||
|
return render_template("publication.html", publication=publication)
|
||||||
|
|
||||||
|
|
||||||
|
@APP.route("/<publication>")
|
||||||
|
def upload_book(publication):
|
||||||
|
"""upload a new book"""
|
||||||
|
#
|
||||||
|
return render_template("upload form")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
APP.debug = True
|
||||||
|
APP.run(port=5000)
|
56
library/static/css/style.css
Normal file
56
library/static/css/style.css
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body:after {
|
||||||
|
font-size: .8em;
|
||||||
|
background-color: #EB4377;
|
||||||
|
/*color: rgba(223, 183, 180, .3);*/
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 1em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cloud {
|
||||||
|
overflow: hidden;
|
||||||
|
width: 1px; height: 1px;
|
||||||
|
transform: translate(-100%, -100%);
|
||||||
|
border-radius: 50%;
|
||||||
|
filter: url(#filter);
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: alphaClouds;
|
||||||
|
src: url(../fonts/AlphaClouds.ttf);
|
||||||
|
}
|
||||||
|
|
||||||
|
#varia {
|
||||||
|
line-height: 1.03em;
|
||||||
|
position: absolute;
|
||||||
|
top: 10%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-shadow: 2px 2px #8B5B7F;
|
||||||
|
font-size: 60px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: alphaClouds;
|
||||||
|
mix-blend-mode: exclusion;
|
||||||
|
}
|
||||||
|
@supports (-webkit-text-stroke: 1px lightpink) {
|
||||||
|
#varia {
|
||||||
|
-webkit-text-stroke: 1px lightpink;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
margin 0 auto;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
z-index: 10;
|
||||||
|
border: 5px solid black;
|
||||||
|
color: black;
|
||||||
|
min-width: auto;
|
||||||
|
background-color: white;
|
||||||
|
}
|
BIN
library/static/fonts/AlphaClouds.ttf
Normal file
BIN
library/static/fonts/AlphaClouds.ttf
Normal file
Binary file not shown.
26
library/static/js/script.js
Normal file
26
library/static/js/script.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
function rn(from, to) {
|
||||||
|
return ~~(Math.random() * (to - from + 1)) + from;
|
||||||
|
}
|
||||||
|
|
||||||
|
function rs() {
|
||||||
|
return arguments[rn(1, arguments.length) - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
function boxShadows(max) {
|
||||||
|
let ret = [];
|
||||||
|
for (let i = 0; i < max; ++i) {
|
||||||
|
ret.push(`
|
||||||
|
${ rn(1, 100) }vw ${ rn(1, 100) }vh ${ rn(20, 40) }vmin ${ rn(1, 20) }vmin
|
||||||
|
${ rs('#F52D75', '#CCBD4F', '#32497F', '#EB4377') }
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
return ret.join(',');
|
||||||
|
}
|
||||||
|
|
||||||
|
const cloud = document.querySelector('#cloud');
|
||||||
|
function update() {
|
||||||
|
cloud.style.boxShadow = boxShadows(120);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('load', update);
|
||||||
|
document.addEventListener('click', update);
|
76
library/static/style.css
Normal file
76
library/static/style.css
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body:after {
|
||||||
|
font-size: .8em;
|
||||||
|
background-color: #EB4377;
|
||||||
|
/*color: rgba(223, 183, 180, .3);*/
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 1em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cloud {
|
||||||
|
overflow: hidden;
|
||||||
|
width: 1px; height: 1px;
|
||||||
|
transform: translate(-100%, -100%);
|
||||||
|
border-radius: 50%;
|
||||||
|
filter: url(#filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: alphaClouds;
|
||||||
|
src: url(../fonts/AlphaClouds.ttf);
|
||||||
|
}
|
||||||
|
|
||||||
|
#varia {
|
||||||
|
line-height: 1.03em;
|
||||||
|
position: absolute;
|
||||||
|
top: 10%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-shadow: 2px 2px #8B5B7F;
|
||||||
|
font-size: 60px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: alphaClouds;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin 0 auto;
|
||||||
|
width: 100vw;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 250px 250px 250px 250px;
|
||||||
|
grid-template-rows: 200px 200px 200px;
|
||||||
|
grid-column-gap: 10px;
|
||||||
|
grid-row-gap: 15px;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
}
|
||||||
|
.item-a {
|
||||||
|
z-index: 10;
|
||||||
|
border: 5px solid black;
|
||||||
|
color: black;
|
||||||
|
min-width: auto;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
.item-b {
|
||||||
|
z-index: 10;
|
||||||
|
border: 5px solid black;
|
||||||
|
width: auto;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
.item-c {
|
||||||
|
z-index: 10;
|
||||||
|
border: 5px solid black;
|
||||||
|
width: auto;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
td, th {
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
28
library/templates/base.html
Normal file
28
library/templates/base.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang='en'>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>varia library zone</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css')}}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="cloud"></div>
|
||||||
|
<svg width="0">
|
||||||
|
<filter id="filter">
|
||||||
|
<feTurbulence type="fractalNoise"
|
||||||
|
baseFrequency=".001" numOctaves="7" />
|
||||||
|
<feDisplacementMap in="SourceGraphic" scale="240" />
|
||||||
|
</filter>
|
||||||
|
</svg>
|
||||||
|
<h1 id="varia">VARIA LIBRARY COLLECTION</h1>
|
||||||
|
<div id="nav" class="container">
|
||||||
|
<a href="/"><button>index</button></a>
|
||||||
|
<a href="/upload"><button>upload</button></a>
|
||||||
|
</div>
|
||||||
|
<div id="main">
|
||||||
|
{% block main %}
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<script src="{{ url_for('static', filename='js/script.js')}}"></script>
|
||||||
|
</html>
|
9
library/templates/index.html
Normal file
9
library/templates/index.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block main %}
|
||||||
|
|
||||||
|
{% for titles in titles %}
|
||||||
|
<a href="{{ titles }}">{{ titles }}</a>
|
||||||
|
{% endfor%}
|
||||||
|
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user