Commit c889e94d authored by Aster's avatar Aster Committed by waltermazza
Browse files

General Bug Fixes and Improvements

parent 739bece7
{
"name": "arter/amos-news",
"description": "Sistema AMOS per le news",
"keywords": [
"amos",
"yii2",
"news"
],
"keywords": ["amos", "yii2", "news"],
"homepage": "http://www.arter.it/",
"type": "component",
"license": "BSD-3-Clause",
......@@ -19,13 +15,13 @@
"php": ">=5.4.0",
"2amigos/yii2-ckeditor-widget": "~1.0",
"cornernote/yii2-workflow-manager": "*",
"arter/amos-admin": "^2.0",
"arter/amos-admin":"^2.2.0",
"arter/amos-attachments": "^1.1.11",
"arter/amos-comments": "^1.1",
"arter/amos-core": "^1.9.60",
"arter/amos-dashboard": "^1.8.4",
"arter/amos-notify": "^1.4.13",
"arter/amos-report": "^1.0.5",
"arter/amos-comments":"^1.1",
"arter/amos-core":"^1.15.0",
"arter/amos-dashboard":"^1.8.4",
"arter/amos-notify":"^1.4.13",
"arter/amos-report":"^1.0.5",
"arter/amos-workflow": "^1.0.5",
"arter/amos-seo": "*",
"raoul2000/yii2-workflow": "*",
......@@ -51,4 +47,4 @@
"require-dev": {
"yiisoft/yii2-faker": "*"
}
}
\ No newline at end of file
}
......@@ -4,7 +4,7 @@
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
*
* @see https://repo.art-er.it Developers' community
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
......@@ -32,96 +32,96 @@ use yii\helpers\ArrayHelper;
* Class AmosNews
* @package arter\amos\news
*/
class AmosNews extends AmosModule implements ModuleInterface, SearchModuleInterface, CmsModuleInterface
{
class AmosNews extends AmosModule implements ModuleInterface, SearchModuleInterface, CmsModuleInterface {
const
MAX_LAST_NEWS_ON_DASHBOARD = 3;
const
MAX_LAST_NEWS_ON_DASHBOARD = 3;
public static $CONFIG_FOLDER = 'config';
public static $CONFIG_FOLDER = 'config';
/**
* @var string|boolean the layout that should be applied for views within this module. This refers to a view name
* relative to [[layoutPath]]. If this is not set, it means the layout value of the [[module|parent module]]
* will be taken. If this is false, layout will be disabled within this module.
*/
public $layout = 'main';
/**
* @var string|boolean the layout that should be applied for views within this module. This refers to a view name
* relative to [[layoutPath]]. If this is not set, it means the layout value of the [[module|parent module]]
* will be taken. If this is false, layout will be disabled within this module.
*/
public $layout = 'main';
/**
* @var string $name
*/
public $name = 'Notizie';
/**
* @var string $name
*/
public $name = 'Notizie';
/**
* If this attribute is true the validation of the publication date is active
* @var boolean $validatePublicationDate
*/
public $validatePublicationDate = true;
/**
* If this attribute is true the validation of the publication date is active
* @var boolean $validatePublicationDate
*/
public $validatePublicationDate = true;
/**
* @var bool|false $filterCategoriesByRole - if true, enables category role check via table news_category_roles_mm
*/
public $filterCategoriesByRole = false;
/**
* @var bool|false $filterCategoriesByRole - if true, enables category role check via table news_category_roles_mm
*/
public $filterCategoriesByRole = false;
/**
/**
* @var array
*/
public $whiteListRolesCategories = ['ADMIN', 'BASIC_USER'];
/**
* @var bool|false $hidePubblicationDate
*/
public $hidePubblicationDate = false;
/**
* Hide the Option wheel in the graphic widget
* @var bool|false $hideWidgetGraphicsActions
*/
public $hideWidgetGraphicsActions = false;
/**
* @var array $newsRequiredFields - mandatory fields in News form
*/
public $newsRequiredFields = [
'news_categorie_id',
'titolo',
'status',
'descrizione',
];
/**
* The ID of the default category pre-selected for the new News
* @var integer
*/
public $defaultCategory;
/**
* The default value for enable comments
* @var integer
*/
public $defaultEnableComments = 1;
/**
* @var bool $hideDataRimozioneView
*/
public $hideDataRimozioneView = false;
/**
* @var bool|false $hidePubblicationDate
*/
public $hidePubblicationDate = false;
/**
* Hide the Option wheel in the graphic widget
* @var bool|false $hideWidgetGraphicsActions
*/
public $hideWidgetGraphicsActions = false;
/**
* @var array $newsRequiredFields - mandatory fields in News form
*/
public $newsRequiredFields = [
'news_categorie_id',
'titolo',
'status',
'descrizione',
];
/**
* The ID of the default category pre-selected for the new News
* @var integer
*/
public $defaultCategory;
/**
* The default value for enable comments
* @var integer
*/
public $defaultEnableComments = 1;
/**
* @var bool $hideDataRimozioneView
*/
public $hideDataRimozioneView = false;
/**
* @var array $defaultListViews This set the default order for the views in lists
*/
public $defaultListViews = ['list', 'grid'];
/**
* This set the auto update of the publication date on the save if the news is published
* @var boolean $autoUpdatePublicationDate
*/
public $autoUpdatePublicationDate = false;
/**
*
* @var type
*/
public $defaultWidgetIndexUrl = '/news/news/own-interest-news';
/**
* @var array $defaultListViews This set the default order for the views in lists
*/
public $defaultListViews = ['list', 'grid'];
/**
* This set the auto update of the publication date on the save if the news is published
* @var boolean $autoUpdatePublicationDate
*/
public $autoUpdatePublicationDate = false;
/**
*
* @var type
*/
public $defaultWidgetIndexUrl = '/news/news/own-interest-news';
/**
* @var bool
......@@ -133,30 +133,39 @@ class AmosNews extends AmosModule implements ModuleInterface, SearchModuleInterf
*/
public $showAllCategoriesForCommunity = true;
/**
* @var array
*/
public $viewPathEmailSummary = [
'arter\amos\news\models\News' => '@vendor/arter/amos-news/src/views/email/notify_summary'
];
public $viewPathEmailSummaryNetwork = [
'arter\amos\news\models\News' => '@vendor/arter/amos-news/src/views/email/notify_summary_network'
];
/*
* @var bool disableStandardWorkflow Disable standard worflow, direct publish
*/
public $disableStandardWorkflow = false;
/*
* @var int $numberListTag 10 default
*/
public $numberListTag = 10;
/**
* @inheritdoc
*/
public static function getModuleName()
{
return "news";
}
/**
* @inheritdoc
*/
public static function getModuleName() {
return "news";
}
/**
/**
* @inheritdoc
*/
public static function getModelSearchClassName()
{
return models\search\NewsSearch::className();
return AmosNews::instance()->model('NewsSearch');
}
/**
......@@ -164,76 +173,72 @@ class AmosNews extends AmosModule implements ModuleInterface, SearchModuleInterf
*/
public static function getModelClassName()
{
return models\News::className();
return AmosNews::instance()->model('News');
}
/**
* @inheritdoc
*/
public static function getModuleIconName()
{
return 'feed';
}
/**
* @inheritdoc
*/
public function init()
{
parent::init();
\Yii::setAlias('@arter/amos/' . static::getModuleName() . '/controllers', __DIR__ . '/controllers');
//Configuration: merge default module configurations loaded from config.php with module configurations set by the application
$config = require(__DIR__ . DIRECTORY_SEPARATOR . self::$CONFIG_FOLDER . DIRECTORY_SEPARATOR . 'config.php');
\Yii::configure($this, ArrayHelper::merge($config, $this));
}
/**
* @inheritdoc
*/
public function getWidgetIcons()
{
return [
WidgetIconNews::className(),
WidgetIconNewsCategorie::className(),
WidgetIconNewsCreatedBy::className(),
WidgetIconNewsDaValidare::className(),
WidgetIconNewsDashboard::className(),
WidgetIconAllNews::className(),
];
}
/**
* @inheritdoc
*/
public static function getModuleIconName() {
return 'feed';
}
/**
* @inheritdoc
*/
public function init() {
parent::init();
\Yii::setAlias('@arter/amos/' . static::getModuleName() . '/controllers', __DIR__ . '/controllers');
//Configuration: merge default module configurations loaded from config.php with module configurations set by the application
$config = require(__DIR__ . DIRECTORY_SEPARATOR . self::$CONFIG_FOLDER . DIRECTORY_SEPARATOR . 'config.php');
\Yii::configure($this, ArrayHelper::merge($config, $this));
}
/**
* @inheritdoc
*/
public function getWidgetIcons() {
return [
WidgetIconNews::className(),
WidgetIconNewsCategorie::className(),
WidgetIconNewsCreatedBy::className(),
WidgetIconNewsDaValidare::className(),
WidgetIconNewsDashboard::className(),
WidgetIconAllNews::className(),
];
}
/**
* @inheritdoc
*/
public function getWidgetGraphics() {
return [
WidgetGraphicsUltimeNews::className(),
];
}
/**
* Get default model classes
*/
protected function getDefaultModels() {
return [
'News' => __NAMESPACE__ . '\\' . 'models\News',
'NewsCategorie' => __NAMESPACE__ . '\\' . 'models\NewsCategorie',
'NewsSearch' => __NAMESPACE__ . '\\' . 'models\search\NewsSearch',
];
}
/**
* @inheritdoc
*/
public function getWidgetGraphics()
{
return [
WidgetGraphicsUltimeNews::className(),
];
}
/**
* This method return the session key that must be used to add in session
* the url from the user have started the content creation.
* @return string
*/
public static function beginCreateNewSessionKey() {
return 'beginCreateNewUrl_' . self::getModuleName();
}
/**
* Get default model classes
*/
protected function getDefaultModels()
{
return [
'News' => __NAMESPACE__ . '\\' . 'models\News',
'NewsCategorie' => __NAMESPACE__ . '\\' . 'models\NewsCategorie',
'NewsSearch' => __NAMESPACE__ . '\\' . 'models\search\NewsSearch',
];
}
/**
* This method return the session key that must be used to add in session
* the url from the user have started the content creation.
* @return string
*/
public static function beginCreateNewSessionKey()
{
return 'beginCreateNewUrl_' . self::getModuleName();
}
}
......@@ -4,11 +4,11 @@
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
*
* @see https://repo.art-er.it Developers' community
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\news\assets
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -8,13 +8,15 @@ IMPORT STYLE-CUSTOM
*/
@import (optional) "../../backend/web/less/style_custom.less";
@height-slider-latest-news-touch: 165px;
@height-slider-latest-news-touch-tab: 290px;
@height-slider-latest-news: 395px;
@slider-controls-background-color: #333333;
/**
GRAPHIC WIDGET
*/
.wrap-graphic-widget .box-widget.latest-news section.list-news-full {
padding: 0;
}
.field-news-comments_enabled {
margin-top: 6px;
......@@ -90,12 +92,12 @@ NEWS CARD
@news-card-header-color: fade(@primary-color, 70%);
@news-card-post-header-color: @light-background-primary-color;
[data-role="list-view"]{
[data-role="list-view"]{
.grid-sizer,
.grid-item {
width: 32.5%;
width: 30%;
@media screen and (min-width: 768px) and (max-width: 991px) {
width: 49%;
width: 43%;
}
@media screen and (min-width: 320px) and (max-width: 767px) {
width: 100%;
......@@ -174,4 +176,135 @@ NEWS CARD
}
}
}
}
/**
NEWS OWL CAROUSEL
*/
.wrap-graphic-widget .box-widget.latest-news section.list-news-full {
padding: 0;
}
.wrap-slide-carousel-box {
.flexbox;
.wrap-item-carousel-box {
position: relative;
.abstract {
position: absolute;
bottom: 0;
left: 0;
right: -1px;
padding: 0 15px;
color: @white-color;
.linear-gradient(to bottom, rgba(0, 0, 0, 0), 0%, rgba(0, 0, 0, 1), 100%);
a {
text-decoration: none;
color: @white-color;
&:hover {
.box-widget-subtitle {
color: @white-color;
text-decoration: underline;
}
}
}
@media screen and (min-width: @desktop-only) {
.box-widget-text {
.line-clamp(2);
}
}
}
img {
object-fit: cover;
width: 100%;
height: 100%;
}
}
}
#newsOwlCarousel {
position: relative;
.owl-stage {
padding-bottom: 20px;
background-color: #000;
}
.wrap-item-carousel-box {
width: 50%;
min-height: @height-slider-latest-news;
position: relative;
.abstract {
top: 68%;
}
}
.owl-nav:not(.disabled) {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
justify-content: space-between;
pointer-events: none;
.owl-next,
.owl-prev {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background-color: @slider-controls-background-color;
color: @white-color;
font-size: 3rem;
line-height: 3rem;
opacity: .7;
cursor: pointer;
pointer-events: auto;
position: relative !important;
}
/* nascondo per evitare sovrapposizioni con il view-all */
.owl-prev {
opacity: 0;
pointer-events: none;
}
}
}
#newsOwlCarouselTouch {
.wrap-item-carousel-box {
min-width: 100%;
min-height: @height-slider-latest-news-touch;
.abstract {
top: auto;
bottom: 0;
padding: 10px;
}
}
.owl-dot span {
height: 12px;
width: 12px;
border-radius: 6px;
}
.box-widget-subtitle {
font-size: 1.2em;
}
@media screen and (min-width: @tablet) {
.wrap-item-carousel-box {
min-height: @height-slider-latest-news-touch-tab;
}
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
*
* @see https://repo.art-er.it Developers' community
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
......
......@@ -4,11 +4,11 @@
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
*
* @see https://repo.art-er.it Developers' community
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\news\config
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
......@@ -33,7 +33,7 @@ return [
'titolo',
'data_pubblicazione'
],
'default_field' => 'data_pubblicazione',
'default_field' => ['data_pubblicazione', 'created_at'],
'order_type' => SORT_DESC
]
],
......
......@@ -4,11 +4,11 @@
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
*
* @see https://repo.art-er.it Developers' community
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\news\config
* @package arter\amos\news
* @category CategoryName