<commit_before>{{#extend "news/news"}}
{{#content "page"}}
<p>
    <small class="text-muted">{{timeFromNow news.displayAt}}</small>
    {{#unless isRSS}}
    <small class="text-muted">
        von {{news.creatorId.firstName}} {{news.creatorId.lastName}} erstellt
    </small>
    {{/unless}}
    {{#if isRSS}}
    {{#userHasPermission "SCHOOL_NEWS_EDIT"}}
    <small class="text-muted">
        &nbsp;-
    </small>
    <small style="color: #b10438;">
        &nbsp;RSS
    </small>
    {{/userHasPermission}}
    {{/if}}

</p>
<div class="ckcontent">
    {{{news.content}}}
</div>
{{#unless isRSS}}
{{#userHasPermission "SCHOOL_NEWS_EDIT"}}
<div class="mt-1">
    <a class="btn btn-primary btn-edit" href="/news/{{../news._id}}/edit" alt="Artikel '{{../news.title}}' bearbeiten.">
        Bearbeiten
    </a>
    <a class="btn btn-secondary btn-delete" href="/news/{{../news._id}}" target="_blank" data-method="DELETE" data-name="{{../news.title}}"
        alt="Artikel '{{../news.title}}' löschen" redirect="/news/">
        Löschen
    </a>
</div>
{{#embed "lib/components/modal" class="delete-modal" title="Bist du dir sicher?"}}
{{#content "body"}}
<div class="modal-footer">
    <button type="button" class="btn btn-secondary btn-close">
        Abbrechen
    </button>
    <button type="submit" class="btn btn-primary btn-submit">
        Löschen
    </button>
</div>
{{/content}}
{{/embed}}
{{/userHasPermission}}
{{/unless}}
{{/content}}
{{/extend}}<commit_msg>show edit/delete buttons based on permissions in news detail view<commit_after>{{#extend "news/news"}}
{{#content "page"}}
<p>
    <small class="text-muted">{{timeFromNow news.displayAt}}</small>
    {{#unless isRSS}}
    <small class="text-muted">
        von {{news.creatorId.firstName}} {{news.creatorId.lastName}} erstellt
    </small>
    {{/unless}}
    {{#if isRSS}}
    {{#userHasPermission "SCHOOL_NEWS_EDIT"}}
    <small class="text-muted">
        &nbsp;-
    </small>
    <small style="color: #b10438;">
        &nbsp;RSS
    </small>
    {{/userHasPermission}}
    {{/if}}

</p>
<div class="ckcontent">
    {{{news.content}}}
</div>
{{#unless isRSS}}
<div class="mt-1">
    {{#inArray 'edit' ../permissions}}
    <a class="btn btn-primary btn-edit" href="/news/{{../news._id}}/edit" alt="Artikel '{{../news.title}}' bearbeiten.">
        Bearbeiten
    </a>
    {{/inArray}}
    {{#inArray 'delete' ../permissions}}
    <a class="btn btn-secondary btn-delete" href="/news/{{../news._id}}" target="_blank" data-method="DELETE"
        data-name="{{../news.title}}" alt="Artikel '{{../news.title}}' löschen" redirect="/news/">
        Löschen
    </a>
    {{/inArray}}
</div>
{{#embed "lib/components/modal" class="delete-modal" title="Bist du dir sicher?"}}
{{#content "body"}}
<div class="modal-footer">
    <button type="button" class="btn btn-secondary btn-close">
        Abbrechen
    </button>
    <button type="submit" class="btn btn-primary btn-submit">
        Löschen
    </button>
</div>
{{/content}}
{{/embed}}
{{/unless}}
{{/content}}
{{/extend}}

{'fraction_non_alphanumeric': 0.2284681130834977, 'fraction_numerical': 0.0039447731755424065, 'mean_word_length': 3.3721264367816093, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2936039', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1076, 'n_words': 215}