Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MK blog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maria Kaptur
MK blog
Commits
f0ca7d2d
Commit
f0ca7d2d
authored
Nov 19, 2019
by
Mariia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style changes
parent
520f8e5e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
123 additions
and
103 deletions
+123
-103
public/css/main.css
public/css/main.css
+10
-6
templates/admin_article/edit.html.twig
templates/admin_article/edit.html.twig
+6
-6
templates/admin_article/index.html.twig
templates/admin_article/index.html.twig
+63
-59
templates/admin_article/show.html.twig
templates/admin_article/show.html.twig
+6
-2
templates/article/index.html.twig
templates/article/index.html.twig
+33
-28
templates/article/show.html.twig
templates/article/show.html.twig
+5
-2
No files found.
public/css/main.css
View file @
f0ca7d2d
...
...
@@ -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 A
DMIN*/
/*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.
2
rem
0
;
margin
:
0.
5
rem
0
;
display
:
block
;
}
...
...
@@ -212,6 +215,7 @@ figure.post-cover {
/*MAIN USER*/
article
{
margin-top
:
1rem
;
margin-bottom
:
2rem
;
}
...
...
templates/admin_article/edit.html.twig
View file @
f0ca7d2d
...
...
@@ -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
%}
templates/admin_article/index.html.twig
View file @
f0ca7d2d
...
...
@@ -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
%}
templates/admin_article/show.html.twig
View file @
f0ca7d2d
...
...
@@ -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
%}
templates/article/index.html.twig
View file @
f0ca7d2d
{%
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
%}
templates/article/show.html.twig
View file @
f0ca7d2d
...
...
@@ -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
%}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment