Skip to content

Commit 39d4ad6

Browse files
committed
refactor(frontend): refactor index frontend page
1 parent 360cfcb commit 39d4ad6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/main/webapp/WEB-INF/i18n/messages.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ admin.navigation.profile = Perfil
2929
home.title = Oh My Blog!
3030
home.subtitle = Blog para los amantes del desarrollo web
3131
home.post.title = \u00daltimos 5 art\u00edculos publicados.
32+
home.not.article.user.login.subtitle = Bienvenido {0}!
33+
home.not.article.user.login.text = No existen art\u00edculos, s\u00e9 t\u00fa el primero y crear un art\u00edculo.
34+
home.create.new.post = Crear Art\u00edculo
35+
home.not.article.user.not.login.subtitle = No se han encontrado art\u00edculos
36+
home.not.article.user.not.login.text = Iniciar sesi\u00f3n para poder contribuir al blog.
37+
home.login = Iniciar Sesi\u00f3n
3238
##### About Page #######
3339
about.title = Acerca de este blog.
3440
about.subtitle = Apasionados de la programaci\u00f3n en general.

src/main/webapp/WEB-INF/templates/frontend/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ <h3 class="post-subtitle" th:text="${p.subtitle}">Post Subtitle</h3>
4040
<hr>
4141
</div>
4242
</div>
43+
<div th:if="${#lists.isEmpty(latest5posts)}">
44+
<th:block sec:authorize="isAuthenticated()">
45+
<h2 th:text="#{home.not.article.user.login.subtitle(${#authentication.name})}">Welcome User!.</h2>
46+
<h3 th:text="#{home.not.article.user.login.text}">Create Post</h3>
47+
<a th:href="@{/admin/posts/create}" th:text="#{home.create.new.post}">Create a new post</a>
48+
</th:block>
49+
<th:block sec:authorize="!isAuthenticated()">
50+
<h2 th:text="#{home.not.article.user.not.login.subtitle}">Login User.</h2>
51+
<h3 th:text="#{home.not.article.user.not.login.text}">Init Session</h3>
52+
<a th:href="@{/admin/login}" th:text="#{home.login}">login user</a>
53+
</th:block>
54+
</div>
4355
</div>
4456
</div>
4557
</div>

0 commit comments

Comments
 (0)