* moved template menus to database, they're now dynamically loaded

* you can edit them in Admin Panel under 'Menus' option.
* you can also add custom links, like http://google.pl
* removed videos pages, as it can be easily added using custom Menus and Pages with insert Media
* removed bug_report configurable, its now enabled by default
This commit is contained in:
slawkens
2017-10-24 14:42:23 +02:00
parent 195ec4b11e
commit 6c9e09ea73
22 changed files with 497 additions and 604 deletions

View File

@@ -0,0 +1,9 @@
Please choose template in which you want to edit menu items.<br/>
<form method="post" action="?p=menus">
<select name="template">
{% for template in templates %}
<option value="{{ template.template }}">{{ template.template }}</option>
{% endfor %}
</select>
<input type="submit" value="Edit" />
</form>

View File

@@ -0,0 +1,33 @@
<link rel="stylesheet" href="{{ constant('BASE_URL') }}tools/jquery-ui.min.css">
<script src="{{ constant('BASE_URL') }}tools/jquery-ui.min.js"></script>
<script>
var last_id = [];
{% for cat, menu in menus %}
last_id[{{ cat }}] = {{ last_id[cat] }};
{% endfor %}
$( function() {
$(".sortable").sortable();
$(".sortable").disableSelection();
$(".remove-button").click(function() {
var id = $(this).attr("id");
$('#list-' + id.replace('remove-button-', '')).remove();
});
$(".add-button").click(function() {
var cat = $(this).attr("id").replace('add-button-', '');
var id = last_id[cat];
last_id[cat]++;
$('#sortable-' + cat).append('<li class="ui-state-default" id="list-' + cat + '-' + id + '"><input type="text" name="menu[' + cat + '][]" value=""/><input type="text" name="menu_link[' + cat + '][]" value=""/><a class="remove-button" id="remove-button-' + cat + '-' + id + '"><img src="{{ constant('BASE_URL') }}images/del.png"/></a></li>'); //add input bo
$('#remove-button-' + cat + '-' + id).click(function() {
$('#list-' + $(this).attr("id").replace('remove-button-', '')).remove();
});
});
});
</script>
<style>
.sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
.remove-button, .add-button {
cursor: pointer;
}
</style>

View File

@@ -1,7 +0,0 @@
<div style="text-align: center;">
{% for video in videos %}
<h2>{{ video.title }}</h2>
Author: {{ video.author }}<br/>
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{ video.youtube_id }}" frameborder="0" allowfullscreen></iframe><br/><br/>
{% endfor %}
</div>