fix tool-view - refs #2681

pull/2877/head
Alex Aragón 6 years ago
parent 0726d31425
commit fe94aa9beb
  1. 10
      main/course_progress/thematic.php
  2. 2
      main/inc/lib/glossary.lib.php
  3. 17
      main/template/default/course_description/index.html.twig
  4. 13
      main/template/default/course_progress/progress.html.twig
  5. 21
      main/template/default/glossary/list.html.twig
  6. 17
      src/ThemeBundle/Resources/views/LearnPath/list.html.twig

@ -19,9 +19,13 @@ $user_info = api_get_user_info();
$params = '&'.api_get_cidreq();
$tpl = new Template(get_lang('ThematicControl'));
$isTeacher = api_is_allowed_to_edit(null, true);
$tpl->assign('token', $url_token);
$tpl->assign('is_allowed_to_edit', $isTeacher);
$toolbar = null;
if (api_is_allowed_to_edit(null, true)) {
if ($isTeacher) {
switch ($action) {
case 'thematic_add':
case 'thematic_import_select':
@ -216,7 +220,7 @@ if ($action == 'thematic_list') {
$tpl->assign('data', $listThematic);
} //End for
}
$thematicLayout = $tpl->get_template('course_progress/progress.tpl');
$thematicLayout = $tpl->get_template('course_progress/progress.html.twig');
$content = $tpl->fetch($thematicLayout);
$tpl->assign('content', $content);
} elseif ($action == 'thematic_add' || $action == 'thematic_edit') {
@ -291,7 +295,7 @@ if ($action == 'thematic_list') {
$tpl->assign('actions', $toolbar);
if (!empty($html)) {
$tpl->assign('content', $html);
$thematicLayout = $tpl->get_template('course_progress/layout.tpl');
$thematicLayout = $tpl->get_template('course_progress/layout.html.twig');
}
if (!empty($message) && !empty($total_average_of_advances)) {
$tpl->assign('message', $message);

@ -461,7 +461,9 @@ class GlossaryManager
$list = self::getListGlossary(1000, 0, $orderList);
$tpl = new Template(null);
$isTeacher = api_is_allowed_to_edit(null, true);
$tpl->assign('data', $list);
$tpl->assign('is_allowed_to_edit', $isTeacher);
$layout = $tpl->get_template('glossary/list.html.twig');
$content .= $tpl->fetch($layout);

@ -4,6 +4,22 @@
{% for message in messages %}
{{ message }}
{% endfor %}
{% if listing.descriptions|length != 0 %}
<div class="alert alert-info" role="alert">
{{ 'No description of the course is recorded'|trans }}
</div>
<div id="no-data-view" class="tool-view">
<h2>{{ "Course description"|trans }}</h2>
<img src="{{ "info.png"|icon(64) }}" width="64" height="64">
<div class="controls">
<a href="{{ web_self ~ "?" ~ _p.web_cid_query ~ "&action=edit&description_type=1" }}" class="btn btn-outline-primary">
{{ "Add description"|trans }}
</a>
</div>
</div>
{% else %}
{% for description in listing.descriptions %}
{% if not description is empty %}
<div id="description_{{ description.description_type }}"
@ -40,5 +56,6 @@
</div>
{% endif %}
{% endfor %}
{% endif %}
{% endautoescape %}
{% endblock %}

@ -124,6 +124,17 @@
</div>
</div>
{% else %}
<div class="alert alert-info" role="alert">{{ 'ThereIsNoAThematicSection' | get_lang }}</div>
<div class="alert alert-info" role="alert">{{ 'There is no thematic section' | get_lang }}</div>
{% if is_allowed_to_edit %}
<div id="no-data-view" class="tool-view">
<h2>{{ "Educational programming"|trans }}</h2>
<img src="{{ "course_progress.png"|icon(64) }}" width="64" height="64">
<div class="controls">
<a href="{{ _p.web_self }}?{{ _p.web_cid_query ~ "&action=thematic_add" ~ token }}" class="btn btn-outline-primary">
{{ "Add thematic"|trans }}
</a>
</div>
</div>
{% endif %}
{% endif %}
{% endautoescape %}

@ -1,5 +1,21 @@
{% autoescape false %}
<div class="glossary mt-5">
{% if data is empty %}
<div class="alert alert-info" role="alert">{{ 'There is no thematic section' | get_lang }}</div>
{% if is_allowed_to_edit %}
<div id="no-data-view" class="tool-view">
<h2>{{ "Glossary"|trans }}</h2>
<img src="{{ "glossary.png"|icon(64) }}" width="64" height="64">
<div class="controls">
<a href="{{ _p.web_self }}?{{ _p.web_cid_query ~ "&action=addglossary" }}" class="btn btn-outline-primary">
{{ "Add glossary"|trans }}
</a>
</div>
</div>
{% endif %}
{% else %}
<div class="glossary mt-5">
{% for item in data %}
<div class="item-glossary mb-4 pl-2 pr-2">
{% if item.edit %}
@ -18,5 +34,6 @@
{{ item.description }}
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endautoescape %}

@ -14,9 +14,13 @@
}
</script>
<h4 class="learning-lessons">{{ 'Learning lessons'|trans }}</h4>
<div class="accordion lp-accordion" id="lessons-learning">
{% if data|length != 0 %}
<div class="alert alert-info" role="alert">
{{ 'No lessons were recorded'|trans }}
</div>
{% else %}
<h4 class="learning-lessons">{{ 'Learning lessons'|trans }}</h4>
<div class="accordion lp-accordion" id="lessons-learning">
{% for lp_data in data %}
{% set show_category = true %}
{% if filtered_category and filtered_category != lp_data.category.id %}
@ -193,14 +197,15 @@
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% if is_allowed_to_edit and not lp_is_shown %}
<div id="no-data-view" class="tool-view">
<h2>{{ "LearningPaths"|trans }}</h2>
<h2>{{ "Learning paths"|trans }}</h2>
<img src="{{ "scorms.png"|icon(64) }}" width="64" height="64">
<div class="controls">
<a href="{{ web_self ~ "?" ~ _p.web_cid_query ~ "&action=add_lp" }}" class="btn btn-outline-primary">
{{ "LearnpathAddLearnpath"|trans }}
{{ "Learnpath add learnpath"|trans }}
</a>
</div>
</div>

Loading…
Cancel
Save