Skip to content

Commit

Permalink
Merge pull request #1027 from wintercms/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Dec 28, 2023
2 parents 90b0df8 + 5bc9257 commit d007caf
Show file tree
Hide file tree
Showing 151 changed files with 2,552 additions and 732 deletions.
11 changes: 10 additions & 1 deletion .gitattributes
@@ -1 +1,10 @@
* text=auto
* text=auto

*.md diff=markdown
*.php diff=php

/.github export-ignore
/.gitpod export-ignore
.gitattributes export-ignore
.gitpod.yml export-ignore
CHANGELOG.md export-ignore
100 changes: 100 additions & 0 deletions .github/workflows/manifest.yml
@@ -0,0 +1,100 @@
name: Manifest

on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
updateManifest:
name: Update manifest
runs-on: ubuntu-latest
env:
phpVersion: '8.1'
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
key: winter-cms-cache-develop
steps:
- name: Cancel previous incomplete runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}

- name: Checkout changes
uses: actions/checkout@v3

- name: Setup extension cache
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ env.phpVersion }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.phpVersion }}
extensions: ${{ env.extensions }}

- name: Setup dependency cache
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-scripts

- name: Download manifest
run: wget -O builds.json https://github.com/wintercms/meta/raw/master/manifest/builds.json

- name: Run manifest
run: php artisan winter:manifest builds.json

- name: Create artifact
uses: actions/upload-artifact@v3
with:
name: winter-manifest
path: builds.json
commitManifest:
name: Commit manifest
runs-on: ubuntu-latest
needs: updateManifest
steps:
- name: Cancel previous incomplete runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}

- name: Checkout changes
uses: actions/checkout@v3
with:
repository: wintercms/meta
ref: master
token: ${{ secrets.WINTER_BOT_TOKEN }}

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: winter-manifest
path: manifest

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update manifest
commit_user_name: Winter Bot
commit_user_email: 80384029+WinterCMSBot@users.noreply.github.com
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Expand Up @@ -133,9 +133,6 @@ jobs:
php-version: ${{ matrix.phpVersion }}
extensions: ${{ env.extensions }}

- name: Echo branches
run: echo "${{ github.ref }} | ${{ github.head_ref }} | ${{ github.ref_name }} | ${{ github.base_ref }}"

- name: Switch library dependency (develop)
if: github.ref == 'refs/heads/develop' || github.base_ref == 'develop'
run: php ./.github/workflows/utilities/library-switcher "dev-develop as 1.2"
Expand Down
7 changes: 4 additions & 3 deletions .vscode/settings.json
@@ -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
12 changes: 9 additions & 3 deletions README.md
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:hello@frostbytefoundation.org) provides an organisational backing for the project and the continued development of Winter, its plugins and themes and its ecosystem.

<table>
<tr>
Expand Down Expand Up @@ -89,13 +90,18 @@ Winter CMS development is financially supported by the generosity of the followi

### Organizations

Spatial Media employs one of the core maintainers (Jack Wilkinson) who contributes to the ongoing development of Winter.

[![Froala logo](https://froala.com/wp-content/uploads/2019/10/froala.svg)](https://froala.com/wysiwyg-editor/)

Froala provides a perpetual, Enterprise license to Winter CMS which allows us and our users to use the Froala WYSIWYG Editor in Winter CMS powered projects.

Big thanks to our sponsors on OpenCollective:

- [FrogeHost](https://froge.host/?utm_source=wintercms)

### Individuals

Big thanks to our sponsors on OpenCollective:

- Orville

If you would like to have your name, company and link added to this list and support open-source development, feel free to make a donation to our [Open Collective](https://opencollective.com/wintercms).
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/cache/.gitignore
@@ -0,0 +1,2 @@
*
!.gitignore
16 changes: 16 additions & 0 deletions config/queue.php
Expand Up @@ -67,6 +67,22 @@
],
],

/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/

'batching' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'job_batches',
],

/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
Expand Down
9 changes: 9 additions & 0 deletions modules/backend/.eslintrc.json
Expand Up @@ -10,6 +10,15 @@
"airbnb-base",
"plugin:vue/vue3-recommended"
],
"ignorePatterns": [
"assets/js",
"assets/vendor",
"behaviors/**/*.js",
"controllers/**/*.js",
"formwidgets/**/*.js",
"reportwidgets/**/*.js",
"widgets/**/*.js"
],
"rules": {
"class-methods-use-this": ["off"],
"indent": ["error", 4, {
Expand Down
33 changes: 17 additions & 16 deletions modules/backend/ServiceProvider.php
Expand Up @@ -213,22 +213,23 @@ protected function registerBackendPermissions()
protected function registerBackendWidgets()
{
WidgetManager::instance()->registerFormWidgets(function ($manager) {
$manager->registerFormWidget('Backend\FormWidgets\CodeEditor', 'codeeditor');
$manager->registerFormWidget('Backend\FormWidgets\RichEditor', 'richeditor');
$manager->registerFormWidget('Backend\FormWidgets\MarkdownEditor', 'markdown');
$manager->registerFormWidget('Backend\FormWidgets\FileUpload', 'fileupload');
$manager->registerFormWidget('Backend\FormWidgets\Relation', 'relation');
$manager->registerFormWidget('Backend\FormWidgets\DatePicker', 'datepicker');
$manager->registerFormWidget('Backend\FormWidgets\TimePicker', 'timepicker');
$manager->registerFormWidget('Backend\FormWidgets\ColorPicker', 'colorpicker');
$manager->registerFormWidget('Backend\FormWidgets\DataTable', 'datatable');
$manager->registerFormWidget('Backend\FormWidgets\RecordFinder', 'recordfinder');
$manager->registerFormWidget('Backend\FormWidgets\Repeater', 'repeater');
$manager->registerFormWidget('Backend\FormWidgets\TagList', 'taglist');
$manager->registerFormWidget('Backend\FormWidgets\MediaFinder', 'mediafinder');
$manager->registerFormWidget('Backend\FormWidgets\NestedForm', 'nestedform');
$manager->registerFormWidget('Backend\FormWidgets\Sensitive', 'sensitive');
$manager->registerFormWidget('Backend\FormWidgets\IconPicker', 'iconpicker');
$manager->registerFormWidget(\Backend\FormWidgets\CodeEditor::class, 'codeeditor');
$manager->registerFormWidget(\Backend\FormWidgets\ColorPicker::class, 'colorpicker');
$manager->registerFormWidget(\Backend\FormWidgets\DataTable::class, 'datatable');
$manager->registerFormWidget(\Backend\FormWidgets\DatePicker::class, 'datepicker');
$manager->registerFormWidget(\Backend\FormWidgets\FileUpload::class, 'fileupload');
$manager->registerFormWidget(\Backend\FormWidgets\IconPicker::class, 'iconpicker');
$manager->registerFormWidget(\Backend\FormWidgets\MarkdownEditor::class, 'markdown');
$manager->registerFormWidget(\Backend\FormWidgets\MediaFinder::class, 'mediafinder');
$manager->registerFormWidget(\Backend\FormWidgets\NestedForm::class, 'nestedform');
$manager->registerFormWidget(\Backend\FormWidgets\RecordFinder::class, 'recordfinder');
$manager->registerFormWidget(\Backend\FormWidgets\Relation::class, 'relation');
$manager->registerFormWidget(\Backend\FormWidgets\RelationManager::class, 'relationmanager');
$manager->registerFormWidget(\Backend\FormWidgets\Repeater::class, 'repeater');
$manager->registerFormWidget(\Backend\FormWidgets\RichEditor::class, 'richeditor');
$manager->registerFormWidget(\Backend\FormWidgets\Sensitive::class, 'sensitive');
$manager->registerFormWidget(\Backend\FormWidgets\TagList::class, 'taglist');
$manager->registerFormWidget(\Backend\FormWidgets\TimePicker::class, 'timepicker');
});
}

Expand Down
3 changes: 3 additions & 0 deletions modules/backend/assets/css/winter.css
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
@@ -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
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.

13 changes: 13 additions & 0 deletions modules/backend/behaviors/ListController.php
Expand Up @@ -164,6 +164,10 @@ public function makeList($definition = null)
*/
$widget = $this->makeWidget(\Backend\Widgets\Lists::class, $columnConfig);

$widget->bindEvent('list.extendColumnsBefore', function () use ($widget) {
$this->controller->listExtendColumnsBefore($widget);
});

$widget->bindEvent('list.extendColumns', function () use ($widget) {
$this->controller->listExtendColumns($widget);
});
Expand Down Expand Up @@ -468,6 +472,15 @@ public function listGetConfig(string $definition = null)
// Overrides
//

/**
* Called before the list columns are defined.
* @param \Backend\Widgets\Lists $host The hosting list widget
* @return void
*/
public function listExtendColumnsBefore($host)
{
}

/**
* Called after the list columns are defined.
* @param \Backend\Widgets\Lists $host The hosting list widget
Expand Down
13 changes: 12 additions & 1 deletion modules/backend/behaviors/RelationController.php
Expand Up @@ -665,6 +665,7 @@ protected function makeViewWidget()
$config = $this->makeConfigForMode('view', 'list');
$config->model = $this->relationModel;
$config->alias = $this->alias . 'ViewList';
$config->showSetup = $this->getConfig('view[showSetup]', true);
$config->showSorting = $this->getConfig('view[showSorting]', true);
$config->defaultSort = $this->getConfig('view[defaultSort]');
$config->recordsPerPage = $this->getConfig('view[recordsPerPage]');
Expand Down Expand Up @@ -814,7 +815,7 @@ protected function makeManageWidget()
$config = $this->makeConfigForMode('manage', 'list');
$config->model = $this->relationModel;
$config->alias = $this->alias . 'ManageList';
$config->showSetup = false;
$config->showSetup = $this->getConfig('manage[showSetup]', !$isPivot);
$config->showCheckboxes = $this->getConfig('manage[showCheckboxes]', !$isPivot);
$config->showSorting = $this->getConfig('manage[showSorting]', !$isPivot);
$config->defaultSort = $this->getConfig('manage[defaultSort]');
Expand Down Expand Up @@ -1025,6 +1026,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 +1595,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

0 comments on commit d007caf

Please sign in to comment.