Skip to content

Commit

Permalink
Barceloneta LTS (#44)
Browse files Browse the repository at this point in the history
* disable old styles

* bootstrap markup update

* bootstrap markup update

* bs5 form updates

* use icon from icon resolver

* update button classes for bootstrap

* update button classes for bootstrap

* use explicit icon name

* turn configlet portlets into menu

* bootstrap b1 changes

Co-authored-by: Peter Holzer <peter.holzer@agitator.com>
Co-authored-by: Jens W. Klein <jk@kleinundpartner.at>
  • Loading branch information
3 people committed Feb 13, 2021
1 parent dad1d23 commit 6d5fe54
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 79 deletions.
4 changes: 2 additions & 2 deletions plone/app/registry/browser/controlpanel.py
Expand Up @@ -51,8 +51,8 @@ def getContent(self):

def updateActions(self):
super(RegistryEditForm, self).updateActions()
self.actions['save'].addClass("context")
self.actions['cancel'].addClass("standalone")
self.actions['save'].addClass("btn btn-primary")
self.actions['cancel'].addClass("btn btn-secondary")

@button.buttonAndHandler(_(u"Save"), name='save')
def handleSave(self, action):
Expand Down
4 changes: 2 additions & 2 deletions plone/app/registry/browser/edit.py
Expand Up @@ -28,8 +28,8 @@ def update(self):

def updateActions(self):
super(RecordEditForm, self).updateActions()
self.actions['save'].addClass("context")
self.actions['cancel'].addClass("standalone")
self.actions['save'].addClass("btn btn-primary")
self.actions['cancel'].addClass("btn btn-secondary")

@property
def label(self):
Expand Down
4 changes: 4 additions & 0 deletions plone/app/registry/browser/records.py
Expand Up @@ -103,6 +103,10 @@ class RecordsControlPanel(AutoExtensibleForm, form.Form):
def action(self):
return '{url}#autotoc-item-autotoc-3'.format(url=self.context.absolute_url())

def updateActions(self):
super(RecordsControlPanel, self).updateActions()
self.actions['addfield'].addClass('btn-primary')

@button.buttonAndHandler(u'Add field', name='addfield')
def action_addfield(self, action):
data, errors = self.extractData()
Expand Down
4 changes: 2 additions & 2 deletions plone/app/registry/browser/resources/style.css
@@ -1,4 +1,4 @@
#searchrow th{
/* #searchrow th{
padding:0;
margin:0;
position: relative;
Expand Down Expand Up @@ -36,4 +36,4 @@
bottom: 0;
right: 0;
}

*/
29 changes: 14 additions & 15 deletions plone/app/registry/browser/templates/controlpanel_layout.pt
Expand Up @@ -7,26 +7,25 @@
i18n:domain="plone">

<body>
<div metal:fill-slot="prefs_configlet_main">
<tal:main metal:fill-slot="prefs_configlet_main">

<a id="setup-link" class="link-parent"
tal:attributes="href view/control_panel_url"
i18n:translate="">
Site Setup
</a>
<header>

<h1 class="documentFirstHeading" tal:content="view/label">View Title</h1>
<h1 tal:content="view/label">View Title</h1>
<p class="lead" tal:condition="view/description | nothing" tal:content="view/description">View Description</p>

<div metal:use-macro="context/global_statusmessage/macros/portal_message">
Portal status message
</div>
</header>

<div metal:use-macro="context/global_statusmessage/macros/portal_message">
Portal status message
</div>

<div id="content-core">
<div id="layout-contents">
<span tal:replace="structure view/contents" />
</div>
<div id="content-core">
<div id="layout-contents">
<span tal:replace="structure view/contents" />
</div>
</div>

</div>
</tal:main>
</body>
</html>
130 changes: 73 additions & 57 deletions plone/app/registry/browser/templates/records.pt
Expand Up @@ -15,66 +15,83 @@
</metal:block>

<body>
<div id="content" metal:fill-slot="prefs_configlet_content"
<article id="content" metal:fill-slot="prefs_configlet_main"
tal:define="records view/records">

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

<header>
<h1 class="documentFirstHeading" i18n:translate="heading_registry">Configuration Registry</h1>

<p class="documentDescription" i18n:translate="description_registry">
<p class="lead" i18n:translate="description_registry">
The table below shows record currently managed by the configuration
registry. Click on a record to edit it.
</p>

</header>
<div id="content-core">
<div class="pat-autotoc autotabs"
data-pat-autotoc="section:.tab;levels:h2;">
<div id="recordsContainer" class="tab">
<h2>Records</h2>
<table id="recordsTable" class="listing">
<thead>
<tr id="searchrow">
<th colspan="5" class="nosort">
<form id="clear-filter">
<button type="submit" i18n:translate="clear_filter">
Clear filter
</button>
</form>
<form tal:define="qp request/qp|nothing;
q request/q|nothing;" id="registry-filter">
<div class="row">
<div class="col-sm-10">
<input name="q" id="q" placeholder="filter by..." size="30"
i18n:attributes="placeholder"
tal:attributes="value python: qp or q" />
</div>
<div class="col-sm-2">
<input type="submit" value="Filter" i18n:attributes="value" />
</div>
</div>
<div class="row">
<div class="col-sm-6">
<span i18n:translate="or">or</span>
<select name="qp" tal:define="prefixes python: sorted(view.prefixes.keys())">
<option value="" i18n:translate="select_prefix">Select Prefix</option>
<tal:prefixes tal:repeat="prefix prefixes">
<option
tal:define="value python: 'prefix:' + (view.prefixes[prefix] or '')"
tal:attributes="value value;"
tal:content="prefix"/>
</tal:prefixes>
</select>
</div>
</div>
</form>
<div id="recordsTable">

</th>
</tr>
<div id="searchrow">

<form tal:define="qp request/qp|nothing;
q request/q|nothing;" id="registry-filter">

<div class="mb-3">
<div class="input-group">
<input class="form-control"
name="q" id="q"
placeholder="filter by..."
i18n:attributes="placeholder"
tal:attributes="value python: qp or q" />
<div class="input-group-append">
<button class="btn btn-primary"
type="submit"
value="Filter"
i18n:translate=""
i18n:attributes="value">
Filter
</button>
</div>
</div>
</div>

<div class="row justify-content-between">
<div class="mb-3 col-auto">
<div class="input-group">
<label class="col-form-label me-2" i18n:translate="or">or</label>
<select class="form-select"
name="qp"
tal:define="prefixes python: sorted(view.prefixes.keys())">
<option value="" i18n:translate="select_prefix">Select Prefix</option>
<tal:prefixes tal:repeat="prefix prefixes">
<option
tal:define="value python: 'prefix:' + (view.prefixes[prefix] or '')"
tal:attributes="value value;"
tal:content="prefix"/>
</tal:prefixes>
</select>
</div>
</div>
<div class="mb-3 col-auto">
<form id="clear-filter">
<button class="btn btn-secondary"
type="submit"
i18n:translate="clear_filter">
Clear filter
</button>
</form>
</div>
</div>

</form>


</div>

<table class="table table-responsive table-bordered table-striped">
<thead>
<tr>
<th i18n:translate="heading_name">Name</th>
<th i18n:translate="heading_title">Title</th>
Expand Down Expand Up @@ -103,12 +120,10 @@
class="value"/>
<tal:non-iface tal:condition="not: record/interfaceName|nothing">
<br />
(
<a href="${context/absolute_url}/@@delete-record?name=${record/__name__}"
(<a href="${context/absolute_url}/@@delete-record?name=${record/__name__}"
class="recordsDeleteLink" i18n:translate="">
Delete record
</a>
)
</a>)
</tal:non-iface>
</td>
</tr>
Expand All @@ -123,13 +138,14 @@
</tfoot>
</table>
</div>
</div>
<div class="tab">
<h2 i18n:translate="export">Export</h2>
<p i18n:translate="registry_export_text">Will export the entire registry into a single XML file.</p>
<form method="POST">
<input type="hidden" name="button.exportregistry" value="true"/>
<div class="formControls">
<button type="submit" i18n:translate="export_button">Export Now</button>
<button class="btn btn-primary" type="submit" i18n:translate="export_button">Export Now</button>
</div>
</form>
<hr />
Expand All @@ -138,13 +154,13 @@
<div class="tab">
<h2 i18n:translate="import">Import</h2>
<form method="POST" enctype='multipart/form-data'>
<div class="form-group field">
<label for="exportFile" i18n:translate="">Registry XML File</label>
<div class="mb-3 field">
<label for="exportFile" class="form-label" i18n:translate="">Registry XML File</label>
<input type="file" name="file" id="exportFile" class="form-control" />
</div>
<input type="hidden" name="button.importregistry" value="true"/>
<div class="formControls">
<button type="submit" i18n:translate="import_button">Import File</button>
<div class="formControls mt-3">
<button class="btn btn-primary" type="submit" i18n:translate="import_button">Import File</button>
</div>
</form>
</div>
Expand All @@ -158,6 +174,6 @@
<script type="text/javascript" src="${context/portal_url}/++resource++plone.app.registry/registry.js">
</script>
</div>
</div>
</article>
</body>
</html>
2 changes: 1 addition & 1 deletion plone/app/registry/profiles/default/controlpanel.xml
Expand Up @@ -4,7 +4,7 @@
<configlet title="Configuration Registry" action_id="plone.app.registry"
appId="plone.app.registry" category="plone-advanced" condition_expr=""
url_expr="string:${portal_url}/portal_registry"
icon_expr="string:$portal_url/++resource++plone.app.registry/icon.png"
icon_expr="string:gear"
visible="True" i18n:attributes="title">
<permission>Manage portal</permission>
</configlet>
Expand Down

0 comments on commit 6d5fe54

Please sign in to comment.