templates/website/forum/forum-detail.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import ico %}
  2. {% extends 'website/main.template.html.twig' %}
  3. {% block body %}
  4.     {% include 'website/includes/search-section.html.twig' %}
  5.     {% embed 'website/includes/page-title.html.twig' with { pageTitle: getLanguage('forum', 'forum') }%}
  6.         {% block migalhas %}
  7.             <a href="{{ path('home') }}">{{ getLanguage('home', 'forum') }}</a>&ensp;/&ensp;<span>{{ getLanguage('forum', 'forum') }}</span>
  8.         {% endblock %}
  9.     {% endembed %}
  10.     <div class="container">
  11.         <div class="contem-busca">
  12.             <form class="busca-lista" action="{{ path('forumItem', { id: forum.id, slug: slug }) }}" method="GET">
  13.                 <input id="input-search-forum-detail" type="text" name="search" placeholder="{{ getLanguage('search_the_forum', 'forum') }} &hellip;">
  14.                 <button type="submit">
  15.                     <i class="material-icons">search</i>
  16.                 </button>
  17.             </form>
  18.             {% if user %}
  19.                 <button class="btn-acao" onclick="window.refEditor.openTab()"><span class="material-icons">add_circle_outline</span>{{ getLanguage('comment', 'forum') }}</button>
  20.             {% endif %}
  21.         </div>
  22.         
  23.         {# QUESTÃO #}
  24.         <div class="forum-pergunta">
  25.             <a class="seta" href="{{ path('forum') }}">
  26.                 <span class="material-icons">arrow_back</span>
  27.             </a>
  28.             <h2>{{ forum.getTitle(true) }}</h2>
  29.             {% include 'website/forum/forum-detail-box.html.twig' with { forumItem: forum, layout: 'question' } %}
  30.             {# MODAL -- OHTERS LIKES #}
  31.             {% embed "website/includes/modal.html.twig" with {'id': 'modal-others-likes-question', 'title': getLanguage('all_likes', 'forum'), 'classes': 'modal-forum' } %}
  32.                 {% block content %}
  33.                     {% include 'website/includes/modal-others-likes.html.twig' with { forumItem: forum, layout: 'question' } %}
  34.                 {% endblock %}
  35.             {% endembed %}
  36.         </div>
  37.     </div>
  38.     {# RESPOSTAS #}
  39.     <div id="contem-answers" class="container questao-respostas" data-url="{{ path('forumItemAnswers', { id: forum.id }) }}">
  40.         {% include 'website/forum/forum-list-answers.html.twig' with { init: true }%}
  41.     </div>
  42.     {% if user %}
  43.         {# ABA EDITOR -- RESPOSTA #}
  44.         {% embed 'website/includes/text-editor.html.twig' with {
  45.             titulo: getLanguage('reply_to_topic', 'forum'),
  46.             formId: 'formSendAnswer',
  47.             action: path('registerForum'),
  48.             method: 'post',
  49.         } %}
  50.             {% block campos %}
  51.                 <input type="hidden" id="topico-resposta-user" name="user" value="{{ user.id }}">
  52.                 <input type="hidden" id="topico-resposta-forum" name="forum" value="{{ forum.id }}">
  53.                 <input type="hidden" id="topico-resposta-titulo" name="title" value="{{ forum.getTitle(true) }}">
  54.                 <input type="hidden" id="topico-resposta-categoria" name="forumCategory" value="{{ forum.forumCategory.id }}">
  55.                 <div class="editor-wrap">
  56.                     <textarea class="editor js--editor" id="topico-resposta-text" name="text" required></textarea>
  57.                 </div>
  58.             {% endblock %}
  59.         {% endembed %}
  60.         {# MODAL -- EDITAR TÓPICO #}
  61.         {% embed "website/includes/modal.html.twig" with {'id': 'modal-editar-topico', 'title': getLanguage('edit_topic', 'forum'), 'classes': 'modal-forum' } %}
  62.             {% block content %}
  63.                 {% from 'utils.html.twig' import ico, switch %}
  64.                 <form id="forumFormEditTopic"
  65.                     action="{{ path('editForum', { id: forum.id }) }}"
  66.                     method="put" class="form-geral">
  67.                     <input type="hidden" id="topico-novo-user"  name="user" value="{{ user.id }}">
  68.                     <input type="hidden" id="topico-forum" name="forum" value="{{ forum.id }}">
  69.                     <input type="hidden" id="url-file-delete" name="urlFileDelete" value="{{ path('fileDeleteUpload') }}">
  70.                     <div class="cp">
  71.                         <label for="topico-novo-titulo">{{ getLanguage('topic_title', 'forum') }}</label>
  72.                         <input type="text" id="topico-novo-titulo" name="title" value="{{ forum.getTitle(true) }}" required>
  73.                     </div>
  74.                     <div class="cp">
  75.                         <label>{{ getLanguage('topic_text', 'forum') }}</label>
  76.                         <textarea class="modal-textbox js--editor-modal" id="topico-novo-texto" name="text" required>
  77.                             {{ forum.getText(true)|raw }}
  78.                         </textarea>
  79.                     </div>
  80.                     <div class="cp-cols cp-2 modal-forum">
  81.                         <div class="cp cp-gd categoria">
  82.                             <label for="topico-novo-categoria">{{ getLanguage('category', 'forum') }}</label>
  83.                             <select id="topico-novo-categoria" name="forumCategory" class="custom-select">
  84.                                 {% for forumCategory in forumCategories %}
  85.                                     <option value="{{ forumCategory.id }}">{{ forumCategory.category }}</option>
  86.                                 {% endfor %}
  87.                             </select>
  88.                         </div>
  89.                         {% if not isLow(getPermission("website", "forum", "edit")) %}
  90.                             <div class="cp cp-6 status">
  91.                                 <label for="topico-novo-status">{{ getLanguage('status', 'forum') }}</label>
  92.                                 {{ switch({
  93.                                     name: 'status',
  94.                                     classes: ['wid'],
  95.                                     checked: (forum.status == isForumStatusDefault ? true : false),
  96.                                     attribs: 'id="topico-novo-status"',
  97.                                     insideLabel: [getLanguage('published', 'forum'), getLanguage('filed', 'forum')],
  98.                                 })}}
  99.                             </div>
  100.                         {% endif %}
  101.                     </div>
  102.                     {# CAPTCHA #}
  103.                     {% include 'website/includes/captcha-form.html.twig' with { formName: 'forumFormEditTopic' } %}
  104.                     <nav class="actions">
  105.                         <button type="button" class="js--modal-fecha cancel">{{ getLanguage('cancel', 'forum') }}</button>
  106.                         <button type="submit" class="btn-continuar-peq">{{ getLanguage('send', 'forum') }}<i class="loader">{{ ico('loader-wish') }}</i></button>
  107.                     </nav>
  108.                 </form>
  109.             {% endblock %}
  110.         {% endembed %}
  111.     {% endif %}
  112. {% endblock %}
  113. {% block overlay %}
  114. <div class="loader-page">
  115.     <i class="loader">{{ ico('loader-wish') }}</i>
  116. </div>
  117. {% endblock %}