forked from ZwiiCMS-Team/ZwiiCMS
news
This commit is contained in:
parent
f74fd63295
commit
57b2055e5c
@ -90,23 +90,6 @@ img[align='right'] {
|
||||
Signature dans les articles blog et news
|
||||
*/
|
||||
|
||||
#blogPicture {
|
||||
text-align: center;
|
||||
margin-right: -10px;
|
||||
}
|
||||
|
||||
#blogTitle {
|
||||
background-color: #ECEFF1;
|
||||
padding: 3px;
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
#blogDate {
|
||||
font-size:0.8em;
|
||||
font-style: italic;
|
||||
color: grey;
|
||||
}
|
||||
|
||||
.signature {
|
||||
font-size: 0.8em;
|
||||
font-style: italic;
|
||||
|
@ -37,7 +37,7 @@ class blog extends common {
|
||||
|
||||
public static $users = [];
|
||||
|
||||
const BLOG_VERSION = '1.1';
|
||||
const BLOG_VERSION = '1.2';
|
||||
|
||||
/**
|
||||
* Édition
|
||||
|
@ -4,6 +4,7 @@
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
margin-top: 15px;
|
||||
}
|
||||
#blogArticleCommentShow {
|
||||
cursor: text;
|
||||
@ -11,11 +12,16 @@
|
||||
#blogArticleOr {
|
||||
padding: 10px;
|
||||
}
|
||||
/* Modif CroqueWeb */
|
||||
.blogDate {
|
||||
font-size:0.8em;
|
||||
font-style: italic;
|
||||
color: grey;
|
||||
margin-left: 10px;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
#blogArticlePicture {
|
||||
height:150px;
|
||||
max-width: 100%;}
|
||||
}
|
||||
/* fin modif croqueweb */
|
||||
|
||||
|
||||
|
@ -1,18 +1,22 @@
|
||||
<!--
|
||||
code d'origine
|
||||
<div id="blogArticlePicture" style="background-image:url('<?php echo helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']); ?>');"></div>
|
||||
|
||||
-->
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'hidePicture']) == false) {
|
||||
echo '<div><img src="'.helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']).'"></div>';
|
||||
}
|
||||
?>
|
||||
<div class="blogDate">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<?php echo utf8_encode(strftime('- %d %B %Y', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
|
||||
à <?php echo utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
|
||||
</div>
|
||||
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'hidePicture']) == false) {
|
||||
echo '<div id="blogArticlePicture" style="background-image:url(' . helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']) . ');"></div>';
|
||||
} ?>
|
||||
|
||||
<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'content']); ?>
|
||||
<!-- <h4 class="textAlignRight"> -->
|
||||
<p class="signature">
|
||||
<?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'firstname']); ?>
|
||||
<?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'lastname']); ?>
|
||||
<?php echo utf8_encode(strftime('- %d %B %Y', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
|
||||
à <?php echo utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
|
||||
<!-- </h4> -->
|
||||
</p>
|
||||
|
||||
|
@ -1,18 +1,34 @@
|
||||
.blogPicture {
|
||||
float: left;
|
||||
margin: 10px 20px 0 0;
|
||||
float: center;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.blogPicture:hover {
|
||||
opacity: .7;
|
||||
}
|
||||
.block:after {
|
||||
.row:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
.blogComment {
|
||||
padding-right: 10px;
|
||||
float: right;
|
||||
}
|
||||
.blogTitle {
|
||||
background-color: #ECEFF1;
|
||||
padding: 5px;
|
||||
margin-left: -10px;
|
||||
}
|
||||
.blogContent {
|
||||
float: left;
|
||||
margin-left: -10px;
|
||||
}
|
||||
.blogDate {
|
||||
font-size:0.8em;
|
||||
font-style: italic;
|
||||
color: grey;
|
||||
margin-left: 10px;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.blogContent {
|
||||
display: none;
|
||||
|
@ -3,13 +3,13 @@
|
||||
<div class="col12">
|
||||
<?php foreach($module::$articles as $articleId => $article): ?>
|
||||
<div class="row">
|
||||
<div class="col3" id="blogPicture" >
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
|
||||
<div class="col3">
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
|
||||
<img src="<?php echo helper::baseUrl(false) . 'site/file/thumb/' . $article['picture']; ?>">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col9">
|
||||
<h1 id="blogTitle">
|
||||
<h1 class="blogTitle">
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
|
||||
<?php echo $article['title']; ?>
|
||||
</a>
|
||||
@ -20,16 +20,14 @@
|
||||
</a>
|
||||
<?php echo template::ico('comment', 'left'); ?>
|
||||
</div>
|
||||
<div id="blogDate">
|
||||
<div class="blogDate">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<?php echo utf8_encode(strftime('%d %B %Y', $article['publishedOn'])); ?>
|
||||
</div>
|
||||
|
||||
<p class="blogContent">
|
||||
<?php echo helper::subword(strip_tags($article['content']), 0, 300); ?>...
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">Lire la suite</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
|
@ -32,7 +32,7 @@ class news extends common {
|
||||
false => 'Brouillon',
|
||||
true => 'Publié'
|
||||
];
|
||||
const NEWS_VERSION = '1.1';
|
||||
const NEWS_VERSION = '1.2';
|
||||
|
||||
public static $users = [];
|
||||
|
||||
|
23
module/news/view/index/index.css
Normal file
23
module/news/view/index/index.css
Normal file
@ -0,0 +1,23 @@
|
||||
.newsTitle {
|
||||
background-color: #ECEFF1;
|
||||
padding:5px;
|
||||
}
|
||||
.newsContent {
|
||||
clear: left;
|
||||
margin-left: 10px;
|
||||
padding: 5px;
|
||||
}
|
||||
.newsDate {
|
||||
font-size:0.8em;
|
||||
font-style: italic;
|
||||
color: grey;
|
||||
margin-left:10px;
|
||||
float: left;
|
||||
}
|
||||
.newsSignature {
|
||||
margin-right:10px;
|
||||
float:right;
|
||||
font-size:0.8em;
|
||||
font-style: italic;
|
||||
color: grey;
|
||||
}
|
@ -2,18 +2,21 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php foreach($module::$news as $newsId => $news): ?>
|
||||
<div class="block">
|
||||
<h4>
|
||||
Le <?php echo utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
|
||||
à <?php echo utf8_encode(strftime('%H:%M', $news['publishedOn'])); ?>
|
||||
</h4>
|
||||
<h2><?php echo $news['title']; ?></h2>
|
||||
<?php echo $news['content']; ?>
|
||||
<p class="signature">
|
||||
<?php echo $this->getData(['user', $news['userId'], 'firstname']) . ' ' . $this->getData(['user', $news['userId'], 'lastname']); ?>
|
||||
</p>
|
||||
<div class="clearBoth"></div>
|
||||
<h1 class="newsTitle">
|
||||
<?php echo $news['title']; ?>
|
||||
</h1>
|
||||
<div class="newsDate">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<?php echo utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
|
||||
</div>
|
||||
<div class="newsSignature">
|
||||
<?php echo $this->getData(['user', $news['userId'], 'firstname']) . ' ' . $this->getData(['user', $news['userId'], 'lastname']); ?>
|
||||
</div>
|
||||
<div class="newsContent">
|
||||
<?php echo $news['content']; ?>
|
||||
</div>
|
||||
<div class="clearBoth"></div>
|
||||
<hr />
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user