see #5193 course description adding twig templates
parent
b5a2d341c8
commit
df1e5b47cd
@ -0,0 +1,25 @@ |
||||
{{javascript}} |
||||
|
||||
{% for message in messages %} |
||||
{{ message }} |
||||
{% endfor %} |
||||
|
||||
<div class="actions" > |
||||
<a href = "{{root}}&action=listing" class = "course_description btn back"></a> |
||||
{% for type in types %} |
||||
<a href="{{root}}&action=add&description_type={{type.id}}"> |
||||
<img title="{{type.title}}" alt="type.title" src="{{type.icon|icon(32)}} "> |
||||
</a> |
||||
{% endfor %} |
||||
</div> |
||||
|
||||
{% if type.question %} |
||||
<div class="normal-message"> |
||||
<div> |
||||
<strong>{{'QuestionPlan'|get_lang}}</strong> |
||||
</div> |
||||
{{type.question}} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{{form.return_form()}} |
||||
@ -0,0 +1,99 @@ |
||||
{{javascript}} |
||||
|
||||
<script type="text/javascript"> |
||||
|
||||
{% if is_allowed_to_edit %} |
||||
var sec_token = '{{sec_token}}'; |
||||
{% endif %} |
||||
|
||||
|
||||
function delete_entry(name, btn){ |
||||
if(!confirm("{{'ConfirmYourChoice'|get_lang}}")){ |
||||
return false; |
||||
} |
||||
|
||||
var item = $('#'+name); |
||||
var id = item.attr('data-id'); |
||||
var c_id = item.attr('data-c_id'); |
||||
|
||||
var f = function(data){ |
||||
if(data.success){ |
||||
item.remove(); |
||||
} |
||||
message.update(data); |
||||
$(btn).removeClass("loading"); |
||||
}; |
||||
CourseDescription.del(c_id, id, f); |
||||
$(btn).addClass("loading"); |
||||
} |
||||
|
||||
function delete_all(){ |
||||
if(!confirm("{{'ConfirmYourChoice'|get_lang}}")){ |
||||
return false; |
||||
} |
||||
|
||||
var f = function(data){ |
||||
if(data.success){ |
||||
var item = $('.course_descriptions'); |
||||
item.remove(); |
||||
} |
||||
message.update(data); |
||||
}; |
||||
CourseDescription.delete_by_course({{c_id}}, {{session_id}}, f); |
||||
|
||||
} |
||||
|
||||
</script> |
||||
|
||||
{% for message in messages %} |
||||
{{ message }} |
||||
{% endfor %} |
||||
|
||||
{% if is_allowed_to_edit %} |
||||
<div class="actions" > |
||||
{% for type in types %} |
||||
<a href="{{root}}&action=add&description_type={{type.id}}"> |
||||
<img title="{{type.title}}" alt="{{type.title}}" src="{{type.icon|icon(32)}} "> |
||||
</a> |
||||
{% endfor %} |
||||
<a href="{{root}}&action=import_csv" class="btn import_csv" title="{{'ImportCSV'|get_lang}}"></a> |
||||
<a href="{{root}}&action=export_csv" class="btn export_csv" title="{{'ExportAsCSV'|get_lang}}"></a> |
||||
<a href="javascript:void(0)" onclick="delete_all();return false;" class="btn delete_all" title="{{'DeleteAll'|get_lang}}"></a> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<ul style="list-style: none; margin-left:0;" class="course_descriptions"> |
||||
{% for description in descriptions %} |
||||
<li id="description_{{description.id}}" class="course_description" data-id="{{description.id}}" data-c_id="{{description.c_id}}" data-type="course_description"> |
||||
<div class="title sectiontitle"> |
||||
{% if is_allowed_to_edit %} |
||||
<div style="float:right;"> |
||||
{% if session_id == description.session_id %} |
||||
<a href="{{root}}&action=delete&id={{description.id}}" |
||||
onclick="delete_entry('description_{{description.id}}', this); return false;" |
||||
class="btn delete" |
||||
title="{{'Delete'|get_lang}}"> |
||||
</a> |
||||
|
||||
<a href="{{root}}&action=edit&id={{description.id}}" |
||||
class="btn edit" |
||||
title="{{'Edit'|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 %} |
||||
|
||||
<img title="{{description.type.title}}" alt="{{description.type.title}}" src="{{description.type.icon|icon(32)}}" class="icon"> |
||||
{{description.title}} |
||||
</div> |
||||
<div class="sectioncomment"> |
||||
{{description.content}} |
||||
</div> |
||||
</li> |
||||
{% endfor %} |
||||
</ul> |
||||
@ -0,0 +1,11 @@ |
||||
{{javascript}} |
||||
|
||||
{% for message in messages %} |
||||
{{ message }} |
||||
{% endfor %} |
||||
|
||||
<div class="actions" > |
||||
<a href = "{{root}}&action=listing" class = "course_description btn back"></a> |
||||
</div> |
||||
|
||||
{{form.return_form()}} |
||||
Loading…
Reference in new issue