update admin index - refs #2681

pull/2818/head
Alex Aragón 6 years ago
parent d83ed00811
commit d7f2c93044
  1. 109
      main/template/default/admin/settings_index.html.twig
  2. 69
      src/ThemeBundle/Resources/views/Admin/index.html.twig

@ -1,109 +0,0 @@
{% import '@ChamiloTheme/Macros/box.html.twig' as macro %}
{% extends '@ChamiloTheme/Layout/layout_one_col.html.twig' %}
{% block content %}
<script>
$(document).ready(function () {
$.ajax({
url: '{{ web_admin_ajax_url }}?a=version',
success: function (version) {
$(".admin-block-version").html(version);
}
});
{% if is_granted('ROLE_ADMIN') %}
$('button.admin-edit-block').on('click', function (e) {
e.preventDefault();
/*
var $self = $(this);
var extraContent = $.ajax('{{ web_admin_ajax_url }}', {
type: 'post',
data: {
a: 'get_extra_content',
block: $self.data('id')
}
});
$.when(extraContent).done(function (content) {
//extraContentEditor.setData(content);
$('#extra-block').val($self.data('id'));
$('#modal-extra-title').text($self.data('label'));
$('#modal-extra').modal('show');
});*/
});
{% endif %}
});
</script>
<section id="settings">
<div class="row">
{% set columns = 2 %}
{% for block_item in blocks %}
{% if block_item.items %}
<div id="tabs-{{ loop.index }}" class="settings-block col-md-6">
{% set header %}
{{ block_item.icon|raw }} {{ block_item.label }}
{% if block_item.editable and is_granted('ROLE_ADMIN') %}
<a href="{{ web_public ~ 'internal_page/edit/' ~ block_item.class }}"
class="btn btn-link btn-sm admin-edit-block float-right">
<img src="{{ "edit.png"|icon(22) }}" alt="{{ "Edit"|get_lang }}" title="{{ "Edit"|get_lang }}" />
</a>
{% endif %}
{% endset %}
{% set content %}
<div style="display: block;">
{{ block_item.search_form|raw }}
</div>
{% if block_item.items is not null %}
<div class="block-items-admin">
<ul class="list-items-admin">
{% for url in block_item.items %}
<li>
<a href="{{ url.url }}">
{{ url.label }}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if block_item.extra is not null %}
<div>
{{ block_item.extra|raw }}
</div>
{% endif %}
{% if block_item.editable %}
{{ render(controller('ChamiloPageBundle:Page:renderPage', {'slug': block_item.class, 'showEditPageLink': false} )) }}
{% endif %}
{% endset %}
{{ macro.panel(header, content) }}
</div>
{% endif %}
{% endfor %}
</div>
</section>
{% if is_granted('ROLE_ADMIN') %}
<div class="modal fade" id="modal-extra">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{{ 'Close'|get_lang }}">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modal-extra-title">{{ 'Blocks'|get_lang }}</h4>
</div>
<div class="modal-body">
{{ extraDataForm|raw }}
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}

@ -1,69 +0,0 @@
{% extends "@ChamiloTheme/Layout/layout.html.twig" %}
{% block page_content %}
{% autoescape false %}
<div id="settings">
{% for block_item in blocks %}
<div id="tabs-{{ loop.index }}" class="col-md-6">
<div class="well_border">
<h4>{{ block_item.icon }} {{ block_item.label }}</h4>
<div>
{{ block_item.search_form }}
</div>
{% if block_item.items is not empty %}
<ul>
{% for url in block_item.items %}
{% if url.url is not empty %}
<li>
<a href="{{ url.url }}">
{{ url.label }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% if block_item.extra is not null %}
<div>
{{ block_item.extra }}
</div>
{% endif %}
</div>
</div>
{% endfor %}
<div class="row">
{% for role in app.user.roles %}
{% set role = role | lower | replace ({ 'role_' : ''}) %}
{% if role in ['global_admin'] %}
{% include '@ChamiloTheme/Admin/' ~ role ~ '/role_index.html.twig' %}
{% endif %}
{% endfor %}
</div>
</div>
{% if is_granted('ROLE_ADMIN') %}
<script>
$(function () {
$.ajax({
url: '{{ web_admin_ajax_url }}?a=version',
success: function (version) {
$(".admin-block-version").html(version);
}
});
});
</script>
<div class="row">
<div class="col-md-12">
<div class="well_border">
<h3>{{ 'VersionCheck' | trans }} </h3>
<div class="admin-block-version"></div>
</div>
</div>
</div>
{% endif %}
{% endautoescape %}
{% endblock %}
Loading…
Cancel
Save