diff --git a/db_schema.sql b/db_schema.sql index f38b5a5380314ea71fc5b12cc6192f9b0df9bbfd..7e60de3a79c35702e3193cb9c0bc1fa28ba6834d 100644 --- a/db_schema.sql +++ b/db_schema.sql @@ -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, diff --git a/server.py b/server.py index 3c4c19d56b860eb60a3ffa96098773ad1365b3ff..6fe4b8d991eb6b7cf6f8d2c5d30df9e4be5ac4cb 100755 --- a/server.py +++ b/server.py @@ -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>') diff --git a/templates/courses.html b/templates/courses.html index 6f34a57b01eae78802de039bdfa6c5aed548341e..7a1cf9175730c0c4fb79443e2c15ccfe27b46659 100644 --- a/templates/courses.html +++ b/templates/courses.html @@ -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"> diff --git a/templates/index.html b/templates/index.html index 8426f5d0b4580fc3fcf81b09dcf2d786cf799710..92519934903f4e323edcdaac3baf9efb128a1f2b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -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>