Commit f0ca7d2d authored by Mariia's avatar Mariia

style changes

parent 520f8e5e
...@@ -17,6 +17,10 @@ body { ...@@ -17,6 +17,10 @@ body {
margin: 0; margin: 0;
} }
h1 {
margin-bottom: 1.2rem !important;
}
.article-container, .article-container,
.article-container-user, .article-container-user,
.error-container { .error-container {
...@@ -168,15 +172,14 @@ label:after { ...@@ -168,15 +172,14 @@ label:after {
width: 20% !important; width: 20% !important;
} }
/*MAIN ADMIN*/ /*DMIN*/
th { th {
text-align: left; text-align: left;
} }
/*table { #article {
line-height: 2rem; margin-bottom: 2rem;
width: 100%; }
}*/
.action-btn { .action-btn {
padding: 0rem !important; padding: 0rem !important;
...@@ -184,7 +187,7 @@ th { ...@@ -184,7 +187,7 @@ th {
background-color: unset !important; background-color: unset !important;
text-decoration: none; text-decoration: none;
font-weight: 600; font-weight: 600;
margin: 0.2rem 0; margin: 0.5rem 0;
display: block; display: block;
} }
...@@ -212,6 +215,7 @@ figure.post-cover { ...@@ -212,6 +215,7 @@ figure.post-cover {
/*MAIN USER*/ /*MAIN USER*/
article { article {
margin-top: 1rem;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<form method="post" class="article-container"> <form method="post" class="article-container">
<h1>Edit Article</h1> <h1>Edit Article</h1>
<a href="{{ path('admin_article_index') }}" class="action-btn">Back to list</a> <a href="{{ path('admin_article_index') }}" class="action-btn">Back to list</a>
{{ include('admin_article/_form.html.twig', {'button_label': 'Update'}) }} <div>{{ include('admin_article/_form.html.twig', {'button_label': 'Update'}) }}
{{ include('admin_article/_delete_form.html.twig') }}</div>
</form> </form>
{% endblock %} {% endblock %}
...@@ -5,71 +5,75 @@ ...@@ -5,71 +5,75 @@
{% block body %} {% block body %}
<div class="article-container p-4"> <div class="article-container p-4">
{% if app.user %} {% if app.user %}
<div class="mb-4"> <div class="mb-4">
You are logged in as You are logged in as
<b>{{ app.user.username }}</b>. <b>{{ app.user.username }}</b>.
<a href="{{ path('app_logout') }}">Log out</a> <a href="{{ path('app_logout') }}">Log out</a>
</div> </div>
{% endif %} {% endif %}
<h1>Article index</h1> <h1>Article index</h1>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>
<th>Title</th> <th>Title</th>
<th>Cover</th> <th>Cover</th>
<th>Caption</th> <th>Caption</th>
<th>Text</th> <th>Text</th>
<th>PublishedAt</th> <th>PublishedAt</th>
<th>UpdatedAt</th> <th>UpdatedAt</th>
<th>Slug</th> <th>Slug</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for article in articles|reverse %} {% for article in articles|reverse %}
<tr> <tr>
<td>{{ article.id }}</td> <td>{{ article.id }}</td>
<td>{{ article.title }}</td> <td>{{ article.title }}</td>
<td> <td>
{% if article.cover %} {% if article.cover %}
<div class="admin-post-cover"> <div class="admin-post-cover">
<img src={{ article.cover }}> <img src={{ article.cover }}>
</div> </div>
{% endif %} {% endif %}
</td> </td>
<td> <td>
{% if article.caption %} {% if article.caption %}
{{ article.caption }} {{ article.caption }}
{% endif %} {% endif %}
</td> </td>
<td>{{ article.text|length > 50 ? article.text|slice(0, 50) ~ '...' : article.text}}</td> <td>{{ article.text|length > 50 ? article.text|slice(0, 50) ~ '...' : article.text}}</td>
<td>{{ article.publishedAt ? article.publishedAt|date('Y-m-d H:i:s') : '' }}</td> <td>{{ article.publishedAt ? article.publishedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ article.updatedAt ? article.updatedAt|date('Y-m-d H:i:s') : '' }}</td> <td>{{ article.updatedAt ? article.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ article.slug }}</td> {% if article.slug %}
<td> <td><span class="slug">{{ article.slug }}</span></td>
<a href="{{ path('admin_article_show', {'id': article.id}) }}" class="action-btn">Preview</a> {% else %}
<a href="{{ path('article_edit', {'id': article.id}) }}" class="action-btn">Edit</a> <td><span class="slug">no_slug</span></td>
{{ include('admin_article/_delete_form.html.twig') }} {% endif %}
<td>
<a href="{{ path('admin_article_show', {'id': article.id}) }}" class="action-btn">Preview</a>
<a href="{{ path('article_edit', {'id': article.id}) }}" class="action-btn">Edit</a>
{{ include('admin_article/_delete_form.html.twig') }}
</td> </td>
</tr> </tr>
{% else %} {% else %}
<tr> <tr>
<td colspan="6">no records found</td> <td colspan="6">no records found</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<a href="{{ path('article_new') }}" class="btn btn-lg btn-primary">Create new</a> <a href="{{ path('article_new') }}" class="btn btn-lg btn-primary">Create new</a>
</div> </div>
{% endblock %} {% endblock %}
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
{{ article.updatedAt ? article.updatedAt|date('Y-m-d à H:i:s') : '' }} {{ article.updatedAt ? article.updatedAt|date('Y-m-d à H:i:s') : '' }}
/</span> /</span>
{% endif %} {% endif %}
{% if article.slug %}
<span class="slug">{{ article.slug }}</span> <span class="slug">{{ article.slug }}</span>
{% else %}
<span class="slug">no_slug</span>
{% endif %}
<a href="{{ path('admin_article_index') }}" class="action-btn">Back to list</a> <a href="{{ path('admin_article_index') }}" class="action-btn">Back to list</a>
{% if article.cover %} {% if article.cover %}
<figure class="post-cover"> <figure class="post-cover">
...@@ -49,7 +53,7 @@ s.setAttribute('data-timestamp', + new Date()); ...@@ -49,7 +53,7 @@ s.setAttribute('data-timestamp', + new Date());
<a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript> </noscript>
<a href="{{ path('article_edit', {'id': article.id}) }}" class="action-btn">Edit</a>
<a href="{{ path('admin_article_index') }}" class="action-btn">Back to list</a> {{ include('admin_article/_delete_form.html.twig') }}
</form> </form>
{% endblock %} {% endblock %}
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block stylesheets %} {% block stylesheets %}
{{ parent() }} {{ parent() }}
<link href="{{ asset('css/style.css') }}" rel="stylesheet"/> <link href="{{ asset('css/style.css') }}" rel="stylesheet"/>
{% endblock %} {% endblock %}
{% block title %}MK Blog {% block title %}MK Blog
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<div class="article-container-user"> <div class="article-container-user">
{% for article in articles|reverse %} {% for article in articles|reverse %}
<article class="post-container"> <article class="post-container">
{% if article.cover %} {% if article.cover %}
<div class="preview-post-cover"> <div class="preview-post-cover">
<img src={{ article.cover }}> <img src={{ article.cover }}>
</div> </div>
</a> </a>
{% endif %} {% endif %}
<div class="post-content"> <div class="post-content">
<a href="{{ path('article_show', {'id': article.id}) }}"> <a href="{{ path('article_show', {'id': article.id}) }}">
<h2>{{ article.title }}</h2> <h2>{{ article.title }}</h2>
</a> </a>
<span class="datetime">Créé le {{ article.publishedAt ? article.publishedAt|date('Y-m-d à H:i:s') : '' }}</span> <span class="datetime">Créé le
{% if article.updatedAt %} {{ article.publishedAt ? article.publishedAt|date('Y-m-d à H:i:s') : '' }}</span>
<span class="datetime">/ Modifié le {{ article.updatedAt ? article.updatedAt|date('Y-m-d à H:i:s') : '' }} /</span> {% if article.updatedAt %}
{% endif %} <span class="datetime">/ Modifié le
<span class="slug">{{ article.slug }}</span> {{ article.updatedAt ? article.updatedAt|date('Y-m-d à H:i:s') : '' }}
<p>{{ article.text|length > 50 ? article.text|slice(0, 220) ~ '...' : article.text }}</p> /</span>
<a href="{{ path('article_show', {'id': article.id}) }}" class="btn btn-lg btn-primary">Read more</a> {% endif %}
</div> {% if article.slug %}
</article> <span class="slug">{{ article.slug }}</span>
{% endfor %} {% else %}
<span class="slug">no_slug</span>
{% endif %}
<p>{{ article.text|length > 50 ? article.text|slice(0, 220) ~ '...' : article.text }}</p>
<a href="{{ path('article_show', {'id': article.id}) }}" class="btn btn-lg btn-primary">Read more</a>
</div>
</article>
{% endfor %}
</div> </div>{% endblock %}
{% endblock %}
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
{{ article.updatedAt ? article.updatedAt|date('Y-m-d à H:i:s') : '' }} {{ article.updatedAt ? article.updatedAt|date('Y-m-d à H:i:s') : '' }}
/</span> /</span>
{% endif %} {% endif %}
<span class="slug">{{ article.slug }}</span> {% if article.slug %}
<span class="slug">{{ article.slug }}</span>
{% else %}
<span class="slug">no_slug</span>
{% endif %}
<a href="{{ path('article_index') }}" class="action-btn">Back to list</a> <a href="{{ path('article_index') }}" class="action-btn">Back to list</a>
{% if article.cover %} {% if article.cover %}
<figure class="post-cover"> <figure class="post-cover">
...@@ -49,7 +53,6 @@ s.setAttribute('data-timestamp', + new Date()); ...@@ -49,7 +53,6 @@ s.setAttribute('data-timestamp', + new Date());
<a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript> </noscript>
<a href="{{ path('article_index') }}" class="action-btn">Back to list</a> <a href="{{ path('article_index') }}" class="action-btn">Back to list</a>
</form> </form>
{% endblock %} {% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment