Skip to content

Commit e18393d

Browse files
author
Zane
committed
Editor setup
1 parent b8fd994 commit e18393d

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

‎src/Controller/ArticleController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ protected function buildHtml(string $tagSlugDashId, string $articleSlugDashId) :
8686
'activeMenu' => $article->getActiveMenu(),
8787
'FrontendHelper' => $this->frontendHelper,
8888
'CurrentUser' => $this->factory->getCurrentUser(),
89+
'ArticleFormats' => [
90+
Article::FORMAT_ARTICLE => 'Articolo, guida, recensione',
91+
Article::FORMAT_NEWS => 'Notizia, segnalazione'
92+
],
8993
'Article' => $article,
9094
'ArticleHowTo' => $articleHowTo,
9195
'BitTorrentGuide' => $this->factory->createArticle()->load(Article::ID_BITTORRENT_GUIDE),

‎src/Service/Cms/Article.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ public function getPublishedAtRecencyLabel() : ?string
165165
}
166166

167167
public function isNews() : bool { return $this->entity->getFormat() == ArticleEntity::FORMAT_NEWS; }
168+
169+
public function getFormat() : string { return $this->entity->getFormat(); }
168170
//</editor-fold>
169171

170172
//<editor-fold defaultstate="collapsed" desc="*** 🖼️ Images ***">

‎templates/article/index.html.twig

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
as="style" onload="this.onload=null;this.rel='stylesheet'">
88

99
{% if Article.currentUserCanEdit %}
10-
<link rel="preload" href="{{ asset('build/article-edit.css') }}"
11-
as="style" onload="this.onload=null;this.rel='stylesheet'">
10+
<link rel="stylesheet" href="{{ asset('build/article-edit.css') }}">
1211
{% endif %}
1312

1413
{% endblock %}
@@ -171,13 +170,13 @@
171170

172171
{% if Article.isReadable %}
173172

174-
<div id="tli-article-body" class="post-text mt-30 tli-article-body {% if Article.currentUserCanEdit %}form-control{% endif %}"
175-
{% if Article.currentUserCanEdit %}
176-
contenteditable="true" data-tli-editable-id="body"
177-
{% endif %}>
173+
<div id="tli-article-body" data-tli-editable-id="body"
174+
class="post-text mt-30 tli-article-body {% if Article.currentUserCanEdit %}form-control{% endif %}">
178175
{{ Article.bodyForDisplay|raw }}
179176
</div>
180177

178+
{% include 'article/editor/statusbar.html.twig' %}
179+
181180

182181
{% if Article.isInReview or Article.isPublished %}
183182

@@ -202,8 +201,6 @@
202201

203202
{% endif %}
204203

205-
{% include 'article/editor/statusbar.html.twig' %}
206-
207204
</div>
208205

209206
<div id="tli-article-authors-bio" class="tli-article-box mt-30 container">

0 commit comments

Comments
 (0)