Commit 5b2f0125 authored by Dave Kliczbor's avatar Dave Kliczbor
Browse files

some cosmetic changes

parent c9267f8c
...@@ -7,49 +7,67 @@ Especially useful for events. ...@@ -7,49 +7,67 @@ Especially useful for events.
Dependencies Dependencies
------------ ------------
* python-flask python-genshi python-pythonmagick * python-flask python-genshi
* python-pythonmagick + graphicsmagick
* pdflatex latex-beamer * pdflatex latex-beamer
* libapache2-mod-wsgi for production use (or [anything capable of running WSGI apps](http://wsgi.readthedocs.org/en/latest/servers.html) really…) * libapache2-mod-wsgi for production use (or [anything capable of running WSGI apps](http://wsgi.readthedocs.org/en/latest/servers.html) really…)
Download
--------
$ git clone https://github.com/kif-ev/schildergenerator.git
Config Config
------ ------
* copy config.py.example to config.py and edit it to your needs. * for all uses: copy config.py.example to config.py and edit it to your needs.
* copy schildergen.wsgi.example to schildergen.wsgi and edit it. * for production use: copy schildergen.wsgi.example to schildergen.wsgi and edit it.
Apache Config Running in test/debug mode
------------- --------------------------
You need to have the config done. Then you could just start the server in debug mode:
$ python schilder.py
Webserver Deployment
--------------------
See http://flask.pocoo.org/docs/0.10/deploying/ for all deployment options.
Example config for the Apache Webserver, following http://flask.pocoo.org/docs/deploying/mod_wsgi/:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
WSGIRestrictStdout Off
<VirtualHost *:443>
ServerAdmin admin@server.test
DocumentRoot /path/to/schildergen
ServerName server.name.org
AddDefaultCharset utf-8
ErrorLog /path/to/log
CustomLog /path/to/log
SSLEngine on
SSLCertificateFile /path/to/www.example.com.cert
SSLCertificateKeyFile /path/to/www.example.com.key
WSGIDaemonProcess schildergen user=www-data group=www-data threads=2
WSGIScriptAlias / /path/to/schildergen.wsgi
See also http://flask.pocoo.org/docs/deploying/mod_wsgi/ <Directory /path/to/schildergen.wsgi>
AllowOverride All
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so WSGIProcessGroup schildergen
WSGIRestrictStdout Off WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
<VirtualHost *:443> Order deny,allow
ServerAdmin admin@server.test Allow from all
DocumentRoot /path/to/schildergen </Directory>
ServerName server.name.org </VirtualHost>
AddDefaultCharset utf-8
ErrorLog /path/to/log
CustomLog /path/to/log
SSLEngine on
SSLCertificateFile /path/to/www.example.com.cert
SSLCertificateKeyFile /path/to/www.example.com.key
WSGIDaemonProcess schildergen user=www-data group=www-data threads=2
WSGIScriptAlias / /path/to/schildergen.wsgi
<Directory /path/to/schildergen.wsgi>
AllowOverride All
WSGIProcessGroup schildergen
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Contributors Contributors
============ ============
......
{"pdfname": "GenericEvent42-1331353749.schild.pdf", "img": "pictograms-nps-misc-camera.png", "headline": "Generic\r\nEvent42", "text": "Man kann Wiki-Syntax benutzen.\r\n\r\n* Zum Beispiel f\u00fcr\r\n\r\n* Bullet Lists", "markup": "latex", "reusefilename": "on", "textemplate": "image-left_bothtext-right.tex", "filename": "GenericEvent42-1331353749.schild"} {"pdfname": "GenericEvent42-1331353749.schild.pdf", "img": "pictograms-nps-misc-camera.png", "headline": "Generic\r\nEvent42", "text": "Man kann Wiki-Syntax benutzen.\r\n\r\n* Zum Beispiel f\u00fcr\r\n* Bullet Lists\r\n", "markup": "rst", "reusefilename": "on", "textemplate": "image-left_bothtext-right.tex", "filename": "GenericEvent42-1331353749.schild"}
\ No newline at end of file \ No newline at end of file
{"img": "pictograms-nps-parking-2.png", "headline": "GenericEvent42", "text": "", "markup": "latex", "textemplate": "headline-top_arrowup_image-right.tex", "filename": "GenericEvent42-1545270496.schild", "pdfname": "GenericEvent42-1545270496.schild.pdf", "reusefilename": ""}
\ No newline at end of file
{"pdfname": "Generic_Event_42897947894.schild.pdf", "img": "pictograms-nps-parking-2.png", "headline": "GenericEvent42", "text": "", "markup": "rst", "reusefilename": "on", "textemplate": "headline-top_arrowup_image-right.tex", "filename": "Generic_Event_42897947894.schild"}
\ No newline at end of file
...@@ -22,8 +22,11 @@ import tempfile ...@@ -22,8 +22,11 @@ import tempfile
import config import config
app = Flask(__name__) app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = config.uploaddir app.config.update(
app.config['PROPAGATE_EXCEPTIONS'] = True UPLOAD_FOLDER = config.uploaddir,
PROPAGATE_EXCEPTIONS = True,
MAX_CONTENT_LENGTH = 8388608L
)
app.secret_key = config.app_secret app.secret_key = config.app_secret
genshi = Genshi(app) genshi = Genshi(app)
genshi.extensions['html'] = 'html5' genshi.extensions['html'] = 'html5'
...@@ -92,8 +95,8 @@ def run_pdflatex(context, outputfilename, overwrite=True): ...@@ -92,8 +95,8 @@ def run_pdflatex(context, outputfilename, overwrite=True):
tmpdir = tempfile.mkdtemp(dir=config.tmpdir) tmpdir = tempfile.mkdtemp(dir=config.tmpdir)
if context.has_key('img') and context['img'] and context['img'] != '__none': if context.has_key('img') and context['img'] and context['img'] != '__none':
try: try:
shutil.copy(os.path.join(config.imagedir, context[ shutil.copy(os.path.join(config.imagedir, context['img']),
'img']), os.path.join(tmpdir, context['img'])) os.path.join(tmpdir, context['img']))
except: except:
raise IOError("COULD NOT COPY") raise IOError("COULD NOT COPY")
else: else:
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<ul py:attrs="{'class':'collapsed'} if defined('form') else {}"> <ul py:attrs="{'class':'collapsed'} if defined('form') else {}">
<li py:for="textemplate in templates"> <li py:for="textemplate in templates">
<input type="radio" name="textemplate" id="tpl:${textemplate}" value="${textemplate}" py:attrs="{'checked':'checked', 'onfocus':'this.parentElement.parentElement.className=\'\';'} if defined('form') and textemplate == form.textemplate else {}"/> <input type="radio" name="textemplate" id="tpl:${textemplate}" value="${textemplate}" py:attrs="{'checked':'checked', 'onfocus':'this.parentElement.parentElement.className=\'\';'} if defined('form') and textemplate == form.textemplate else {}"/>
<label for="tpl:${textemplate}"><img src="${ url_for('tplthumbnail', tplname=textemplate, maxgeometry=72) }" alt="${textemplate}" title="${textemplate}"/></label> <label for="tpl:${textemplate}"><img src="${ url_for('tplthumbnail', tplname=textemplate, maxgeometry=80) }" alt="${textemplate}" title="${textemplate}"/></label>
</li> </li>
<li class="onlywhencollapsed"> <li class="onlywhencollapsed">
<button onclick="this.parentElement.parentElement.className=''; return false;" >Auswahl anzeigen</button> <button onclick="this.parentElement.parentElement.className=''; return false;" >Auswahl anzeigen</button>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment