print mode web mode

master
km0 2 years ago
parent 409c28b1c9
commit 3d73c72f40

File diff suppressed because one or more lines are too long

@ -30,6 +30,8 @@ bp = Blueprint(
@bp.route("/")
def blocks():
print = request.args.get('print')
color = request.cookies.get("color", "purple")
# temporary, eventually we will dump contents only when they are updated in git (git hooks + git pull ?)
@ -38,16 +40,19 @@ def blocks():
with open("postit/contents.json", "r") as f:
contributions = json.load(f)
return render_template("postit.html", contributions=contributions, color=color)
return render_template("postit.html", contributions=contributions, color=color, print=print)
@bp.route("/<slug>")
def block(slug=None):
print = request.args.get('print', default=False)
color = request.cookies.get("color", "purple")
dump.dump([slug])
with open("postit/contents.json", "r") as f:
contributions = json.load(f)
return render_template("postit.html", contributions=contributions, color=color)
return render_template("postit.html", contributions=contributions, color=color, print=print)

@ -47,3 +47,11 @@ button#color:hover {
transform: scale(1.05);
cursor: pointer;
}
.print{
opacity: 0;
}
li:hover .print{
opacity: 1;
}

@ -15,14 +15,14 @@
<body>
<h1>🚩 85 000 post-it</h1>
<h2><a class="generate all" href="{{url_for('generate.blocks')}}">Generate all</a></h2>
<h2><a class="generate all" href="{{url_for('generate.blocks')}}">Generate all</a>, <a href="{{url_for('generate.blocks', print=true)}}">(print)</a></h2>
<button id="color"></button>
<h3>Contribution</h3>
<ol>
{%for page in pages %}
<li>
<a class="generate" href="{{url_for('generate.block', slug=page)}}">{{page}}</a>
<a class="generate" href="{{url_for('generate.block', slug=page)}}">{{page}}</a>, <a class="print" href="{{url_for('generate.blocks', slug=page, print=true)}}">🖨️</a>
</li>
{%endfor%}
</ol>

@ -9,9 +9,12 @@
<link rel="stylesheet" href="{{url_for('static', filename='css/global.css')}}" />
<link rel="stylesheet" href="{{url_for('static', filename='css/postit.css')}}" />
<link rel="stylesheet" href="{{url_for('static', filename='css/contents.css')}}" />
{% if print %}
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<script src="{{url_for('static', filename='js/bleed.js')}}"></script>
{% endif %}
</head>
<style>
:root {

Loading…
Cancel
Save