Skip to content

Commit

Permalink
Merge branch 'develop' into create-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Oct 14, 2023
2 parents 449efbd + 751545f commit adde4be
Show file tree
Hide file tree
Showing 69 changed files with 603 additions and 282 deletions.
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files.associations": {
"**/modules/*/behaviors/*/partials/*.htm": "php",
"**/modules/*/blocks/*.block": "wintercms",
"**/modules/*/blocks/*.block": "wintercms-block",
"**/modules/*/controllers/*/*.htm": "php",
"**/modules/*/formwidgets/*/partials/*.htm": "php",
"**/modules/*/layouts/*.htm": "php",
Expand All @@ -12,7 +12,7 @@
"**/modules/*/widgets/*/partials/*.htm": "php",

"**/plugins/*/*/behaviors/*/partials/*.htm": "php",
"**/plugins/*/*/blocks/*.block": "wintercms",
"**/plugins/*/*/blocks/*.block": "wintercms-block",
"**/plugins/*/*/components/**/*.htm": "wintercms-twig",
"**/plugins/*/*/controllers/*/*.htm": "php",
"**/plugins/*/*/formwidgets/*/partials/*.htm": "php",
Expand All @@ -23,7 +23,7 @@
"**/plugins/*/*/views/mail/*.htm": "wintercms",
"**/plugins/*/*/widgets/*/partials/*.htm": "php",

"**/themes/*/blocks/**/*.block": "wintercms",
"**/themes/*/blocks/**/*.block": "wintercms-block",
"**/themes/*/content/**/*.htm": "wintercms",
"**/themes/*/layouts/*.htm": "wintercms",
"**/themes/*/pages/**/*.htm": "wintercms",
Expand All @@ -32,6 +32,7 @@
"emmet.includeLanguages": {
"wintercms": "html",
"wintercms-twig": "html",
"wintercms-block": "html"
},
"eslint.validate": [
"javascript",
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ No matter how large or small your project is, Winter provides a rich development
[![Tests](https://img.shields.io/github/actions/workflow/status/wintercms/winter/tests.yml?branch=develop&label=tests&style=flat-square)](https://github.com/wintercms/winter/actions)
[![License](https://img.shields.io/github/license/wintercms/winter?label=open%20source&style=flat-square)](https://packagist.org/packages/wintercms/winter)
[![Discord](https://img.shields.io/discord/816852513684193281?label=discord&style=flat-square)](https://discord.gg/D5MFSPH6Ux)
[![RINGER](https://www.ringerhq.com/images/get-support-on-ringer.svg)](https://www.ringerhq.com/i/wintercms/winter)

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/wintercms/winter)

Expand Down Expand Up @@ -45,7 +46,7 @@ The best place to learn Winter is by [reading the documentation](https://winterc

Winter was forked from October CMS in March 2021 due to a difference in open source management philosophies between the core maintainer team and the two founders of October.

The development of Winter is lead by [Luke Towers](https://luketowers.ca/), along with many wonderful people that dedicate their time to help support and grow the community.
The development of Winter is lead by [Luke Towers](https://luketowers.ca/), along with many wonderful people that dedicate their time to help support and grow the community. The [Frostbyte Foundation](mailto:[email protected]) provides an organisational backing for the project and the continued development of Winter, its plugins and themes and its ecosystem.

<table>
<tr>
Expand Down
3 changes: 3 additions & 0 deletions modules/backend/assets/css/winter.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
.sweet-alert h2{word-break:break-word;word-wrap:break-word;max-height:350px;overflow-y:auto;margin:10px 0 17px 0;color:#2b3e50;text-align:left;font-size:15px;line-height:23px}
.sweet-alert p{margin:0}
.sweet-alert p.text-muted{margin-bottom:20px;color:#555}
.global-notice{position:sticky;top:0;display:flex;align-items:center;flex-wrap:wrap;gap:0.5em;justify-content:space-between;z-index:10500;background:#ab2a1c;color:#FFF;padding:0.5em 0.75em}
.global-notice .notice-icon{font-size:1.5em;vertical-align:bottom;display:inline-block;margin-right:.25em}
.global-notice .notice-text{display:inline-block;vertical-align:middle}
.control-simplelist{font-size:13px;padding:20px 20px 2px 20px;margin-bottom:20px;background:#fff;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}
.control-simplelist ul{padding-left:15px}
.control-simplelist.form-control ul{margin-bottom:0}
Expand Down
25 changes: 25 additions & 0 deletions modules/backend/assets/less/controls/global-notice.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.global-notice {
position: sticky;
top: 0;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.5em;
justify-content: space-between;
z-index: 10500;
background: #ab2a1c;
color: #FFF;
padding: 0.5em 0.75em;

.notice-icon {
font-size: 1.5em;
vertical-align: bottom;
display: inline-block;
margin-right: .25em;
}

.notice-text {
display: inline-block;
vertical-align:middle;
}
}
1 change: 1 addition & 0 deletions modules/backend/assets/less/winter.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@import "core/boot.less";
@import "controls/alert.less";
@import "controls/global-notice.less";
@import "controls/simplelist.less";
@import "controls/scrollbar.less";
@import "controls/filelist.less";
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/assets/ui/js/build/vendor.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions modules/backend/behaviors/RelationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,12 @@ public function onRelationButtonLink()
return $this->onRelationManageForm();
}

public function onRelationButtonRefresh()
{
$this->beforeAjax();
return $this->relationRefresh();
}

public function onRelationButtonUnlink()
{
return $this->onRelationManageRemove();
Expand Down Expand Up @@ -1588,6 +1594,10 @@ protected function evalToolbarButtons()
$text = 'backend::lang.relation.add_name';
break;

case 'refresh':
$text = 'backend::lang.relation.refresh';
break;

case 'remove':
$text = 'backend::lang.relation.remove';
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<button
class="btn btn-sm btn-secondary wn-icon-arrows-rotate"
data-request="onRelationButtonRefresh"
data-stripe-load-indicator>
<?= e(trans($text)) ?>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,7 @@
</div>

<div class="modal-footer">
<?php if ($this->readOnly): ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.close')) ?>
</button>
<?php else: ?>
<button
type="submit"
class="btn btn-primary">
<?= e(trans('backend::lang.relation.update')) ?>
</button>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
<?php endif ?>
<?= $this->relationMakePartial('manage_form_footer_update') ?>
</div>

<?= Form::close() ?>
Expand Down Expand Up @@ -74,17 +55,7 @@ class="btn btn-default"

</div>
<div class="modal-footer">
<button
type="submit"
class="btn btn-primary">
<?= e(trans('backend::lang.relation.create')) ?>
</button>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
<?= $this->relationMakePartial('manage_form_footer_create') ?>
</div>
<?= Form::close() ?>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<button
type="submit"
class="btn btn-primary">
<?= e(trans('backend::lang.relation.create')) ?>
</button>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php if ($this->readOnly): ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.close')) ?>
</button>
<?php else: ?>
<button
type="submit"
class="btn btn-primary">
<?= e(trans('backend::lang.relation.update')) ?>
</button>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
<?php endif ?>
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,7 @@
</div>

<div class="modal-footer">
<?php if ($relationManageWidget->showCheckboxes): ?>
<button
type="button"
class="btn btn-primary"
data-request="onRelationManageAdd"
data-dismiss="popup"
data-request-success="$.wn.relationBehavior.changed('<?= e($relationField) ?>', 'added')"
data-stripe-load-indicator>
<?= e(trans('backend::lang.relation.add_selected')) ?>
</button>
<?php endif ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
<?= $this->relationMakePartial('manage_list_footer') ?>
</div>
<?= Form::close() ?>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php if ($relationManageWidget->showCheckboxes): ?>
<button
type="button"
class="btn btn-primary"
data-request="onRelationManageAdd"
data-dismiss="popup"
data-request-success="$.wn.relationBehavior.changed('<?= e($relationField) ?>', 'added')"
data-stripe-load-indicator>
<?= e(trans('backend::lang.relation.add_selected')) ?>
</button>
<?php endif ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,7 @@
</div>

<div class="modal-footer">
<?php if ($relationManageWidget->showCheckboxes): ?>
<button
type="button"
class="btn btn-primary"
data-control="popup"
data-handler="onRelationManageAddPivot"
data-size="huge"
data-dismiss="popup"
data-stripe-load-indicator>
<?= e(trans('backend::lang.relation.add_selected')) ?>
</button>
<?php endif ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
<?= $this->relationMakePartial('manage_pivot_footer') ?>
</div>
<?= Form::close() ?>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php if ($relationManageWidget->showCheckboxes): ?>
<button
type="button"
class="btn btn-primary"
data-control="popup"
data-handler="onRelationManageAddPivot"
data-size="huge"
data-dismiss="popup"
data-stripe-load-indicator>
<?= e(trans('backend::lang.relation.add_selected')) ?>
</button>
<?php endif ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,7 @@
<?= $relationPivotWidget->render(['preview' => $this->readOnly]) ?>
</div>
<div class="modal-footer">
<?php if ($this->readOnly): ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.close')) ?>
</button>
<?php else: ?>
<button
type="submit"
class="btn btn-primary">
<?= e(trans('backend::lang.relation.update')) ?>
</button>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
<?php endif ?>
<?= $this->relationMakePartial('pivot_form_footer') ?>
</div>

<?= Form::close() ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php if ($this->readOnly): ?>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.close')) ?>
</button>
<?php else: ?>
<button
type="submit"
class="btn btn-primary">
<?= e(trans('backend::lang.relation.update')) ?>
</button>
<button
type="button"
class="btn btn-default"
data-dismiss="popup">
<?= e(trans('backend::lang.relation.cancel')) ?>
</button>
<?php endif ?>
13 changes: 7 additions & 6 deletions modules/backend/classes/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,25 +700,26 @@ protected function getFieldNameFromData($fieldName, $data, $default = null)
if ($result instanceof Model && $result->hasRelation($key)) {
if ($key == $lastField) {
$result = $result->getRelationValue($key) ?: $default;
}
else {
} else {
$result = $result->{$key};
}
}
elseif (is_array($result)) {
} elseif (is_array($result)) {
if (!array_key_exists($key, $result)) {
return $default;
}
$result = $result[$key];
}
else {
} else {
if (!isset($result->{$key})) {
return $default;
}
$result = $result->{$key};
}
}

if ($result instanceof BackedEnum) {
$result = $result->value;
}

return $result;
}
}
5 changes: 3 additions & 2 deletions modules/backend/database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function run()
$this->call($adminSeeder);
});

return $shouldRandomizePassword ? 'The following password has been automatically generated for the "admin" account: '
. "<fg=yellow;options=bold>${adminPassword}</>" : '';
return ($shouldRandomizePassword)
? 'The following password has been automatically generated for the "admin" account: <fg=yellow;options=bold>' . $adminPassword . '</>'
: '';
}
}
Loading

0 comments on commit adde4be

Please sign in to comment.