@rmdes/indiekit-endpoint-homepage 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/locales/en.json +1 -1
- package/package.json +1 -1
- package/views/homepage-dashboard.njk +40 -40
package/index.js
CHANGED
|
@@ -34,7 +34,7 @@ export default class HomepageEndpoint {
|
|
|
34
34
|
get navigationItems() {
|
|
35
35
|
return {
|
|
36
36
|
href: this.options.mountPath,
|
|
37
|
-
text: "
|
|
37
|
+
text: "homepageBuilder.title",
|
|
38
38
|
requiresDatabase: true,
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -42,7 +42,7 @@ export default class HomepageEndpoint {
|
|
|
42
42
|
get shortcutItems() {
|
|
43
43
|
return {
|
|
44
44
|
url: this.options.mountPath,
|
|
45
|
-
name: "
|
|
45
|
+
name: "homepageBuilder.title",
|
|
46
46
|
iconName: "home",
|
|
47
47
|
requiresDatabase: true,
|
|
48
48
|
};
|
package/locales/en.json
CHANGED
package/package.json
CHANGED
|
@@ -297,21 +297,21 @@
|
|
|
297
297
|
</style>
|
|
298
298
|
|
|
299
299
|
<header class="page-header">
|
|
300
|
-
<h1 class="page-header__title">{{ __("
|
|
301
|
-
<p class="page-header__description">{{ __("
|
|
300
|
+
<h1 class="page-header__title">{{ __("homepageBuilder.title") }}</h1>
|
|
301
|
+
<p class="page-header__description">{{ __("homepageBuilder.description") }}</p>
|
|
302
302
|
</header>
|
|
303
303
|
|
|
304
304
|
{% if request.query.saved %}
|
|
305
305
|
<div class="hp-success">
|
|
306
|
-
<p>{{ __("
|
|
306
|
+
<p>{{ __("homepageBuilder.saved") }}</p>
|
|
307
307
|
</div>
|
|
308
308
|
{% endif %}
|
|
309
309
|
|
|
310
310
|
{# Quick Start Presets #}
|
|
311
311
|
{% if presets and presets.length %}
|
|
312
312
|
<section class="hp-section" style="margin-block-end: var(--space-xl, 2rem);">
|
|
313
|
-
<h2>{{ __("
|
|
314
|
-
<p class="hp-section__desc">{{ __("
|
|
313
|
+
<h2>{{ __("homepageBuilder.presets.title") }}</h2>
|
|
314
|
+
<p class="hp-section__desc">{{ __("homepageBuilder.presets.description") }}</p>
|
|
315
315
|
|
|
316
316
|
<div class="hp-preset-grid">
|
|
317
317
|
{% for preset in presets %}
|
|
@@ -336,9 +336,9 @@
|
|
|
336
336
|
<div class="hp-preset-card__label">{{ preset.label }}</div>
|
|
337
337
|
<div class="hp-preset-card__desc">{{ preset.description }}</div>
|
|
338
338
|
{% if activePresetId == preset.id %}
|
|
339
|
-
<div class="hp-preset-card__badge">{{ __("
|
|
339
|
+
<div class="hp-preset-card__badge">{{ __("homepageBuilder.presets.active") }}</div>
|
|
340
340
|
{% else %}
|
|
341
|
-
<button type="submit" class="button button--small">{{ __("
|
|
341
|
+
<button type="submit" class="button button--small">{{ __("homepageBuilder.presets.apply") }}</button>
|
|
342
342
|
{% endif %}
|
|
343
343
|
</form>
|
|
344
344
|
{% endfor %}
|
|
@@ -350,10 +350,10 @@
|
|
|
350
350
|
<line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/>
|
|
351
351
|
</svg>
|
|
352
352
|
</div>
|
|
353
|
-
<div class="hp-preset-card__label">{{ __("
|
|
354
|
-
<div class="hp-preset-card__desc">{{ __("
|
|
353
|
+
<div class="hp-preset-card__label">{{ __("homepageBuilder.presets.custom") }}</div>
|
|
354
|
+
<div class="hp-preset-card__desc">{{ __("homepageBuilder.presets.customDescription") }}</div>
|
|
355
355
|
{% if not activePresetId %}
|
|
356
|
-
<div class="hp-preset-card__badge">{{ __("
|
|
356
|
+
<div class="hp-preset-card__badge">{{ __("homepageBuilder.presets.active") }}</div>
|
|
357
357
|
{% endif %}
|
|
358
358
|
</div>
|
|
359
359
|
</div>
|
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
<form method="post" action="{{ homepageEndpoint }}/save" class="hp-dashboard" id="hp-form">
|
|
364
364
|
{# Layout Selection #}
|
|
365
365
|
<section class="hp-section">
|
|
366
|
-
<h2>{{ __("
|
|
366
|
+
<h2>{{ __("homepageBuilder.layout.title") }}</h2>
|
|
367
367
|
<div class="hp-layout-grid">
|
|
368
368
|
{% for layout in layouts %}
|
|
369
369
|
<label class="hp-layout-option {% if config.layout == layout.id %}selected{% endif %}">
|
|
@@ -383,30 +383,30 @@
|
|
|
383
383
|
|
|
384
384
|
{# Hero Configuration #}
|
|
385
385
|
<section class="hp-section">
|
|
386
|
-
<h2>{{ __("
|
|
386
|
+
<h2>{{ __("homepageBuilder.hero.title") }}</h2>
|
|
387
387
|
<div class="field">
|
|
388
388
|
<label class="field__label">
|
|
389
389
|
<input type="checkbox" name="hero[enabled]" value="true" {% if config.hero.enabled %}checked{% endif %}>
|
|
390
|
-
{{ __("
|
|
390
|
+
{{ __("homepageBuilder.hero.enabled") }}
|
|
391
391
|
</label>
|
|
392
392
|
</div>
|
|
393
393
|
<div class="field">
|
|
394
394
|
<label class="field__label">
|
|
395
395
|
<input type="checkbox" name="hero[showSocial]" value="true" {% if config.hero.showSocial %}checked{% endif %}>
|
|
396
|
-
{{ __("
|
|
396
|
+
{{ __("homepageBuilder.hero.showSocial") }}
|
|
397
397
|
</label>
|
|
398
398
|
</div>
|
|
399
399
|
</section>
|
|
400
400
|
|
|
401
401
|
{# Content Sections #}
|
|
402
402
|
<section class="hp-section">
|
|
403
|
-
<h2>{{ __("
|
|
404
|
-
<p class="hp-section__desc">{{ __("
|
|
403
|
+
<h2>{{ __("homepageBuilder.sections.title") }}</h2>
|
|
404
|
+
<p class="hp-section__desc">{{ __("homepageBuilder.sections.description") }}</p>
|
|
405
405
|
|
|
406
406
|
<ul class="hp-sections-list" id="sections-list"></ul>
|
|
407
407
|
|
|
408
408
|
<div class="hp-section-picker">
|
|
409
|
-
<h3>{{ __("
|
|
409
|
+
<h3>{{ __("homepageBuilder.sections.add") }}</h3>
|
|
410
410
|
<div class="hp-section-picker__grid">
|
|
411
411
|
{% for source, items in sectionsByPlugin %}
|
|
412
412
|
<div class="hp-section-picker__heading">{{ source }}</div>
|
|
@@ -424,13 +424,13 @@
|
|
|
424
424
|
|
|
425
425
|
{# Sidebar Widgets #}
|
|
426
426
|
<section class="hp-section">
|
|
427
|
-
<h2>{{ __("
|
|
428
|
-
<p class="hp-section__desc">{{ __("
|
|
427
|
+
<h2>{{ __("homepageBuilder.sidebar.title") }}</h2>
|
|
428
|
+
<p class="hp-section__desc">{{ __("homepageBuilder.sidebar.description") }}</p>
|
|
429
429
|
|
|
430
430
|
<ul class="hp-sections-list" id="widgets-list"></ul>
|
|
431
431
|
|
|
432
432
|
<div class="hp-section-picker">
|
|
433
|
-
<h3>{{ __("
|
|
433
|
+
<h3>{{ __("homepageBuilder.sidebar.add") }}</h3>
|
|
434
434
|
<div class="hp-section-picker__grid">
|
|
435
435
|
{% for widget in widgets %}
|
|
436
436
|
<div class="hp-section-picker__item" data-add-widget="{{ widget.id }}">
|
|
@@ -445,13 +445,13 @@
|
|
|
445
445
|
|
|
446
446
|
{# Blog Listing Sidebar #}
|
|
447
447
|
<section class="hp-section">
|
|
448
|
-
<h2>{{ __("
|
|
449
|
-
<p class="hp-section__desc">{{ __("
|
|
448
|
+
<h2>{{ __("homepageBuilder.blogListingSidebar.title") }}</h2>
|
|
449
|
+
<p class="hp-section__desc">{{ __("homepageBuilder.blogListingSidebar.description") }}</p>
|
|
450
450
|
|
|
451
451
|
<ul class="hp-sections-list" id="blog-listing-sidebar-list"></ul>
|
|
452
452
|
|
|
453
453
|
<div class="hp-section-picker">
|
|
454
|
-
<h3>{{ __("
|
|
454
|
+
<h3>{{ __("homepageBuilder.blogListingSidebar.add") }}</h3>
|
|
455
455
|
<div class="hp-section-picker__grid">
|
|
456
456
|
{% for widget in widgets %}
|
|
457
457
|
<div class="hp-section-picker__item" data-add-blog-listing-widget="{{ widget.id }}">
|
|
@@ -466,13 +466,13 @@
|
|
|
466
466
|
|
|
467
467
|
{# Blog Post Sidebar #}
|
|
468
468
|
<section class="hp-section">
|
|
469
|
-
<h2>{{ __("
|
|
470
|
-
<p class="hp-section__desc">{{ __("
|
|
469
|
+
<h2>{{ __("homepageBuilder.blogPostSidebar.title") }}</h2>
|
|
470
|
+
<p class="hp-section__desc">{{ __("homepageBuilder.blogPostSidebar.description") }}</p>
|
|
471
471
|
|
|
472
472
|
<ul class="hp-sections-list" id="blog-post-sidebar-list"></ul>
|
|
473
473
|
|
|
474
474
|
<div class="hp-section-picker">
|
|
475
|
-
<h3>{{ __("
|
|
475
|
+
<h3>{{ __("homepageBuilder.blogPostSidebar.add") }}</h3>
|
|
476
476
|
<div class="hp-section-picker__grid">
|
|
477
477
|
<div class="hp-section-picker__heading">Post Widgets</div>
|
|
478
478
|
{% for widget in blogPostWidgets %}
|
|
@@ -498,13 +498,13 @@
|
|
|
498
498
|
|
|
499
499
|
{# Footer #}
|
|
500
500
|
<section class="hp-section">
|
|
501
|
-
<h2>{{ __("
|
|
502
|
-
<p class="hp-section__desc">{{ __("
|
|
501
|
+
<h2>{{ __("homepageBuilder.footer.title") }}</h2>
|
|
502
|
+
<p class="hp-section__desc">{{ __("homepageBuilder.footer.description") }}</p>
|
|
503
503
|
|
|
504
504
|
<ul class="hp-sections-list" id="footer-list"></ul>
|
|
505
505
|
|
|
506
506
|
<div class="hp-section-picker" id="footer-picker">
|
|
507
|
-
<h3>{{ __("
|
|
507
|
+
<h3>{{ __("homepageBuilder.footer.add") }}</h3>
|
|
508
508
|
<div class="hp-section-picker__grid">
|
|
509
509
|
{# Footer accepts same section types + custom-html #}
|
|
510
510
|
{% for source, items in sectionsByPlugin %}
|
|
@@ -517,14 +517,14 @@
|
|
|
517
517
|
{% endfor %}
|
|
518
518
|
</div>
|
|
519
519
|
</div>
|
|
520
|
-
<p class="hp-empty" id="footer-full-msg" style="display:none">{{ __("
|
|
520
|
+
<p class="hp-empty" id="footer-full-msg" style="display:none">{{ __("homepageBuilder.footer.full") }}</p>
|
|
521
521
|
|
|
522
522
|
<input type="hidden" name="footer" id="footer-json" value='{{ config.footer | dump }}'>
|
|
523
523
|
</section>
|
|
524
524
|
|
|
525
525
|
{# Save Button #}
|
|
526
526
|
<div class="button-group">
|
|
527
|
-
<button type="submit" class="button button--primary">{{ __("
|
|
527
|
+
<button type="submit" class="button button--primary">{{ __("homepageBuilder.save") }}</button>
|
|
528
528
|
</div>
|
|
529
529
|
</form>
|
|
530
530
|
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
titleField.className = 'field';
|
|
663
663
|
var titleLabel = document.createElement('label');
|
|
664
664
|
titleLabel.className = 'field__label';
|
|
665
|
-
titleLabel.textContent = '{{ __("
|
|
665
|
+
titleLabel.textContent = '{{ __("homepageBuilder.customContent.titleLabel") }}';
|
|
666
666
|
var titleInput = document.createElement('input');
|
|
667
667
|
titleInput.className = 'field__input';
|
|
668
668
|
titleInput.type = 'text';
|
|
@@ -676,7 +676,7 @@
|
|
|
676
676
|
contentField.className = 'field';
|
|
677
677
|
var contentLabel = document.createElement('label');
|
|
678
678
|
contentLabel.className = 'field__label';
|
|
679
|
-
contentLabel.textContent = '{{ __("
|
|
679
|
+
contentLabel.textContent = '{{ __("homepageBuilder.customContent.contentLabel") }}';
|
|
680
680
|
var contentInput = document.createElement('textarea');
|
|
681
681
|
contentInput.className = 'field__input';
|
|
682
682
|
contentInput.rows = 6;
|
|
@@ -692,7 +692,7 @@
|
|
|
692
692
|
var saveBtn = document.createElement('button');
|
|
693
693
|
saveBtn.type = 'button';
|
|
694
694
|
saveBtn.className = 'button button--primary button--small';
|
|
695
|
-
saveBtn.textContent = '{{ __("
|
|
695
|
+
saveBtn.textContent = '{{ __("homepageBuilder.customContent.save") }}';
|
|
696
696
|
saveBtn.addEventListener('click', function() {
|
|
697
697
|
editFn(item._key, {
|
|
698
698
|
title: titleInput.value,
|
|
@@ -704,7 +704,7 @@
|
|
|
704
704
|
var cancelBtn = document.createElement('button');
|
|
705
705
|
cancelBtn.type = 'button';
|
|
706
706
|
cancelBtn.className = 'button button--small button--secondary';
|
|
707
|
-
cancelBtn.textContent = '{{ __("
|
|
707
|
+
cancelBtn.textContent = '{{ __("homepageBuilder.customContent.cancel") }}';
|
|
708
708
|
cancelBtn.addEventListener('click', function() { details.open = false; });
|
|
709
709
|
|
|
710
710
|
buttons.appendChild(saveBtn);
|
|
@@ -761,7 +761,7 @@
|
|
|
761
761
|
renderList(
|
|
762
762
|
document.getElementById('sections-list'),
|
|
763
763
|
sections, allLabels, removeSection, editSection,
|
|
764
|
-
'{{ __("
|
|
764
|
+
'{{ __("homepageBuilder.sections.empty") }}'
|
|
765
765
|
);
|
|
766
766
|
initSortable();
|
|
767
767
|
}
|
|
@@ -794,7 +794,7 @@
|
|
|
794
794
|
renderList(
|
|
795
795
|
document.getElementById('widgets-list'),
|
|
796
796
|
sidebar, allLabels, removeWidget, editWidget,
|
|
797
|
-
'{{ __("
|
|
797
|
+
'{{ __("homepageBuilder.sidebar.empty") }}'
|
|
798
798
|
);
|
|
799
799
|
initSortable();
|
|
800
800
|
}
|
|
@@ -827,7 +827,7 @@
|
|
|
827
827
|
renderList(
|
|
828
828
|
document.getElementById('blog-listing-sidebar-list'),
|
|
829
829
|
blogListingSidebar, allLabels, removeBlogListingWidget, editBlogListingWidget,
|
|
830
|
-
'{{ __("
|
|
830
|
+
'{{ __("homepageBuilder.blogListingSidebar.empty") }}'
|
|
831
831
|
);
|
|
832
832
|
initSortable();
|
|
833
833
|
}
|
|
@@ -860,7 +860,7 @@
|
|
|
860
860
|
renderList(
|
|
861
861
|
document.getElementById('blog-post-sidebar-list'),
|
|
862
862
|
blogPostSidebar, allLabels, removeBlogPostWidget, editBlogPostWidget,
|
|
863
|
-
'{{ __("
|
|
863
|
+
'{{ __("homepageBuilder.blogPostSidebar.empty") }}'
|
|
864
864
|
);
|
|
865
865
|
initSortable();
|
|
866
866
|
}
|
|
@@ -896,7 +896,7 @@
|
|
|
896
896
|
renderList(
|
|
897
897
|
document.getElementById('footer-list'),
|
|
898
898
|
footer, allLabels, removeFooter, editFooter,
|
|
899
|
-
'{{ __("
|
|
899
|
+
'{{ __("homepageBuilder.footer.empty") }}'
|
|
900
900
|
);
|
|
901
901
|
// Show/hide picker based on column limit
|
|
902
902
|
var picker = document.getElementById('footer-picker');
|