Commit f0ca7d2d authored by Mariia's avatar Mariia

style changes

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