Runway 1.0.0
This commit is contained in:
commit
dcf819146b
1372 files changed
+188168
No files matched your search
@@ -0,0 +1,95 @@
|
||||
<!-- Admin status fragment — the filename `admin` makes the host render it below this plugin's per-tenant
|
||||
settings form. Bare fragment; binding in admin.th.xml. -->
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title" id="sa-title">Search status</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="datagrid">
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="sa-l-status">Enabled</div>
|
||||
<div class="datagrid-content"><span id="sa-status">on</span></div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="sa-l-engine">Active engine</div>
|
||||
<div class="datagrid-content"><span id="sa-engine">search/simple</span>
|
||||
(<span id="sa-engines">1</span>)</div>
|
||||
</div>
|
||||
<div class="datagrid-item">
|
||||
<div class="datagrid-title" id="sa-l-pages">Searchable items</div>
|
||||
<div class="datagrid-content" id="sa-pages">0</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-secondary small mt-2 mb-0" id="sa-note">
|
||||
Add a search box to any page with a data-widget anchor; when a page is opened with ?q= it shows the
|
||||
results inline.</p>
|
||||
<!-- Rebuild the index now (every engine): a POST carrying the console's CSRF token (it changes state, so a
|
||||
cross-site link must not be able to trigger it); the plain-text result opens in a new tab. -->
|
||||
<div class="d-flex flex-wrap align-items-center gap-2 mt-2" id="sr-reindex">
|
||||
<span class="text-secondary small" id="sr-desc">Edited files by hand? Rebuild the index now.</span>
|
||||
<form id="sr-reindex-form" method="post" action="/search/reindex" target="_blank" rel="noopener"
|
||||
class="m-0 ms-auto">
|
||||
<input id="sr-csrf" type="hidden" name="_csrf" value="">
|
||||
<button id="sr-reindex-btn" type="submit" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="fa-solid fa-rotate me-1"></i><span id="sr-reindex-label">Rebuild index</span></button>
|
||||
</form>
|
||||
</div>
|
||||
<hr>
|
||||
<!-- "Search page" — install a ready-made, editable results page, or show its live path (follows a move).
|
||||
The install is a POST carrying the console's CSRF token (it creates a page); the plain-text result
|
||||
opens in a new tab. -->
|
||||
<div id="sp-install">
|
||||
<p class="text-secondary" id="sp-desc">Install a ready-made search results page carrying the box. It
|
||||
becomes a normal site page — edit, restyle, move or rename it from Pages.</p>
|
||||
<form id="sp-install-form" method="post" action="/search/install-page" target="_blank" rel="noopener"
|
||||
class="m-0">
|
||||
<input id="sp-csrf" type="hidden" name="_csrf" value="">
|
||||
<button id="sp-install-btn" type="submit" class="btn btn-primary">
|
||||
<i class="fa-solid fa-file-circle-plus me-1"></i><span id="sp-install-label">Install search page</span></button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="sp-installed" class="d-flex align-items-center">
|
||||
<span class="badge bg-success-lt me-2" id="sp-badge">Installed</span>
|
||||
<span id="sp-at">Installed at</span> <code id="sp-path" class="ms-1">/search</code>
|
||||
<span class="text-secondary ms-2" id="sp-edit">— edit it under Pages.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a id="sa-help" href="/__plugin/search/static/search-help.html" target="_blank" rel="noopener">
|
||||
<i class="fa-solid fa-circle-question me-1"></i><span id="sa-help-label">Search help & reference</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- "Searches with no results" — the content-gap list (opt-in per site). Terms are VISITOR TEXT: bound with th:text
|
||||
only. Clearing is a POST carrying the console session's CSRF token, so no cross-site link can trigger it. -->
|
||||
<div class="card mt-3" id="nr-card">
|
||||
<div class="card-header"><h3 class="card-title" id="nr-title">Searches with no results</h3></div>
|
||||
<div class="card-body">
|
||||
<p class="text-secondary" id="nr-intro">What visitors searched for and did not find.</p>
|
||||
<div class="alert alert-info" role="alert" id="nr-off">Recording is off for this site.</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-vcenter card-table" data-listing-table="search.admin.noresults">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col-key="term" id="nr-h-term">Search term</th>
|
||||
<th data-col-key="count" id="nr-h-count" class="w-1">Searches</th>
|
||||
<th data-col-key="last" id="nr-h-last" class="w-1">Last searched</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="nr-empty"><td colspan="3" class="text-secondary text-center" id="nr-empty-text">None yet.</td></tr>
|
||||
<tr id="nr-row">
|
||||
<td class="nr-term text-break">term</td>
|
||||
<td class="nr-count text-end">0</td>
|
||||
<td class="nr-last text-secondary text-nowrap">-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer d-flex flex-wrap align-items-center justify-content-between gap-2">
|
||||
<small class="text-secondary" id="nr-retention">Retention.</small>
|
||||
<form id="nr-clear-form" method="post" action="/search/no-results/clear" class="m-0">
|
||||
<input id="nr-csrf" type="hidden" name="_csrf" value="">
|
||||
<button id="nr-clear" type="submit" class="btn btn-sm btn-outline-danger">
|
||||
<i class="fa-solid fa-eraser me-1"></i><span id="nr-clear-label">Clear list</span></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Admin fragment logic. Values from ${@searchAdminModel...(tenantSiteId)}; the on/off ternary keeps the
|
||||
condition in ${} and each branch a standalone #{} (pitfall #12). -->
|
||||
<thlogic>
|
||||
<attr sel="#sa-title" th:text="#{search.admin.title}"/>
|
||||
<attr sel="#sa-l-status" th:text="#{search.admin.enabled}"/>
|
||||
<attr sel="#sa-status" th:text="${@searchAdminModel.enabled(tenantSiteId)} ? #{search.on} : #{search.off}"/>
|
||||
<attr sel="#sa-l-engine" th:text="#{search.admin.engine}"/>
|
||||
<attr sel="#sa-engine" th:text="${@searchAdminModel.activeEngineKey(tenantSiteId)}"/>
|
||||
<attr sel="#sa-engines" th:text="${@searchAdminModel.engineCount()}"/>
|
||||
<attr sel="#sa-l-pages" th:text="#{search.admin.pages}"/>
|
||||
<attr sel="#sa-pages" th:text="${@searchAdminModel.searchableItems(tenantSiteId)}"/>
|
||||
<attr sel="#sa-note" th:text="#{search.admin.note}"/>
|
||||
|
||||
<!-- Rebuild index: the form's action is the constant /search/reindex in the static markup (no th:action: the
|
||||
restricted URL/attr context forbids ${@bean}). The hidden field carries the console session's CSRF token
|
||||
(the request attribute _csrf, never a bean), which the kernel's tenant chain demands on this POST. -->
|
||||
<attr sel="#sr-desc" th:text="#{search.reindex.desc}"/>
|
||||
<attr sel="#sr-csrf"
|
||||
th:attr="name=${_csrf != null ? _csrf.parameterName : '_csrf'},value=${_csrf != null ? _csrf.token : ''}"/>
|
||||
<attr sel="#sr-reindex-btn" th:title="#{search.reindex.tip}"/>
|
||||
<attr sel="#sr-reindex-label" th:text="#{search.reindex.button}"/>
|
||||
|
||||
<!-- "Search page" install card: exactly one block shows, gated on the live install status. The install form's
|
||||
action is the constant /search/install-page in the static markup; the live path is bound with th:text
|
||||
(which permits @bean). The hidden field carries the console session's CSRF token, as above. -->
|
||||
<attr sel="#sp-install" th:if="${!@searchAdminModel.pageInstalled(tenantSiteId)}"/>
|
||||
<attr sel="#sp-desc" th:text="#{search.page.card.desc}"/>
|
||||
<attr sel="#sp-csrf"
|
||||
th:attr="name=${_csrf != null ? _csrf.parameterName : '_csrf'},value=${_csrf != null ? _csrf.token : ''}"/>
|
||||
<attr sel="#sp-install-btn" th:title="#{search.page.card.install.tip}"/>
|
||||
<attr sel="#sp-install-label" th:text="#{search.page.card.install}"/>
|
||||
<attr sel="#sp-installed" th:if="${@searchAdminModel.pageInstalled(tenantSiteId)}"/>
|
||||
<attr sel="#sp-badge" th:text="#{search.page.card.badge}"/>
|
||||
<attr sel="#sp-at" th:text="#{search.page.card.at}"/>
|
||||
<attr sel="#sp-path" th:text="${@searchAdminModel.pagePath(tenantSiteId)}"/>
|
||||
<attr sel="#sp-edit" th:text="#{search.page.card.edit}"/>
|
||||
|
||||
<attr sel="#sa-help-label" th:text="#{search.admin.help}"/>
|
||||
|
||||
<!-- "Searches with no results": the list is read ONCE into ${nr} (th:with on the card) and every row binds
|
||||
visitor text with th:text only. The clear form carries the console page's CSRF token (the tenant chain
|
||||
rejects the POST without it) and shows only when there is something to clear. -->
|
||||
<attr sel="#nr-card" th:with="nr=${@searchAdminModel.noResults(tenantSiteId)}"/>
|
||||
<attr sel="#nr-title" th:text="#{search.noresults.title}"/>
|
||||
<attr sel="#nr-intro" th:text="#{search.noresults.intro}"/>
|
||||
<attr sel="#nr-off" th:if="${!@searchAdminModel.noResultsRecording(tenantSiteId)}" th:text="#{search.noresults.off}"/>
|
||||
<attr sel="#nr-h-term" th:text="#{search.noresults.col.term}"/>
|
||||
<attr sel="#nr-h-count" th:text="#{search.noresults.col.count}"/>
|
||||
<attr sel="#nr-h-last" th:text="#{search.noresults.col.lastSeen}"/>
|
||||
<attr sel="#nr-card//#nr-empty" th:if="${nr.isEmpty()}"/>
|
||||
<attr sel="#nr-empty-text" th:text="#{search.noresults.empty}"/>
|
||||
<attr sel="#nr-card//#nr-row" th:each="e : ${nr}"/>
|
||||
<attr sel="#nr-card//#nr-row//.nr-term" th:text="${e.term()}"/>
|
||||
<attr sel="#nr-card//#nr-row//.nr-count" th:text="${e.count()}" th:attr="data-sort=${e.count()}"/>
|
||||
<attr sel="#nr-card//#nr-row//.nr-last" th:text="${@searchAdminModel.lastSeen(e)}"/>
|
||||
<attr sel="#nr-retention"
|
||||
th:text="#{search.noresults.retention(${@searchAdminModel.noResultsRetentionDays(tenantSiteId)},${@searchAdminModel.noResultsMaxTerms()})}"/>
|
||||
<attr sel="#nr-card//#nr-clear-form" th:if="${!nr.isEmpty()}"/>
|
||||
<attr sel="#nr-csrf"
|
||||
th:attr="name=${_csrf != null ? _csrf.parameterName : '_csrf'},value=${_csrf != null ? _csrf.token : ''}"/>
|
||||
<attr sel="#nr-clear" th:title="#{search.noresults.clear.tip}"/>
|
||||
<attr sel="#nr-clear-label" th:text="#{search.noresults.clear}"/>
|
||||
</thlogic>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!-- Tenant dashboard card fragment — resolved as __plugin__/search/dashboard. Bare fragment
|
||||
(no <html>/<body>); all binding lives in the paired dashboard.th.xml. -->
|
||||
<div class="card">
|
||||
<div class="card-status-start bg-azure"></div>
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="bg-azure-lt avatar"><i class="fa-solid fa-magnifying-glass"></i></span>
|
||||
<div class="ms-3">
|
||||
<div class="fw-bold" id="sc-title">Search</div>
|
||||
<div class="text-secondary small">
|
||||
<span id="sc-pages">0</span> <span id="sc-pages-lbl">searchable items</span>
|
||||
· <span id="sc-status">on</span>
|
||||
· <span id="sc-engine">engine</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Dashboard card logic. Values from ${@searchAdminModel...(tenantSiteId)}; the on/off ternary keeps the
|
||||
condition in ${} and each branch a standalone #{} message expression (pitfall #12 — never nest #{} in ${}). -->
|
||||
<thlogic>
|
||||
<attr sel="#sc-title" th:text="#{search.card.title}"/>
|
||||
<attr sel="#sc-pages" th:text="${@searchAdminModel.searchableItems(tenantSiteId)}"/>
|
||||
<attr sel="#sc-pages-lbl" th:text="#{search.card.pages}"/>
|
||||
<attr sel="#sc-status" th:text="${@searchAdminModel.enabled(tenantSiteId)} ? #{search.on} : #{search.off}"/>
|
||||
<attr sel="#sc-engine" th:text="${@searchAdminModel.activeEngineKey(tenantSiteId)}"/>
|
||||
</thlogic>
|
||||
Reference in new issue
Block a user