Skip to content

Commit

Permalink
Merge branch 'develop' into relationmanager-formwidget
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers authored Oct 17, 2023
2 parents 2662b32 + 8f7c656 commit 50d5c99
Show file tree
Hide file tree
Showing 142 changed files with 2,104 additions and 1,138 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[.github/workflows/**.{yml,yaml}]
indent_size = 2
43 changes: 43 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
APP_NAME="Winter CMS"
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_LOCALE=en

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database
DB_USERNAME=root
DB_PASSWORD=

CACHE_DRIVER=file

SESSION_DRIVER=file

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

QUEUE_CONNECTION=sync

MAIL_MAILER=log
MAIL_LOG_CHANNEL=null
MAIL_HOST=null
MAIL_PORT=null
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="${APP_NAME}"

ROUTES_CACHE=false
ASSET_CACHE=false
LINK_POLICY=detect
ENABLE_CSRF=true
DATABASE_TEMPLATES=false

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
11 changes: 10 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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: [email protected]
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
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
11 changes: 8 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,12 +23,17 @@
"**/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",
"**/themes/*/partials/**/*.htm": "wintercms"
},
"emmet.includeLanguages": {
"wintercms": "html",
"wintercms-twig": "html",
"wintercms-block": "html"
},
"eslint.validate": [
"javascript",
"vue"
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
2 changes: 2 additions & 0 deletions bootstrap/cache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"dms/phpunit-arraysubset-asserts": "^0.1.0|^0.2.1"
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
Expand Down
9 changes: 9 additions & 0 deletions modules/backend/.eslintrc.json
Original file line number Diff line number Diff line change
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
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
2 changes: 1 addition & 1 deletion modules/backend/behaviors/UserPreferencesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function instance()
/**
* Checks if the model has been set up previously, intended as a static method
*/
public function isConfigured()
public function isConfigured(): bool
{
return $this->getSettingsRecord() !== null;
}
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
Loading

0 comments on commit 50d5c99

Please sign in to comment.