Commit 2ebf5ee7 authored by Julian Rother's avatar Julian Rother

Made code more compatible with mysql

parent ce2dfb56
......@@ -45,7 +45,7 @@ CREATE TABLE IF NOT EXISTS `courses_data` (
`visible` INTEGER NOT NULL DEFAULT '0',
`listed` INTEGER NOT NULL DEFAULT '1',
`deleted` INTEGER NOT NULL DEFAULT '0',
`title` text NOT NULL DEFAULT 'Neue Veranstaltung',
`title` text NOT NULL DEFAULT '',
`short` varchar(32) NOT NULL DEFAULT '',
`handle` varchar(32) NOT NULL DEFAULT '',
`organizer` text NOT NULL DEFAULT '',
......@@ -185,7 +185,7 @@ CREATE TABLE IF NOT EXISTS `videos_data` (
);
CREATE TABLE IF NOT EXISTS `announcements` (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`text` text NOT NULL DEFAULT "Neue Ankündigung",
`text` text NOT NULL DEFAULT '',
`internal` text NOT NULL DEFAULT "",
`level` INTEGER NOT NULL DEFAULT 0,
`visible` INTEGER NOT NULL DEFAULT 0,
......@@ -196,7 +196,7 @@ CREATE TABLE IF NOT EXISTS `announcements` (
);
CREATE TABLE IF NOT EXISTS `featured` (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`title` text NOT NULL DEFAULT "Neuer Artikel",
`title` text NOT NULL DEFAULT '',
`text` text NOT NULL DEFAULT "",
`internal` text NOT NULL DEFAULT "",
`visible` INTEGER NOT NULL DEFAULT 0,
......
......@@ -364,7 +364,9 @@ def stats():
@register_navbar('Changelog', icon='book')
@mod_required
def changelog():
changelog = query('SELECT *, ( "table" || "." || id_value || "." ||field) as path FROM changelog LEFT JOIN users ON (changelog.who = users.id) ORDER BY `when` DESC LIMIT 50')
changelog = query('SELECT * FROM changelog LEFT JOIN users ON (changelog.who = users.id) ORDER BY `when` DESC LIMIT 50')
for entry in changelog:
entry['path'] = '.'.join([entry['table'], entry['id_value'], entry['field']])
return render_template('changelog.html', changelog=changelog)
@app.route('/files/<filename>')
......
......@@ -9,7 +9,7 @@
</li>
{% if ismod() %}
<li>
<a class="btn btn-default" href="{{ url_for('create', table='courses', handle='new'+(randint(0,1000)|string), responsible=session.user.givenName, ref=request.url) }}">Neue Veranstaltung</a>
<a class="btn btn-default" href="{{ url_for('create', table='courses', handle='new'+(randint(0,1000)|string), title='Neue Veranstaltung', responsible=session.user.givenName, ref=request.url) }}">Neue Veranstaltung</a>
</li>
{% endif %}
<li class="dropdown" style="padding-right: 0px">
......
......@@ -8,7 +8,7 @@
<ul class="list-inline pull-right">
{% if ismod() %}
<li style="padding-right: 0px;">
<a class="btn btn-default" href="{{ url_for('create', table='announcements', ref=request.url) }}">Neue Ankündigung</a>
<a class="btn btn-default" href="{{ url_for('create', table='announcements', text='Neue Ankündigung', ref=request.url) }}">Neue Ankündigung</a>
</li>
{% endif %}
</ul>
......@@ -35,7 +35,7 @@
<div class="panel-heading">
<h1 class="panel-title">Featured
{% if ismod() %}
<a class="btn btn-default" href="{{ url_for('create', table='featured', ref=request.url) }}">Neue Empfehlung</a>
<a class="btn btn-default" href="{{ url_for('create', table='featured', title='Neuer Artikel', ref=request.url) }}">Neue Empfehlung</a>
{% endif %}
</h1>
</div>
......
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