Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Redo the com_templates #32896

Closed
Closed
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
224f765
One view to rule them all
dgrammatiko Jul 29, 2021
414789f
cs
dgrammatiko Jul 29, 2021
1ff4b0a
alpha sort
dgrammatiko Mar 28, 2021
c159cc0
meh
dgrammatiko Mar 28, 2021
415fb8f
oops
dgrammatiko Mar 28, 2021
1ed2a88
Add install template logic
dgrammatiko Mar 28, 2021
7c761d2
remove the extra link
dgrammatiko Mar 28, 2021
baaa48c
comments
dgrammatiko Mar 28, 2021
4d7a420
CS
dgrammatiko Mar 28, 2021
9c85899
wow
dgrammatiko Mar 28, 2021
7c0d794
Update administrator/components/com_templates/tmpl/styles/default.php
dgrammatiko Mar 31, 2021
ad44fd2
Update administrator/components/com_templates/tmpl/styles/default.php
dgrammatiko Mar 31, 2021
77db502
Update administrator/components/com_templates/tmpl/styles/default.php
dgrammatiko Mar 31, 2021
5844981
Update administrator/components/com_templates/tmpl/styles/default.php
dgrammatiko Mar 31, 2021
de389fe
Update administrator/components/com_templates/tmpl/styles/default.php
dgrammatiko Mar 31, 2021
0575528
Update administrator/components/com_templates/tmpl/styles/default.php
dgrammatiko Mar 31, 2021
fb54cf0
Update QuickIconHelper.php
brianteeman Apr 1, 2021
6424ffe
preview per style
dgrammatiko Mar 31, 2021
054dbee
layouts
dgrammatiko Mar 31, 2021
f96a563
more
dgrammatiko Mar 31, 2021
06a4e97
more
dgrammatiko Apr 1, 2021
4c2827c
more
dgrammatiko Apr 1, 2021
e4f608f
more
dgrammatiko Aug 27, 2021
71bd46d
oops
dgrammatiko Apr 2, 2021
4fb68f3
CS
dgrammatiko Apr 2, 2021
ebf8b49
CS
dgrammatiko Apr 2, 2021
7706369
Wire some actions
dgrammatiko Apr 2, 2021
84bde4a
use the existing code (no ajax)
dgrammatiko Jul 29, 2021
0f194a5
more links
dgrammatiko Apr 3, 2021
d3ab3ab
x
dgrammatiko Apr 7, 2021
cfc6b78
x
dgrammatiko Apr 8, 2021
4fc8079
fixes
dgrammatiko Apr 20, 2021
a3c8567
Fix the thumbnails, save inheritable, parent in the db manifest data
dgrammatiko May 6, 2021
055d7f0
overrides creator init
dgrammatiko Sep 4, 2021
63400c8
update
dgrammatiko Jul 29, 2021
cb40a8e
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
d3e36c5
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
dd05ad1
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
1fe07f2
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
f972a3a
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
de5e65b
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
1b818e2
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
967121d
Update administrator/components/com_templates/src/Controller/Template…
dgrammatiko Aug 20, 2021
0ec1b3c
tb
dgrammatiko Aug 21, 2021
f493e7b
zzz
dgrammatiko Aug 27, 2021
34e9e58
Overrides creator as a custom element
dgrammatiko Sep 4, 2021
501bcf5
CS
dgrammatiko Sep 4, 2021
748b462
JS CS
dgrammatiko Sep 4, 2021
a525cfb
Strings clean up
dgrammatiko Sep 4, 2021
68e7c21
Info modal + overrides fixes
dgrammatiko Sep 4, 2021
87f7d64
JS CS
dgrammatiko Sep 4, 2021
06be3d9
- code cleanup
dgrammatiko Sep 5, 2021
96f3b86
- Fixes
dgrammatiko Sep 5, 2021
723eb5e
JS CS
dgrammatiko Sep 5, 2021
5553d25
Some clean up
dgrammatiko Sep 6, 2021
9b90085
More intuitive template name/action
dgrammatiko Sep 6, 2021
effdc84
JS Cleanup
dgrammatiko Sep 6, 2021
bb20f5f
Meh, do not disable ESLint when we can fix the CS
dgrammatiko Sep 6, 2021
b190981
c
dgrammatiko Sep 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Wire some actions
  • Loading branch information
dgrammatiko committed Sep 4, 2021
commit 770636945c6ad9d539417b5edcc11495602f2351
14 changes: 7 additions & 7 deletions administrator/components/com_templates/layouts/card-footer.php
Original file line number Diff line number Diff line change
@@ -29,12 +29,12 @@
<div>
<?php if ($style->home == '0') : ?>
<button class="js-action-exec btn btn-link" type="button" data-task="templates.setDefault" data-item="<?php echo (int) $style->id; ?>">
<span class="icon-star me-2" area-hidden="true"></span>
<span class="icon-star me-2" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('COM_TEMPLATES_STYLE_IS_DEFAULT'); ?></span>
</button>
<?php elseif ($style->home == '1'):?>
<strong class="text-success btn btn-transparent">
<span class="icon-star icon-md me-2" area-hidden="true"></span>
<span class="icon-star icon-md me-2" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('COM_TEMPLATES_STYLE_IS_DEFAULT'); ?></span>
</strong>
<?php elseif ($canChange):?>
@@ -52,7 +52,7 @@
</small>
<?php elseif ((int) $style->assigned > 0) : // $style->assigned > 0?>
<small class="ms-2">
<span class="icon-check-circle" area-hidden="true"></span>
<span class="icon-check-circle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::sprintf('COM_TEMPLATES_STYLES_PAGES_SELECTED', $style->assigned); ?></span>
</small>
<?php endif; ?>
@@ -76,18 +76,18 @@
</li>
<?php if($canCreate) : ?>
<li>
<a href="<?php echo Route::_('index.php?option=com_templates&layout=edit&task=style.duplicate&id=' . (int) $style->id . '&' . Session::getFormToken() . '=1'); ?>" class="btn btn-link">
<button class="js-action-exec btn btn-link" type="button" data-task="templates.duplicate" data-item="<?php echo (int) $style->id; ?>">
<span class="icon-copy" aria-hidden="true"></span>
<span class="ms-1"><?php echo Text::_('COM_TEMPLATES_STYLE_DUPLICATE'); ?></span>
</a>
</button>
</li>
<?php endif; ?>
<?php if($canDelete) : ?>
<li>
<a href="<?php echo Route::_('index.php?option=com_templates&layout=edit&task=style.delete&id=' . (int) $style->id . '&' . Session::getFormToken() . '=1'); ?>" class="btn btn-link">
<button class="js-action-exec btn btn-link" type="button" data-task="templates.delete" data-item="<?php echo (int) $style->id; ?>">
<span class="icon-trash" aria-hidden="true"></span>
<span class="ms-1"><?php echo Text::_('COM_TEMPLATES_STYLE_DELETE'); ?></span>
</a>
</button>
</li>
<?php endif; ?>
<li>
23 changes: 13 additions & 10 deletions build/media_source/com_templates/js/admin-templates-default.es6.js
Original file line number Diff line number Diff line change
@@ -7,26 +7,29 @@ const onClick = async (event) => {
let response;
const button = event.currentTarget;
const { form } = button;

const baseURL = `${form.action}&task=${button.dataset.task}&${form.dataset.token}=1&cid[]=${button.dataset.item}`;
// const data = {
// templateIds: button.dataset.item;
// templateIds: button.dataset.item,
// [form.dataset.token]: 1,
// 'cid[]': button.dataset.item,
// };

button.setAttribute('disabled', '');

try {
response = await fetch(baseURL, {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
method: 'POST',
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
// 'Content-Type': 'application/x-www-form-urlencoded',
// 'Content-Type': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
},
redirect: 'follow', // manual, *follow, error
referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
// body: JSON.stringify(data) // body data type must match "Content-Type" header
redirect: 'follow',
referrerPolicy: 'no-referrer',
// body: JSON.stringify(data),
});
} catch (error) {
// @todo use alert here