Unverified Commit 5bc09f2c authored by KaMe's avatar KaMe Committed by GitHub

Merge pull request #1 from AsgardCms/3.0

updated 3.5.3
parents e7394a3c c59bf4c7
......@@ -2,13 +2,13 @@ export default {
methods: {
getCurrentEditor() {
const configuredEditor = window.AsgardCMS.editor;
if (configuredEditor === undefined || configuredEditor === 'ckeditor') {
return 'ckeditor';
}
if (configuredEditor === 'simplemde') {
return 'markdown-editor';
}
if (configuredEditor === 'ckeditor') {
return 'ckeditor';
}
return 'ckeditor';
return configuredEditor;
},
},
};
......@@ -8,5 +8,5 @@ class AsgardCms
* The AsgardCms version.
* @var string
*/
const VERSION = '3.5.2';
const VERSION = '3.5.3';
}
url: https://github.com/AsgardCms/Platform
versions:
"3.5.3":
changed:
- Updating Polish translations
- Updating Spanish translations
"3.5.2":
changed:
- Correctly returning the Query object from <code>allWithBuilder</code> method in base repository
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddDescriptionColumnToMenuitemsTranslationTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('menu__menuitem_translations', function (Blueprint $table) {
$table->string('description')->after('uri')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('menu__menuitem_translations', function (Blueprint $table) {
$table->dropColumn('description');
});
}
}
......@@ -27,6 +27,7 @@ class Menuitem extends Model
'link_type',
'locale',
'class',
'description',
];
protected $table = 'menu__menuitems';
......
......@@ -6,6 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class MenuitemTranslation extends Model
{
public $fillable = ['title', 'uri', 'url', 'status', 'locale'];
public $fillable = ['title', 'uri', 'url', 'status', 'locale', 'description'];
protected $table = 'menu__menuitem_translations';
}
......@@ -3,6 +3,7 @@
namespace Modules\Menu\Providers;
use Illuminate\Support\ServiceProvider;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
use Modules\Core\Events\BuildingSidebar;
use Modules\Core\Events\LoadingBackendTranslations;
use Modules\Core\Traits\CanGetSidebarClassForModule;
......@@ -122,7 +123,9 @@ class MenuServiceProvider extends ServiceProvider
]
);
} else {
$target = $item->link_type != 'external' ? $item->locale . '/' . $item->uri : $item->url;
$localisedUri = ltrim(parse_url(LaravelLocalization::localizeURL($item->uri), PHP_URL_PATH), '/');
$target = $item->link_type != 'external' ? $localisedUri : $item->url;
$menu->url(
$target,
$item->title,
......
......@@ -16,6 +16,11 @@
{!! Form::text("{$lang}[url]", old("{$lang}[url]"), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.url')]) !!}
{!! $errors->first("{$lang}[url]", '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group{{ $errors->has("{$lang}[description]") ? ' has-error' : '' }}">
{!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!}
{!! Form::text("{$lang}[description]", old("{$lang}[description]"), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!}
{!! $errors->first("{$lang}[description]", '<span class="help-block">:message</span>') !!}
</div>
<div class="checkbox">
<label for="{{$lang}}[status]">
......
......@@ -19,6 +19,12 @@
{!! Form::text("{$lang}[url]", old("{$lang}[url]", $old), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.url')]) !!}
{!! $errors->first("{$lang}[url]", '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group{{ $errors->has("{$lang}[description]") ? ' has-error' : '' }}">
{!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!}
<?php $old = $menuItem->hasTranslation($lang) ? $menuItem->translate($lang)->description : '' ?>
{!! Form::text("{$lang}[description]", old("{$lang}[description]", $old), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!}
{!! $errors->first("{$lang}[description]", '<span class="help-block">:message</span>') !!}
</div>
<div class="checkbox">
<?php $old = $menuItem->hasTranslation($lang) ? $menuItem->translate($lang)->status : false ?>
<label for="{{$lang}}[status]">
......
url: https://github.com/AsgardCms/Platform
versions:
"3.5.3":
changed:
- Description field added for extra convenience
- Use LaravelLocalization When Generating Menu Item URIs
- Updating typicms/nestablecollection package
"3.4.0":
changed:
- Using new <code>remember</code> method in the <code>CacheMenuDecorator</code> class
......
url: https://github.com/AsgardCms/Platform
versions:
"@unreleased":
"3.5.2":
changed:
- Adding support for UTF-8 slug for non ASCII characters (Chinese etc.)
"3.4.0":
......
......@@ -4,12 +4,19 @@ namespace Modules\Setting\Entities;
use Dimsav\Translatable\Translatable;
use Illuminate\Database\Eloquent\Model;
use Modules\Media\Support\Traits\MediaRelation;
class Setting extends Model
{
use Translatable;
use Translatable, MediaRelation;
public $translatedAttributes = ['value', 'description'];
protected $fillable = ['name', 'value', 'description', 'isTranslatable', 'plainValue'];
protected $table = 'setting__settings';
public function isMedia(): bool
{
$value = json_decode($this->plainValue, true);
return is_array($value) && isset($value['medias_single']);
}
}
......@@ -2,17 +2,40 @@
namespace Modules\Setting\Events;
use Modules\Media\Contracts\StoringMedia;
use Modules\Setting\Entities\Setting;
class SettingWasCreated
class SettingWasCreated implements StoringMedia
{
/**
* @var Setting
*/
public $setting;
public function __construct(Setting $setting)
/**
* @var array
*/
public $data;
public function __construct(Setting $setting, $data)
{
$this->setting = $setting;
$this->data = $data;
}
/**
* @inheritDoc
*/
public function getEntity()
{
return $this->setting;
}
/**
* @inheritDoc
*/
public function getSubmissionData()
{
return $this->data;
}
}
......@@ -2,17 +2,41 @@
namespace Modules\Setting\Events;
use Modules\Media\Contracts\StoringMedia;
use Modules\Setting\Entities\Setting;
class SettingWasUpdated
class SettingWasUpdated implements StoringMedia
{
/**
* @var Setting
*/
public $setting;
public function __construct(Setting $setting)
/**
* @var array
*/
public $data;
public function __construct(Setting $setting, $data)
{
$this->setting = $setting;
$this->data = $data;
}
/**
* @inheritDoc
*/
public function getEntity()
{
return $this->setting;
}
/**
* @inheritDoc
*/
public function getSubmissionData()
{
return $this->data;
}
}
......@@ -49,6 +49,16 @@ class EloquentSettingRepository extends EloquentBaseRepository implements Settin
$this->removeTokenKey($settings);
foreach ($settings as $settingName => $settingValues) {
// Check if media exists
if($settingName == 'medias_single') {
// Get first key of values (Original settingName)
foreach ($settingValues as $key => $value) {
$normalisedValue = [ $settingName => [$key => $value] ];
$settingName = $key;
break;
}
$settingValues = $normalisedValue;
}
if ($setting = $this->findByName($settingName)) {
$this->updateSetting($setting, $settingValues);
continue;
......@@ -99,7 +109,7 @@ class EloquentSettingRepository extends EloquentBaseRepository implements Settin
$setting->save();
event(new SettingWasCreated($setting));
event(new SettingWasCreated($setting, $settingValues));
return $setting;
}
......@@ -121,7 +131,7 @@ class EloquentSettingRepository extends EloquentBaseRepository implements Settin
}
$setting->save();
event(new SettingWasUpdated($setting));
event(new SettingWasUpdated($setting, $settingValues));
return $setting;
}
......
@php
$setting = isset($dbSettings[$settingName]) ? $dbSettings[$settingName] : null;
@endphp
@mediaSingle($settingName, $setting, null, trans($moduleInfo['description']))
@php
$setting = isset($dbSettings[$settingName]) ? $dbSettings[$settingName] : null;
@endphp
@mediaSingle($settingName, $setting, null, trans($moduleInfo['description']))
......@@ -36,6 +36,10 @@ class Settings implements Setting
return is_null($default) ? $defaultFromConfig : $default;
}
if($setting->isMedia() && $media = $setting->files()->first()) {
return $media->path;
}
if ($setting->isTranslatable) {
if ($setting->hasTranslation($locale)) {
return trim($setting->translate($locale)->value) === '' ? $defaultFromConfig : $setting->translate($locale)->value;
......
......@@ -78,5 +78,9 @@ abstract class BaseSettingTest extends TestCase
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
$this->artisan('migrate', [
'--database' => 'sqlite',
'--path' => 'Modules/Media/Database/Migrations',
]);
}
}
url: https://github.com/AsgardCms/Platform
versions:
"@unreleased":
added:
- New <code>@hasSetting()</code> and <code>@endHasSetting</code> directives
"3.5.3":
added:
- New setting type media-single
"3.4.0":
changed:
- Fix settings with falsey values not getting returned
......
......@@ -153,6 +153,17 @@ class TaggableTraitTest extends BaseTestCase
$this->assertCount(1, Page::whereTag(['한글-태그'])->get());
}
/** @test */
public function it_creates_page_without_tags()
{
$this->createPage(['original tag']);
$page = $this->page->find(1);
$page->setTags(null);
$this->assertEmpty(Page::first()->tags->count());
}
private function createPage(array $tags = [])
{
return $this->page->create([
......
......@@ -97,6 +97,10 @@ trait TaggableTrait
*/
public function setTags($tags, $type = 'slug')
{
if (empty($tags)) {
$tags = [];
}
// Get the current entity tags
$entityTags = $this->tags->pluck($type)->all();
......
url: https://github.com/AsgardCms/Platform
versions:
"3.5.3":
changed:
- Set tags only if passed any
"3.4.0":
changed:
- Using new <code>remember</code> method in the <code>CacheTagDecorator</code>
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Hauptmenü (für das Frontend-Routing)',
'description' => 'Menü Beschreibung (Kann für zusätzliche Informationen verwendet werden)',
],
'navigation' => [
'back to index' => 'Zurück zur Übersicht',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Primary menu (used for front-end routing)',
'description' => 'Menu Description (Can be used to provide extra information)',
],
'navigation' => [
'back to index' => 'Go back to the menu index',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Menú principal (usado para rutas del sitio)',
'description' => 'Descripción del menú (Se puede usar para proporcionar información adicional)',
],
'navigation' => [
'back to index' => 'Regresar',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Menu principal (utilisé pour le routage frontal)',
'description' => 'Description du menu (peut être utilisé pour fournir des informations supplémentaires)',
],
'navigation' => [
'back to index' => 'Retour vers l\'index des menus',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Menu primario (usato per il routing front-end)',
'description' => 'Descrizione del menu (può essere usato per fornire informazioni extra)',
],
'navigation' => [
'back to index' => 'Indietro all\'indice dei menu',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => '주 메뉴 (프론트엔드 라우팅에 사용됨)',
'description' => '메뉴 설명 (추가 정보를 제공하는 데 사용할 수 있음)',
],
'navigation' => [
'back to index' => '메뉴 목록으로 돌아가기',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Primair menu (gebruikt voor front-end routing)',
'description' => 'Menu Beschrijving (kan worden gebruikt om extra informatie te geven)',
],
'navigation' => [
'back to index' => 'Ga terug naar het menu overzicht',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Menu główne (używane jako nawigacja na stronie głównej)',
'description' => 'Opis menu (może być wykorzystany do dostarczenia dodatkowych informacji)',
],
'navigation' => [
'back to index' => 'Powrót do zarządzania menu',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Menu principal (usado para as rotas do site)',
'description' => 'Menu Descrição (pode ser usado para fornecer informações extras)',
],
'navigation' => [
'back to index' => 'Voltar para a listagem',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Начальное меню (используется для маршрутизации внешнего интерфейса)',
'description' => 'Описание меню (может использоваться для предоставления дополнительной информации)',
],
'navigation' => [
'back to index' => 'Вернуться к списку меню',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => 'Birincil menü (frond-end yönlendirmesi için kullanılır)',
'description' => 'Menü Açıklama (Ek bilgi sağlamak için kullanılabilir)',
],
'navigation' => [
'back to index' => 'Menüye geri dön',
......
......@@ -31,6 +31,7 @@ return [
'uri' => 'URI',
'url' => 'URL',
'primary' => '主菜单 (用于前台导航)',
'description' => '菜单说明(可用于提供额外的信息)',
],
'navigation' => [
'back to index' => '返回菜单首页',
......
<?php
return [
'login' => 'Logowanie',
'email' => 'Email',
'remember me' => 'Zapamiętaj mnie',
'forgot password' => 'Nie pamiętasz hasła?',
'register' => 'Rejestracja nowego konta',
'password' => 'Hasło',
'password confirmation' => 'Potwierdzenie hasła',
'register me' => 'Rejestracja',
'I already have a membership' => 'Mam już konto',
'reset password' => 'Resetowanie hasła',
'I remembered my password' => 'Pamiętam hasło',
'to reset password complete this form' => 'Aby zresetować hasło, wypełnij poniższe pole: ',
'welcome title' => 'Witamy',
'please confirm email' => 'Potwierdź swój adres e-mail, klikając poniższy link.',
'additional confirm email message' => 'Być może będziemy musieli przesłać Ci ważne informacje o naszej usłudze i ważne jest, abyśmy mieli prawidłowy adres e-mail.',
'confirm email button' => 'Potwierdź adres e-mail',
'end greeting' => 'Zespół',
'sign in welcome message' => 'Zaloguj się, aby rozpocząć sesję',
'reset password email was sent' => 'Wysłano e-mail umożliwiający zresetowanie hasła',
];
<?php
return [
'cancel' => 'Anuluj',
'delete' => 'Usuń',
'create' => 'Utwórz',
'update' => 'Zaktualizuj',
];
<?php
return [
/* Authentication */
'successfully logged in' => 'Pomyślnie zalogowano',
'account created check email for activation' => 'Konto utworzone. Sprawdź pocztę e-mail w celu aktywacji konta.',
'account activated you can now login' => 'Konto aktywowane. Możesz się już zalogować.',
'there was an error with the activation' => 'Konto zostało już aktywowane. Możesz już zalogować się przy użyciu swojego login i hasła.',
'no user found' => 'Użytkownik o podanym adresie e-mail nie istnieje.',
'check email to reset password' => 'Sprawdź pocztę e-mail, aby zresetować hasło.',
'user no longer exists' => 'Użytkownik już nie istnieje.',
'invalid reset code' => 'Kod resetowania wygasł lub jest nieprawidłowy.',
'password reset' => 'Hasło zostało zresetowane. Możesz już zalogować się przy użyciu nowego hasła.',
/* Email subjects */
'welcome' => 'Witamy.',
'reset password' => 'Zresetuj hasło do konta.',
/* User management */
'user created' => 'Pomyślnie utworzono użytkownika.',
'user not found' => 'Nie znaleziono użytkownika.',
'user updated' => 'Pomyślnie zaktualizowano użytkownika.',
'user deleted' => 'Pomyślnie usunięto użytkownika.',
/* Role management */
'role created' => 'Pomyślnie utworzono rolę.',
'role not found' => 'Nie znaleziono roli.',
'role updated' => 'Pomyślnie zaktualizowano rolę.',
'role deleted' => 'Pomyślnie usunięto rolę.',
/* Profile management */
'profile updated' => 'Pomyślnie zaktualizowano profil.',
];
<?php
return [
'new-role' => 'Nowa rola',
'title' => [
'roles' => 'Role',
'edit' => 'Edycja roli',
'users-with-roles' => 'Użytkownicy w tej roli',
],
'breadcrumb' => [
'roles' => 'Role',
'new' => 'Nowa rola',
'edit' => 'Edycja roli',
],
'table' => [
'name' => 'Nazwa',
'slug' => 'Slug',
],
'tabs' => [
'data' => 'Dane',
'permissions' => 'Uprawnienia',
],
'form' => [
'name' => 'Nazwa roli',
'slug' => 'Slug roli',
],
'navigation' => [
'back to index' => 'Powrót do zarządzania rolami',
],
'select all' => 'Zaznacz wszystkie',
'deselect all' => 'Odznacz wszystkie',
'swap' => 'Zamień',
'allow all' => 'Nadaj wszystkie',
'deny all' => 'Odbierz wszystkie',
'inherit all' => 'Dziedzicz wszystkie',
'allow' => 'Nadaj',
'deny' => 'Odbierz',
'inherit' => 'Dziedzicz z roli',
'list resource' => 'Wyświetlanie',
'create resource' => 'Tworzenie',
'edit resource' => 'Edycja',
'destroy resource' => 'Usuwanie',
];
<?php
return [
'button' => [
'new-user' => 'Nowy użytkownik',
],
'title' => [
'users' => 'Użytkownicy',
'new-user' => 'Nowy użytkownik',
'edit-user' => 'Edycja użytkownika',
'edit-profile' => 'Edycja profilu',
],
'breadcrumb' => [
'home' => 'Dom',
'users' => 'Użytkownicy',
'new' => 'Nowy',
'edit-user' => 'Edycja użytkownika',
'edit-profile' => 'Edycja profilu',
],
'tabs' => [
'data' => 'Dane',
'roles' => 'Role',
'permissions' => 'Uprawnienia',
'new password' => 'Nowe hasło',
'or send reset password mail' => 'lub wyślij e-mail w celu zresetowania hasła',
],
'form' => [
'first-name' => 'Imię',
'last-name' => 'Nazwisko',
'email' => 'E-mail',
'status' => 'Status',
'password' => 'Hasło',
'password-confirmation' => 'Potwierdzenie hasła',
'new password' => 'Nowe hasło',
'new password confirmation' => 'Potwierdzenie nowego hasła',
'is activated' => 'Aktywne',
],
'table' => [
'created-at' => 'Uworzony',
'first-name' => 'Imię',
'last-name' => 'Nazwisko',
'email' => 'E-mail',
'actions' => 'Akcje',
],
'navigation' => [
'back to index' => 'Powrót do zarządzania użytkownikami',
],
'new password setup' => 'Skonfiguruj nowe hasło',
'or send reset password mail' => 'lub wyślij e-mail w celu zresetowania hasła',
'send reset password email' => 'Wyślij e-mail',
'my account' => 'Moje Konto',
'profile' => 'Profil',
'api-keys' => 'Klucze API',
'generate new api key' => 'Generuj nowy klucz API',
'delete api key confirm' => 'Usunięcie klucza API uniemożliwi jakiejkolwiek aplikacji jego użycie.',
'your api keys' => 'Twoje klucze API',
'you have no api keys' => 'Nie masz kluczy API.',
'generate one' => 'Wygeneruj klucz.',
'token generated' => 'Pomyślnie wygenerowano klucz API',
'token deleted' => 'Pomyślnie usunięte klucz API',
'list user' => 'Wyświetlanie',
'create user' => 'Tworzenie',
'edit user' => 'Edycja',
'destroy user' => 'Usuwanie',
'edit profile' => 'Edycja',
'list api key' => 'Wyświetlanie',
'create api key' => 'Tworzenie',
'destroy api key' => 'Usuwanie',
'invalid login or password' => 'Login lub hasło nieprawidłowe.',
'account not validated' => 'Konto jeszcze nie zostało zatwierdzone. Sprawdź e-mail.',
'account is blocked' => 'Twoje konto jest zablokowane przez :delay sekund(y).',
];
<?php
return [
'title' => 'Zarządzanie modułami',
'breadcrumb' => [
'modules' => 'Moduły',
],
'tab' => [
'module list' => 'Lista modułów',
],
'button' => [
'save module configuration' => 'Zapisz konfigurację modułu',
],
'table' => [
'vendor' => 'Dostawca',
'name' => 'Nazwa',
'enabled' => 'Włączony',
'version' => 'Wersja',
],
'enabled' => 'Włączony',
'enable' => 'Włącz',
'disabled' => 'Wyłączony',
'disable' => 'Wyłącz',
'viewing module' => 'Moduł',
'module' => 'Moduł',
'publish assets' => 'Publikowanie zasobów',
'module enabled' => 'Moduł został włączony.',
'module disabled' => 'Moduł został wyłączony.',
'module cannot be disabled' => 'Jest to moduł podstawowy, którego nie można wyłączyć.',
'changelog' => 'Lista zmian',
'added' => 'Dodano',
'changed' => 'Zmieniono',
'removed' => 'Usunięto',
'list resource' => 'Wyświetlanie',
'show resource' => 'Pokazywanie',
'update resource' => 'Aktualizowanie',
'disable resource' => 'Wyłączanie',
'enable resource' => 'Włączanie',
];
<?php
return [
'title' => 'Zarządzanie motywami',
'breadcrumb' => [
'themes' => 'Motywy',
],
'theme' => 'Motyw',
'viewing theme' => 'Motyw :theme',
'type' => 'Rodzaj',
'list resource' => 'Wyświetlanie',
'show resource' => 'Pokazywanie',
'publish assets' => 'Publikowanie zasobów',
];
<?php
return [
'title' => 'Pomocnik modułów',
'subtitle' => [
'generate new module' => 'Wygeneruj nowy moduł',
'install new module by vendor name' => 'Zainstaluj moduł według dostawca/nazwa',
],
'tab' => [
'generators' => 'Generatory',
'migrations' => 'Migracje',
'seeds' => 'Posiew',
],
'form' => [
'module name' => 'Nazwa modułu',
'vendor name of the module' => 'Dostawca/nazwa modułu',
'install as subtree' => 'Zainstalować w poddrzewie?',
],
'button' => [
'generate new module' => 'Generuj nowy moduł',
'install new module' => 'Instaluj nowy moduł',
'migrate' => 'Migruj',
'seed' => 'Siej',
],
];
<?php
return [
'title' => 'Warsztat',
'modules' => 'Moduły',
'themes' => 'Motywy',
'show sidebar group' => 'Pokaż grupę w panelu',
];
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