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

style, js, contenttype, import scripts, email templates #525

Merged
merged 73 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
418522c
Squashed commit of the following from BL/contenttypes:
bduncan137 Oct 4, 2021
a0a69d8
castle types updated and upgrades to match
bduncan137 Oct 4, 2021
d4a585c
handle max function in css instead of less
bduncan137 Oct 5, 2021
7572be8
add resuming (quick skipping already imported paths) to import script
zombified May 18, 2022
4e6fc08
fix folder_contents paging bugs
bduncan137 May 23, 2022
cb090e1
allow floats or stringified floats in lat and lng
bduncan137 May 23, 2022
b3a3286
update HISTORY
bduncan137 May 23, 2022
d912be7
fix some resume bugs, add delete-resumeable-file flag
bduncan137 May 23, 2022
378d618
fix too-modern js
bduncan137 May 23, 2022
a649efe
style toggle-advanced like other buttons
bduncan137 May 23, 2022
ab83659
compile resources
bduncan137 May 23, 2022
d4c78b2
upgrade step
bduncan137 May 23, 2022
20033d9
update HISTORY
bduncan137 May 23, 2022
b833a0d
fix max function in less compiler
bduncan137 May 23, 2022
576698c
compile resources
bduncan137 May 23, 2022
2e25068
typo
bduncan137 May 25, 2022
aadb4b5
compilation that seems to have worked
bduncan137 May 25, 2022
add4c6e
Squashed commit of the following from BL/contenttypes:
bduncan137 Oct 4, 2021
af99e6d
castle types updated and upgrades to match
bduncan137 Oct 4, 2021
1768ae2
Merge branch 'Castle/bd/test-icons' of github.com:castlecms/castle.cm…
bduncan137 May 27, 2022
9664cbc
update .gitignore
bduncan137 May 27, 2022
224cc26
remove unneeded init-dev and templates folder
bduncan137 May 27, 2022
50eaa15
update max statement to compile with newer less/css
bduncan137 May 27, 2022
57625f7
permanently add makefile and package.json
bduncan137 May 27, 2022
ba9d8a9
update package-lock, compiled resources
bduncan137 May 27, 2022
447b72d
update docs and HISTORY
bduncan137 May 27, 2022
de5e56a
Merge remote-tracking branch 'origin/Castle/bd/test-icons' into jk/re…
bduncan137 May 27, 2022
7e7cc19
fix typo
bduncan137 May 27, 2022
60ab725
move from 3004 (old pr) to 3005
bduncan137 May 27, 2022
a914807
append upgrade description
bduncan137 May 27, 2022
7593759
add parallax icons
bduncan137 May 27, 2022
784d825
compile resources, note on svg
bduncan137 May 27, 2022
c958958
try aligning with flex
bduncan137 Jun 6, 2022
0c8327e
adjust dexterity type descriptions
bduncan137 Jun 6, 2022
79e9e33
icons change and profile/ compile stuff commit
bduncan137 Nov 2, 2023
658b2c5
Merge branch 'Castle/bd/test-icons-again' into jk/resumeimport
bduncan137 Nov 3, 2023
215a540
Merge branch 'master' into jk/resumeimport
bduncan137 Nov 3, 2023
b369211
update/ add svg files
bduncan137 Nov 8, 2023
963219e
fix tinymce vertical spacing issue
bduncan137 Nov 8, 2023
32d5423
fix typo
bduncan137 Nov 8, 2023
90ed81d
add a version for collective.easyform
bduncan137 Nov 8, 2023
d699c88
swap profile number
bduncan137 Nov 8, 2023
ba99194
update compilation date
bduncan137 Nov 8, 2023
1f722ce
remove unused inline style
bduncan137 Nov 8, 2023
c5ff29f
give recycle bin its own icon
bduncan137 Nov 8, 2023
c754649
update package-lock
bduncan137 Nov 8, 2023
0102c47
add back in compile resource/grunt weirdness
bduncan137 Nov 8, 2023
5278b80
update compiled files
bduncan137 Nov 8, 2023
fedb648
update gitignore
bduncan137 Nov 8, 2023
2fa416f
restore init-dev.py
bduncan137 Nov 8, 2023
4bb7bd1
restore templates makefile
bduncan137 Nov 8, 2023
adef35f
remove incorrect contents for upgrade 3005
bduncan137 Nov 8, 2023
deb9ef6
update descriptions and titles
bduncan137 Nov 9, 2023
94552f1
update CHANGES
bduncan137 Nov 9, 2023
f4646a1
restore deleted audio.xml contents
bduncan137 Nov 9, 2023
4602514
remove easyform after testing icons
bduncan137 Nov 9, 2023
a6330f9
fix error messages for unneeded tiles in dexterity control panel
bduncan137 Nov 9, 2023
bd4e2ff
add rolemap to upgrade step
bduncan137 Nov 9, 2023
8bc2447
add EmailTemplate to upgrade step
bduncan137 Nov 9, 2023
b6ef93f
update CHANGES
bduncan137 Nov 9, 2023
aa6fd37
j3cbot templates to add/ move button
bduncan137 Nov 13, 2023
3dcac71
override documentviewer template
bduncan137 Nov 13, 2023
2639462
add dexterity types back button
bduncan137 Nov 13, 2023
bee2e62
add missing back button
bduncan137 Nov 13, 2023
5b45969
update/ simplify back buttons
bduncan137 Nov 13, 2023
43de4cd
update CHANGES
bduncan137 Nov 13, 2023
abd7a0d
Merge pull request #574 from castlecms/bd/master-fix-back-to-site-setup
bduncan137 Nov 13, 2023
fb971a7
further arrange svg icons
bduncan137 Nov 15, 2023
0372556
recompile resources
bduncan137 Nov 15, 2023
fc721a5
some more icon tweaks
bduncan137 Nov 15, 2023
b1c62e8
try to fix initial run of plone-compile-resources
bduncan137 Nov 16, 2023
6ac5ed2
update README
bduncan137 Nov 16, 2023
1113fe2
tweaks
bduncan137 Nov 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ castle/cms/locales/en/LC_MESSAGES/plone.mo
pip-selfcheck.json
*.pyc
.vscode/
Gruntfile.js
log.html
node_modules/
report.html
Expand All @@ -37,7 +36,5 @@ env
env2
dump.rdb
export/
/Makefile
/package.json
/watch-run.py
/watchable-grunt.js
npm-debug.log
/Gruntfile.js
9 changes: 7 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ Changelog
3.0.0b127 (unreleased)
----------------------

- Nothing changed yet.

- Update control panel icons, providing one for every castle configlet
- Update dexterity types so every one has an icon and a short desription
- Add EmailTemplate dexterity type for repeated emails
- Fix data-tiles that don't exist from rendering and spamming output
(for dexterity type definitions in control panel in /@@dexterity-types/<DexterityTypeHere>)
- Allow resuming importjson script
- fix missing/ inconsistently localed back to site setup button in controlpanels

3.0.0b126 (2023-08-01)
----------------------
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: less-plone less-plone-logged-in compile-plone compile-plone-logged-in verify-gruntfile-exists
ERROR_MESSAGE = You must run ./bin/plone-compile-resources --site-id <YOUR_SITE_ID> before these targets will work

verify-gruntfile-exists:
test -f Gruntfile.js || ( echo "\n\n$(ERROR_MESSAGE)\n\n"; exit 1 )

less-plone:
make verify-gruntfile-exists && grunt less:plone

less-plone-logged-in:
make verify-gruntfile-exists && grunt less:plone-logged-in

compile-plone:
make verify-gruntfile-exists && grunt compile-plone

compile-plone-logged-in:
make verify-gruntfile-exists && grunt compile-plone-logged-in
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ Development setup on macOS
7. ``bin/buildout``
8. Run (in separate terminal windows) ``elasticsearch``, ``redis-server``, ``bin/instance fg``
9. Browse to http://localhost:8080/
10. Once you have created a site in the development instance, run init-dev script to populate templates, ``bin/instance run castle/cms/_scripts/init-dev.py``

Once you have created a site in the development instance:

10. Run compile-resources script to allow `Makefile targets <./Makefile>`_ to work, ``bin/plone-compile-resources --site-id <Castle, or whatever you named your site>``
11. Run init-dev script to populate templates, ``bin/instance run castle/cms/_scripts/init-dev.py``
12. See the /docs/ folder for further development information


Optional Dependencies
Expand Down
48 changes: 41 additions & 7 deletions castle/cms/_scripts/importjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
'--stop-if-exception', dest='stop_if_exception', default=False)
parser.add_argument(
'--pdb-if-exception', dest='pdb_if_exception', default=False)
parser.add_argument('--resumable', dest='resumable', default=False, action='store_true')
parser.add_argument(
'--delete-resumable-file', dest='delete_resumable_file', default=False, action='store_true')
parser.add_argument('--skip-existing', dest='skip_existing', default=True)
parser.add_argument(
'--skip-transitioning', dest='skip_transitioning', default=False)
Expand Down Expand Up @@ -73,6 +76,10 @@
stop_if_exception = args.stop_if_exception
pdb_if_exception = args.pdb_if_exception
retain_paths = args.retain_paths
resumable = args.resumable
delete_resumable_file = args.delete_resumable_file
successfully_imported_paths = []
imported_but_not_committed = []

if args.import_paths:
import_paths = args.import_paths.split(',')
Expand Down Expand Up @@ -174,15 +181,23 @@ class CastleImporter(object):
('expiration_date', 'setExpirationDate'),
]

@property
def successfully_imported_paths(self):
return [
args.export_directory + successfully_imported_path
for successfully_imported_path in successfully_imported_paths
]

def do_import(self):
self.import_folder(args.export_directory, container=site)

def import_object(self, filepath, container=None):
fi = open(filepath)
file_read = fi.read()
fi.close()
if resumable and filepath in self.successfully_imported_paths:
print("Skipping {}; Already successfully imported and resuming is enabled".format(filepath))
return
try:
data = mjson.loads(file_read)
with open(filepath, 'r') as import_file:
data = mjson.loads(import_file.read())
except Exception:
print("Skipping {}; Unable to read JSON data".format(filepath))
return
Expand Down Expand Up @@ -275,19 +290,24 @@ def import_object(self, filepath, container=None):
try:
obj = api.content.create(safe_id=True, **creation_data)
print('Created {path}'.format(path=path))
imported_but_not_committed.append(path)
self.imported_count += 1
if self.imported_count % 50 == 0:
print('%i processed, committing' % self.imported_count)
transaction.commit()
successfully_imported_paths.extend(imported_but_not_committed)
with open('./.successfullyimportedpaths', 'a') as fout:
fout.writelines('\n'.join(imported_but_not_committed) + '\n')
fout.flush()
del imported_but_not_committed[0:]
except api.exc.InvalidParameterError:
if stop_if_exception:
logger.error('Error creating content {}'.format(filepath), exc_info=True)
if pdb_if_exception:
import pdb
pdb.set_trace()
raise
logger.error('Error creating content {}'
.format(filepath), exc_info=True)
logger.error('Error creating content {}'.format(filepath), exc_info=True)
return
# TODO check default folder pages came over as folder with rich text tile
# TODO any folder pages without default page should have content listing tile
Expand Down Expand Up @@ -417,10 +437,20 @@ def create_plain_folder(self, id, container):


if __name__ == '__main__':

print('------------------------------')
print('Start importing')
print('------------------------------')
if resumable:
print('------------------------------')
print('Resuming enabled, checking for ./.successfullyimportedpaths and loading')
# create if it doesn't exist:
with open('.successfullyimportedpaths', 'a+'):
pass
with open('.successfullyimportedpaths', 'r') as fin:
for line in fin.readlines():
successfully_imported_paths.append(line.replace('\n', ''))
print('{} paths loaded'.format(len(successfully_imported_paths)))
print('------------------------------')
if args.overwrite:
print('------------------------------')
print('Importing with overwrite enabled')
Expand All @@ -429,3 +459,7 @@ def create_plain_folder(self, id, container):
importer.do_import()
print('Created {count} Content Items'.format(count=importer.imported_count))
transaction.commit()
print('Import completed')
if delete_resumable_file:
print('Deleting .successfullyimportedpaths')
os.remove('.successfullyimportedpaths')
23 changes: 0 additions & 23 deletions castle/cms/_scripts/templates/Makefile

This file was deleted.

51 changes: 0 additions & 51 deletions castle/cms/_scripts/templates/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion castle/cms/browser/content/fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def get_options(self):
return {
'title': 'Recycle bin',
'id': 'recycle',
'icon': 'trash',
'icon': 'recycle',
'context': 'default',
'url': self.context.absolute_url() + '/@@fc-trash',
'form': {
Expand Down
12 changes: 12 additions & 0 deletions castle/cms/browser/controlpanel/documentviewer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from collective.documentviewer.browser.controlpanel import GlobalSettingsForm
from plone.app.z3cform.layout import wrap_form
from zope.browserpage.viewpagetemplatefile import ViewPageTemplateFile


class CastleDocumentViewerSettingsForm(GlobalSettingsForm):
template = ViewPageTemplateFile('templates/documentviewer.pt')
label = None
description=None


GlobalSettingsFormView = wrap_form(CastleDocumentViewerSettingsForm)
4 changes: 1 addition & 3 deletions castle/cms/browser/controlpanel/templates/announcements.pt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
<metal:main metal:fill-slot="prefs_configlet_main">

<a
href=""
href="${context/portal_url}/@@overview-controlpanel"
id="setup-link"
tal:attributes="href string:$portal_url/plone_control_panel"
i18n:translate=""
>
Site Setup
</a>
Expand Down
11 changes: 6 additions & 5 deletions castle/cms/browser/controlpanel/templates/archives-manage.pt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

<metal:main metal:fill-slot="prefs_configlet_main" i18n:domain="plone">

<a href=""
id="setup-link"
tal:attributes="href string:$portal_url/@@overview-controlpanel"
i18n:translate="">
Site Setup
<a
href="${context/portal_url}/@@overview-controlpanel"
id="setup-link"
>
Site Setup
</a>

<h1 class="documentFirstHeading"
i18n:translate="">Archive Management</h1>

Expand Down
11 changes: 6 additions & 5 deletions castle/cms/browser/controlpanel/templates/archives-review.pt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

<metal:main metal:fill-slot="prefs_configlet_main" i18n:domain="plone">

<a href=""
id="setup-link"
tal:attributes="href string:$portal_url/@@overview-controlpanel"
i18n:translate="">
Site Setup
<a
href="${context/portal_url}/@@overview-controlpanel"
id="setup-link"
>
Site Setup
</a>

<h1 class="documentFirstHeading"
i18n:translate="">Archive Management</h1>

Expand Down
13 changes: 6 additions & 7 deletions castle/cms/browser/controlpanel/templates/audit.pt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
tal:define="connected view/can_connect_to_index;
site_path python: '/'.join(context.getPhysicalPath())">

<a href=""
id="setup-link"
tal:attributes="href string:$portal_url/plone_control_panel"
i18n:translate=""
tal:condition="not: view/user">
Site Setup
<a
href="${context/portal_url}/@@overview-controlpanel"
id="setup-link"
tal:condition="not: view/user">
>
Site Setup
</a>


<h1 class="documentFirstHeading" tal:content="view/label">View Title</h1>

<div metal:use-macro="context/global_statusmessage/macros/portal_message">
Expand Down
11 changes: 6 additions & 5 deletions castle/cms/browser/controlpanel/templates/celery.pt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

<metal:main metal:fill-slot="prefs_configlet_main" i18n:domain="plone">

<a href=""
id="setup-link"
tal:attributes="href string:$portal_url/@@overview-controlpanel"
i18n:translate="">
Site Setup
<a
href="${context/portal_url}/@@overview-controlpanel"
id="setup-link"
>
Site Setup
</a>

<h1 class="documentFirstHeading"
i18n:translate="">Celery Tasks</h1>

Expand Down
11 changes: 5 additions & 6 deletions castle/cms/browser/controlpanel/templates/crawler.pt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@

<div metal:fill-slot="prefs_configlet_main">

<a href=""
id="setup-link"
tal:attributes="href string:$portal_url/plone_control_panel"
i18n:translate="">
Site Setup
<a
href="${context/portal_url}/@@overview-controlpanel"
id="setup-link"
>
Site Setup
</a>


<h1 class="documentFirstHeading" tal:content="view/label">View Title</h1>

<div metal:use-macro="context/global_statusmessage/macros/portal_message">
Expand Down
Loading
Loading