mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* 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:
9
system/templates/admin.menus.form.html.twig
Normal file
9
system/templates/admin.menus.form.html.twig
Normal 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>
|
33
system/templates/admin.menus.js.html.twig
Normal file
33
system/templates/admin.menus.js.html.twig
Normal 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>
|
@@ -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>
|
Reference in New Issue
Block a user