Actualización

This commit is contained in:
Xes
2025-04-10 12:49:05 +02:00
parent 4aff98e77b
commit 1cdd00920f
9151 changed files with 1800913 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<h4>{{ 'ContextForCommentToBeGrade'|get_lang }}</h4>
<strong>{{ 'PortfolioItemTitleXName'|get_lang|format(item.title) }}</strong>
<p>{{ item.excerpt }}</p>
<div class="row">
{% for node in comments_path %}
{% if loop.index != comments_path|length %}
<div class="col-sm-{{ 12 - node.lvl }} col-sm-offset-{{ node.lvl }}">
<strong>{{ 'PortfolioCommentFromXUser'|get_lang|format(node.author.completeName) }}</strong>
{{ node.content }}
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>

View File

@@ -0,0 +1,147 @@
{% macro display(items, category_id, _c, _u, _p) %}
{% set edit_img = 'edit.png'|img(22, 'Edit'|get_lang) %}
{% set visible_img = 'visible.png'|img(22, 'Invisible'|get_lang) %}
{% set invisible_img = 'invisible.png'|img(22, 'Visible'|get_lang) %}
{% set delete_img = 'delete.png'|img(22, 'Delete'|get_lang) %}
{% set baseurl = _p.web_self ~ '?' ~ (_p.web_cid_query ? _p.web_cid_query ~ '&' : '') %}
{% set is_advanced_sharing_enabled = 'portfolio_advanced_sharing'|api_get_configuration_value and not _c is empty %}
<section class="portfolio-items">
{% for item in items %}
{% set item_url = baseurl ~ {'action':'view', 'id':item.id}|url_encode %}
{% set comments = item.lastComments(3, is_advanced_sharing_enabled) %}
<div class="panel panel-default">
<article class="panel-body portfolio-item" id="portfolio-item-{{ item.id }}">
<div class="portfolio-actions pull-right">
{% if _u.id == item.user.id %}
<a href="{{ baseurl ~ {'action':'edit_item', 'id':item.id}|url_encode }}">
{{ 'edit.png'|img(22, 'Edit'|get_lang) }}
</a>
{% if is_advanced_sharing_enabled %}
<a href="{{ baseurl ~ {'action':'item_visiblity_choose', 'id':item.id}|url_encode }}">
{{ 'visible.png'|img(22, 'ChooseRecipients'|get_lang) }}
</a>
{% else %}
{% if item.visibility == 0 %}
<a href="{{ baseurl ~ {'action':'visibility', 'id':item.id}|url_encode }}">
{{ 'invisible.png'|img(22, 'MakeVisible'|get_lang) }}
</a>
{% elseif item.visibility == 1 %}
<a href="{{ baseurl ~ {'action':'visibility', 'id':item.id}|url_encode }}">
{{ 'visible.png'|img(22, 'MakeVisibleForTeachers'|get_lang) }}
</a>
{% elseif item.visibility == 2 %}
<a href="{{ baseurl ~ {'action':'visibility', 'id':item.id}|url_encode }}">
{{ 'eye-slash.png'|img(22, 'MakeInvisible'|get_lang) }}
</a>
{% endif %}
{% endif %}
<a href="{{ baseurl ~ {'action':'delete_item', 'id':item.id}|url_encode }}" class="btn-delete">
{{ 'delete.png'|img(22, 'Delete'|get_lang) }}
</a>
{% elseif false|api_is_allowed_to_edit %}
<a href="{{ baseurl ~ {'action':'edit_item', 'id':item.id}|url_encode }}">
{{ 'edit.png'|img(22, 'Edit'|get_lang) }}
</a>
{% endif %}
{% if false|api_is_allowed_to_edit %}
{% if item.isHighlighted %}
<a href="{{ baseurl ~ {'action':'highlighted', 'id':item.id}|url_encode }}">
{{ 'award_red.png'|img(22, 'UnmarkAsHighlighted'|get_lang) }}
</a>
{% else %}
<a href="{{ baseurl ~ {'action':'highlighted', 'id':item.id}|url_encode }}">
{{ 'award_red_na.png'|img(22, 'MarkAsHighlighted'|get_lang) }}
</a>
{% endif %}
{% endif %}
</div>
{% if item.isHighlighted %}
<span class="label label-success">
<span class="fa fa-fw fa-star-o" aria-hidden="true"></span>
{{ 'Highlighted'|get_lang }}
</span>
{% endif %}
<header>
<h3>
<a href="{{ item_url }}">{{ item.title|remove_xss }}</a>
</h3>
<ul class="fa-ul list-inline">
{% if _c is empty %}
{% if item.session %}
<li>
<span class="fa-li fa fa-book" aria-hidden="true"></span>
{{ 'Course'|get_lang ~ ': ' ~ item.session.name ~ ' (' ~ item.course.title ~ ')' }}
</li>
{% elseif not item.session and item.course %}
<li>
<span class="fa-li fa fa-book" aria-hidden="true"></span>
{{ 'Course'|get_lang ~ ': ' ~ item.course.title }}
</li>
{% endif %}
{% else %}
<li>
<span class="fa-li fa fa-user" aria-hidden="true"></span>
{{ item.user.completeName }}
</li>
{% endif %}
<li>
<span class="fa-li fa fa-clock-o" aria-hidden="true"></span>
{{ 'CreationDate'|get_lang ~ ': ' ~ item.creationDate|date_to_time_ago }}
</li>
{% if item.creationDate != item.updateDate %}
<li>
<span class="fa-li fa fa-clock-o" aria-hidden="true"></span>
{{ 'UpdateDate'|get_lang ~ ': ' ~ item.updateDate|date_to_time_ago }}
</li>
{% endif %}
</ul>
</header>
<hr>
<p>{{ item.excerpt }}</p>
<hr>
<section>
{% if comments|length > 0 %}
<h4>
<a href="{{ item_url }}#portfolio-item-comments">
{{ 'XComments'|get_lang|format(comments|length) }}
</a>
&centerdot;
<a href="{{ item_url }}#frm_comment">{{ 'AddNewComment'|get_lang }}</a>
</h4>
{% for comment in comments %}
<article>
<footer>
<span class="fa fa-fw fa-commenting-o" aria-hidden="true"></span>
<strong>{{ comment.author.completeName }}</strong>
<small class="fa fa-clock-o fa-fw text-muted" aria-hidden="true"></small>
<small class="text-muted">{{ comment.date|date_to_time_ago }}</small>
</footer>
<p>{{ comment.excerpt }}</p>
</article>
{% endfor %}
{% else %}
<a href="{{ item_url }}#portfolio-item-comments">
<span class="fa fa-commenting-o fa-fw" aria-hidden="true"></span>
{{ 'AddNewComment'|get_lang }}
</a>
{% endif %}
</section>
</article>
</div>
{% endfor %}
</section>
{% endmacro %}

View File

@@ -0,0 +1,167 @@
{% set edit_img = 'edit.png'|img(22, 'Edit'|get_lang) %}
{% set visible_img = 'visible.png'|img(22, 'Invisible'|get_lang) %}
{% set invisible_img = 'invisible.png'|img(22, 'Visible'|get_lang) %}
{% set delete_img = 'delete.png'|img(22, 'Delete'|get_lang) %}
{% set baseurl = _p.web_self ~ '?' ~ (_p.web_cid_query ? _p.web_cid_query ~ '&' : '') %}
{% import 'portfolio/items.html.twig'|get_template as items %}
<div class="row">
{% if course %}
<div class="col-md-3">
{{ frm_student_list }}
<hr>
{{ frm_tag_list }}
</div>
{% endif %}
<div class="{{ course ? 'col-md-9' : 'col-xs-12' }}">
{% if (categories) %}
<div class="btn-toolbar">
<div class="btn-group" data-toggle="buttons">
{% for category in categories %}
<label class="btn btn-default category-filters {{ category_id == category.id ? "active" : "" }}">
<input type="radio" value="{{ category.id }}" {{ category_id == category.id ? "checked" : "" }}>
{{ category.title }}
</label>
{% endfor %}
<label class="btn btn-default category-filters {{ category_id == category.id ? "active" : "" }}">
<input type="radio" value="0" {{ category_id == 0 ? "checked" : "" }}> {{ 'All'|get_lang }}
</label>
</div>
</div>
{% if (subcategories) %}
<div class="btn-toolbar">
{% for subcategory in subcategories %}
<label class="btn btn-default">
{% set checked = '' %}
{% if (subcategory_ids == 'all') %}
{% set checked = 'checked' %}
{% else %}
{% if subcategory.id in subcategory_ids %}
{% set checked = 'checked' %}
{% endif %}
{% endif %}
<input type="checkbox" value="{{ subcategory.id }}" {{ checked }} class="subcategory-filters" />&nbsp;{{ subcategory.title }}
</label>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% if _u.id != user.id %}
<h3>{{ user.completeName }} <small>{{ user.username }}</small></h3>
{% endif %}
{% if found_comments and uncategorized_items %}
<h4 class="page-header">{{ 'Posts'|get_lang }}</h4>
{% endif %}
{{ items.display(uncategorized_items, 0, _c, _u, _p) }}
{% if found_comments %}
<section>
<h4 class="page-header">{{ 'Comments'|get_lang }}</h4>
{% for comment in found_comments %}
{% set commentItem = comment.item %}
<div>
<article>
<footer class="fa-lg">
<p>
{{ 'CommentByUserXInItemY'|get_lang|format(comment.author.completeName, commentItem.title) }}
</p>
<p class="text-muted">
<span class="fa fa-clock-o fa-fw" aria-hidden="true"></span>
{{ comment.date|date_to_time_ago }}
</p>
</footer>
<p>
{{ comment.excerpt(290) }}
<a href="{{ baseurl ~ {'action':'view', 'id':commentItem.id}|url_encode ~ '#comment-' ~ comment.id }}">{{ 'SeeMore'|get_lang }}</a>
</p>
</article>
</div>
{% endfor %}
</section>
{% endif %}
{% for category in portfolio %}
<div class="panel panel-info">
<div class="panel-body">
<h4 class="page-header">
<a href="#collapse-category-{{ category.id }}" role="button" data-toggle="collapse"
aria-expanded="false" aria-controls="collapse-category-{{ category.id }}">
{{ category.title }}
</a>
{% if _u.id == category.user.id %}
<div class="pull-right">
<a href="{{ baseurl ~ {'action':'edit_category', 'id':category.id}|url_encode }}">
{{ edit_img }}
</a>
{% if category.isVisible %}
<a href="{{ baseurl ~ {'action':'hide_category', 'id':category.id}|url_encode }}">
{{ visible_img }}
</a>
{% else %}
<a href="{{ baseurl ~ {'action':'show_category', 'id':category.id}|url_encode }}">
{{ invisible_img }}
</a>
{% endif %}
<a href="{{ baseurl ~ {'action':'delete_category', 'id':category.id}|url_encode }}"
class="btn-delete">
{{ delete_img }}
</a>
</div>
{% endif %}
</h4>
<div>
{{ category.description }}
</div>
<div class="collapse" id="collapse-category-{{ category.id }}">
{{
items.display(
category.items(course, session, _u.id != category.user.id),
category.id,
_c,
_u,
_p
)
}}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<script>
$(document).on('ready', function () {
$('.btn-delete').on('click', function (e) {
if (!confirm('{{ 'NoteConfirmDelete'|get_lang }} ')) {
e.preventDefault();
}
});
{% if course %}
$('form#frm_student_list select[name="user"]').on('change', function (e) {
var newLocation = '{{ _p.web_self ~ '?' ~ _p.web_cid_query }}';
if (this.value) {
newLocation += '&user=' + this.value;
}
location.href = newLocation;
this.disabled = true;
});
{% endif %}
});
</script>
{% if (js_script) %}
{{ js_script }}
{% endif %}

View File

@@ -0,0 +1,96 @@
{% if item.isHighlighted %}
<span class="label label-success">
<span class="fa fa-fw fa-star-o" aria-hidden="true"></span>
{{ 'Highlighted'|get_lang }}
</span>
{% endif %}
<article class="portfolio-item">
<header>
<h4 class="h3">{{ item.title|remove_xss }}</h4>
<ul class="fa-ul list-inline">
<li>
<span class="fa-li fa fa-user" aria-hidden="true"></span>
{{ item.user.completeName }}
</li>
<li>
<span class="fa-li fa fa-clock-o" aria-hidden="true"></span>
{{ 'CreationDate'|get_lang ~ ': ' ~ item.creationDate|date_to_time_ago }}
</li>
{% if last_edit %}
<li>
<span class="fa-li fa fa-clock-o" aria-hidden="true"></span>
{{ 'UpdatedDateXByUserY'|get_lang|format(last_edit.date|date_to_time_ago, last_edit.user) }}
</li>
{% elseif item.creationDate != item.updateDate %}
<li>
<span class="fa-li fa fa fa-clock-o" aria-hidden="true"></span>
{{ 'UpdatedDateX'|get_lang|format(item.updateDate|date_to_time_ago) }}
</li>
{% endif %}
{% if _c is empty %}
{% if item.session %}
<li>
<span class="fa-li fa fa-book" aria-hidden="true"></span>
{{ 'Course'|get_lang ~ ': ' ~ item.session.name ~ ' (' ~ item.course.title ~ ')' }}
</li>
{% elseif not item.session and item.course %}
<li>
<span class="fa-li fa fa-book" aria-hidden="true"></span>
{{ 'Course'|get_lang ~ ': ' ~ item.course.title }}
</li>
{% endif %}
{% endif %}
</ul>
</header>
{{ item_content|remove_xss }}
{% if attachment_list %}
<section>
{{ attachment_list }}
</section>
{% endif %}
<section id="portfolio-item-comments">
<h1 class="h3">
<span class="fa fa-fw fa-comment-o" aria-hidden="true"></span>
{{ 'XComments'|get_lang|format(count_comments) }}
</h1>
{{ comments }}
{{ form }}
</section>
</article>
<script>
$(function () {
var frmCommentTop = $("#frm_comment").offset().top;
$('.btn-reply-to').on('click', function (e) {
e.preventDefault();
var comment = $.extend(
{},
{'id': 0},
$(this).data('comment')
);
if (!comment.id) {
return;
}
var $frm = $('form#frm_comment');
$frm.find('#frm_comment_parent').val(comment.id);
CKEDITOR.instances.content.setData('');
$('html, body').animate({scrollTop: frmCommentTop});
});
});
</script>