see #5228: glossary adding twig templates

skala
Laurent Opprecht 14 years ago
parent b43f5e74c3
commit 5836247ae6
  1. 0
      main/template/default/glossary/csv.tpl
  2. 8
      main/template/default/glossary/edit.tpl
  3. 7
      main/template/default/glossary/header.tpl
  4. 23
      main/template/default/glossary/index.tpl
  5. 28
      main/template/default/glossary/javascript.tpl
  6. 35
      main/template/default/glossary/list.tpl
  7. 72
      main/template/default/glossary/table.tpl
  8. 8
      main/template/default/glossary/upload.tpl

@ -0,0 +1,8 @@
{% include 'default/glossary/header.tpl' %}
<div class="actions" >
<a href = "{{root}}&amp;action=index" class = "glossary btn back"></a>
</div>
{{form.return_form()}}

@ -0,0 +1,7 @@
{{javascript}}
<div id="messages">
{% for message in messages %}
{{ message }}
{% endfor %}
</div>

@ -0,0 +1,23 @@
{% include 'default/glossary/header.tpl' %}
{% include 'default/glossary/javascript.tpl' %}
<div class="actions" >
{% if is_allowed_to_edit %}
<a href="{{root}}&amp;action=add" class=" glossary btn new term" title="{{'Add'|get_lang}}"></a>
<a href="{{root}}&amp;action=import_csv" class="btn import_csv" title="{{'ImportCSV'|get_lang}}"></a>
<a href="{{root}}&amp;action=export_csv" class="btn export_csv" title="{{'ExportAsCSV'|get_lang}}"></a>
<a href="javascript:void(0)" onclick="ui.remove_by_course('entries', this);return false;" class="btn delete_all" title="{{'DeleteAll'|get_lang}}"></a>
{% endif %}
{% if view == 'table' %}
<a href="{{root}}&amp;view=list" class="btn view text" title="{{'ExportAsCSV'|get_lang}}"></a>
{% else %}
<a href="{{root}}&amp;view=table" class="btn view detailed" title="{{'ExportAsCSV'|get_lang}}"></a>
{% endif %}
</div>
{% if view == 'table' %}
{% include 'default/glossary/table.tpl' %}
{% else %}
{% include 'default/glossary/list.tpl' %}
{% endif %}

@ -0,0 +1,28 @@
<script type="text/javascript" src="{{www}}/main/glossary/resources/js/proxy.js"></script>
<script type="text/javascript" src="{{www}}/main/glossary/resources/js/ui.js"></script>
<script type="text/javascript" src="{{www}}/main/glossary/resources/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(function() {
ui.proxy = glossary;
window.context = {};
context.sec_token = '{{sec_token}}';
context.c_id = '{{c_id}}';
context.session_id = '{{session_id}}';
context.www = '{{www}}';
context.ajax = '{{www}}/main/inc/ajax/glossary.ajax.php';
if(typeof(lang) == "undefined")
{
window.lang = {};
}
lang.ConfirmYourChoice = "{{'ConfirmYourChoice'|get_lang}}";
});
</script>

@ -0,0 +1,35 @@
<ul id="entries" style="list-style: none; margin-left:0;" class="glossary entries" data-c_id="{{c_id}}" data-session_id="{{session_id}}" >
{% for item in items %}
<li id="glossary_{{item.id}}" class="glossary term" data-id="{{item.id}}" data-c_id="{{item.c_id}}" data-type="glossary">
<div class="title sectiontitle">
{% if is_allowed_to_edit %}
<div style="float:right;">
{% if session_id == item.session_id %}
<a href="{{root}}&amp;action=edit&amp;id={{item.id}}"
class="btn edit"
title="{{'Edit'|get_lang}}">
</a>
<a href="{{root}}&amp;action=delete&amp;id={{item.id}}"
onclick="ui.remove('glossary_{{item.id}}', this); return false;"
class="btn delete"
title="{{'Delete'|get_lang}}">
</a>
{% else %}
<img title="{{'EditionNotAvailableFromSession'|get_lang}}"
alt="{{'EditionNotAvailableFromSession'|get_lang}}"
src="{{'edit_na.png'|icon(22)}}"
style="vertical-align:middle;">
{% endif %}
</div>
{% endif %}
{{item.name}}
</div>
<div class="sectioncomment">
{{item.description}}
</div>
</li>
{% endfor %}
</ul>

@ -0,0 +1,72 @@
<script type="text/javascript">
$(document).ready(function() {
$('#entries').dataTable( {
"oLanguage": {
"sLengthMenu": "_MENU_ " + "{{'DataTableLengthMenu'|get_lang}}",
"sZeroRecords": "{{'DataTableZeroRecords'|get_lang}}",
"sInfo": "{{'DataTableInfo'|get_lang}}",
"sInfoEmpty": "{{'DataTableInfoEmpty'|get_lang}}",
"sInfoFiltered": "{{'DataTableInfoFiltered'|get_lang}}",
"sSearch": "{{'DataTableSearch'|get_lang}}",
"oPaginate": {
"sPrevious": "",
"sNext": ""
}
}
});
} );
</script>
<table id="entries" class="data_table glossary entries" data-c_id="{{c_id}}" data-session_id="{{session_id}}" >
<thead>
<tr>
<th class="sorting">
{{'TermName'|get_lang}}
</th>
<th class="sorting">
{{'TermDefinition'|get_lang}}
</th>
{% if is_allowed_to_edit %}
<th>
{{'Actions'|get_lang}}
</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for item in items %}
<tr id="glossary_{{item.id}}" class="glossary term" data-id="{{item.id}}" data-c_id="{{item.c_id}}" data-type="glossary">
<td class="title">
{{item.name}}
</td>
<td class="">
{{item.description}}
</td>
{% if is_allowed_to_edit %}
<td class="td_actions">
{% if session_id == item.session_id %}
<a href="{{root}}&amp;action=edit&amp;id={{item.id}}"
class="btn edit"
title="{{'Edit'|get_lang}}">
</a>
<a href="{{root}}&amp;action=delete&amp;id={{item.id}}"
onclick="ui.remove('glossary_{{item.id}}', this); return false;"
class="btn delete"
title="{{'Delete'|get_lang}}">
</a>
{% else %}
<img title="{{'EditionNotAvailableFromSession'|get_lang}}"
alt="{{'EditionNotAvailableFromSession'|get_lang}}"
src="{{'edit_na.png'|icon(22)}}"
style="vertical-align:middle;">
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
<div style="clear:both"></div>

@ -0,0 +1,8 @@
{% include 'default/glossary/header.tpl' %}
<div class="actions" >
<a href = "{{root}}&amp;action=index" class = "course_description btn back"></a>
</div>
{{form.return_form()}}
Loading…
Cancel
Save