@mindful-web/marko-web-theme-monorail-magazine 1.0.0
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/.eslintignore +1 -0
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/components/blocks/magazine-archived-issue.marko +23 -0
- package/components/blocks/magazine-archived-issue.marko.js +58 -0
- package/components/blocks/magazine-current-issue.marko +43 -0
- package/components/blocks/magazine-current-issue.marko.js +120 -0
- package/components/blocks/magazine-issue-cards.marko +33 -0
- package/components/blocks/magazine-issue-cards.marko.js +95 -0
- package/components/blocks/magazine-issues.marko +53 -0
- package/components/blocks/magazine-issues.marko.js +152 -0
- package/components/blocks/magazine-latest-issue.marko +34 -0
- package/components/blocks/magazine-latest-issue.marko.js +97 -0
- package/components/blocks/magazine-publication-card.marko +36 -0
- package/components/blocks/magazine-publication-card.marko.js +125 -0
- package/components/blocks/magazine-publications.marko +22 -0
- package/components/blocks/magazine-publications.marko.js +88 -0
- package/components/blocks/marko.json +23 -0
- package/components/flows/magazine-issue-archive.marko +12 -0
- package/components/flows/magazine-issue-archive.marko.js +55 -0
- package/components/flows/magazine-latest-issue.marko +22 -0
- package/components/flows/magazine-latest-issue.marko.js +69 -0
- package/components/flows/marko.json +21 -0
- package/components/marko.json +13 -0
- package/components/nodes/magazine-issue-archive.marko +29 -0
- package/components/nodes/magazine-issue-archive.marko.js +78 -0
- package/components/nodes/magazine-latest-issue.marko +33 -0
- package/components/nodes/magazine-latest-issue.marko.js +76 -0
- package/components/nodes/marko.json +21 -0
- package/components/publication-buttons.marko +61 -0
- package/components/publication-buttons.marko.js +176 -0
- package/components/publication-links.marko +61 -0
- package/components/publication-links.marko.js +176 -0
- package/graphql/fragments/issue-archive.js +19 -0
- package/graphql/fragments/latest-issue.js +28 -0
- package/graphql/fragments/magazine-content-feed-block.js +33 -0
- package/graphql/fragments/magazine-issue-archive.js +19 -0
- package/graphql/fragments/magazine-issue-page.js +31 -0
- package/graphql/fragments/magazine-latest-issue.js +30 -0
- package/graphql/fragments/magazine-publication-list.js +11 -0
- package/graphql/fragments/magazine-publication-page.js +12 -0
- package/graphql/fragments/section-feed-block.js +33 -0
- package/index.js +0 -0
- package/marko.json +5 -0
- package/package.json +34 -0
- package/routes/index.js +22 -0
- package/scss/index.scss +241 -0
- package/templates/index.marko +28 -0
- package/templates/index.marko.js +98 -0
- package/templates/issue.marko +96 -0
- package/templates/issue.marko.js +279 -0
- package/templates/publication.marko +61 -0
- package/templates/publication.marko.js +189 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/nodes/magazine-issue-archive.marko",
|
|
6
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
7
|
+
module_objectPath_module = require("@mindful-web/object-path"),
|
|
8
|
+
objectPath_module = module_objectPath_module.default || module_objectPath_module,
|
|
9
|
+
getAsObject = module_objectPath_module.getAsObject,
|
|
10
|
+
module_utils_module = require("@mindful-web/marko-web/utils"),
|
|
11
|
+
utils_module = module_utils_module.default || module_utils_module,
|
|
12
|
+
defaultValue = module_utils_module.defaultValue,
|
|
13
|
+
marko_web_magazine_issue_name_template = require("@mindful-web/marko-web/components/element/magazine-issue/name.marko"),
|
|
14
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
15
|
+
marko_web_magazine_issue_name_tag = marko_loadTag(marko_web_magazine_issue_name_template),
|
|
16
|
+
marko_web_node_template = require("@mindful-web/marko-web/components/node/index.marko"),
|
|
17
|
+
marko_web_node_tag = marko_loadTag(marko_web_node_template);
|
|
18
|
+
|
|
19
|
+
function render(input, out, __component, component, state) {
|
|
20
|
+
var data = input;
|
|
21
|
+
|
|
22
|
+
const issue = getAsObject(input, "node");
|
|
23
|
+
|
|
24
|
+
const publication = getAsObject(issue, "publication");
|
|
25
|
+
|
|
26
|
+
const coverImage = getAsObject(issue, "coverImage");
|
|
27
|
+
|
|
28
|
+
const alt = `${publication.name} ${issue.name}`;
|
|
29
|
+
|
|
30
|
+
marko_web_node_tag({
|
|
31
|
+
imagePosition: "top",
|
|
32
|
+
card: defaultValue(input.card, true),
|
|
33
|
+
flush: defaultValue(input.flush, false),
|
|
34
|
+
fullHeight: defaultValue(input.fullHeight, false),
|
|
35
|
+
image: {
|
|
36
|
+
src: coverImage.src,
|
|
37
|
+
alt: coverImage.alt || alt,
|
|
38
|
+
fluid: true,
|
|
39
|
+
ar: "3:4",
|
|
40
|
+
width: defaultValue(input.imageWidth, 400),
|
|
41
|
+
link: {
|
|
42
|
+
href: issue.canonicalPath,
|
|
43
|
+
title: alt
|
|
44
|
+
},
|
|
45
|
+
options: {
|
|
46
|
+
fit: "max"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
body: {
|
|
50
|
+
title: {
|
|
51
|
+
tag: "h5",
|
|
52
|
+
show: defaultValue(input.withTitle, true),
|
|
53
|
+
renderBody: function(out) {
|
|
54
|
+
marko_web_magazine_issue_name_tag({
|
|
55
|
+
tag: null,
|
|
56
|
+
obj: issue,
|
|
57
|
+
link: {
|
|
58
|
+
title: alt
|
|
59
|
+
}
|
|
60
|
+
}, out, __component, "4");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, out, __component, "0");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
marko_template._ = marko_renderer(render, {
|
|
68
|
+
d_: true,
|
|
69
|
+
e_: marko_componentType
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
marko_template.meta = {
|
|
73
|
+
id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/nodes/magazine-issue-archive.marko",
|
|
74
|
+
tags: [
|
|
75
|
+
"@mindful-web/marko-web/components/element/magazine-issue/name.marko",
|
|
76
|
+
"@mindful-web/marko-web/components/node/index.marko"
|
|
77
|
+
]
|
|
78
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getAsObject } from "@mindful-web/object-path";
|
|
2
|
+
import { defaultValue } from "@mindful-web/marko-web/utils";
|
|
3
|
+
|
|
4
|
+
$ const issue = getAsObject(input, "node");
|
|
5
|
+
$ const publication = getAsObject(issue, "publication");
|
|
6
|
+
$ const coverImage = getAsObject(issue, "coverImage");
|
|
7
|
+
$ const linkTitle = `${publication.name} ${issue.name}`;
|
|
8
|
+
|
|
9
|
+
<marko-web-node
|
|
10
|
+
image-position="top"
|
|
11
|
+
card=defaultValue(input.card, false)
|
|
12
|
+
flush=defaultValue(input.flush, true)
|
|
13
|
+
>
|
|
14
|
+
<@image
|
|
15
|
+
src=coverImage.src
|
|
16
|
+
alt=(coverImage.alt || linkTitle)
|
|
17
|
+
fluid=true
|
|
18
|
+
ar="3:4"
|
|
19
|
+
width=(input.imageWidth || 300)
|
|
20
|
+
link={ href: issue.canonicalPath, title: linkTitle }
|
|
21
|
+
options={ fit: "max" }
|
|
22
|
+
/>
|
|
23
|
+
<@body>
|
|
24
|
+
<@title tag="h5">
|
|
25
|
+
<marko-web-magazine-issue-name tag=null obj=issue link={ title: linkTitle } />
|
|
26
|
+
</@title>
|
|
27
|
+
<!-- <@footer>
|
|
28
|
+
<@left>
|
|
29
|
+
<theme-magazine-publication-buttons publication=publication issue=issue />
|
|
30
|
+
</@left>
|
|
31
|
+
</@footer> -->
|
|
32
|
+
</@body>
|
|
33
|
+
</marko-web-node>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/nodes/magazine-latest-issue.marko",
|
|
6
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
7
|
+
module_objectPath_module = require("@mindful-web/object-path"),
|
|
8
|
+
objectPath_module = module_objectPath_module.default || module_objectPath_module,
|
|
9
|
+
getAsObject = module_objectPath_module.getAsObject,
|
|
10
|
+
module_utils_module = require("@mindful-web/marko-web/utils"),
|
|
11
|
+
utils_module = module_utils_module.default || module_utils_module,
|
|
12
|
+
defaultValue = module_utils_module.defaultValue,
|
|
13
|
+
marko_web_magazine_issue_name_template = require("@mindful-web/marko-web/components/element/magazine-issue/name.marko"),
|
|
14
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
15
|
+
marko_web_magazine_issue_name_tag = marko_loadTag(marko_web_magazine_issue_name_template),
|
|
16
|
+
marko_web_node_template = require("@mindful-web/marko-web/components/node/index.marko"),
|
|
17
|
+
marko_web_node_tag = marko_loadTag(marko_web_node_template);
|
|
18
|
+
|
|
19
|
+
function render(input, out, __component, component, state) {
|
|
20
|
+
var data = input;
|
|
21
|
+
|
|
22
|
+
const issue = getAsObject(input, "node");
|
|
23
|
+
|
|
24
|
+
const publication = getAsObject(issue, "publication");
|
|
25
|
+
|
|
26
|
+
const coverImage = getAsObject(issue, "coverImage");
|
|
27
|
+
|
|
28
|
+
const linkTitle = `${publication.name} ${issue.name}`;
|
|
29
|
+
|
|
30
|
+
marko_web_node_tag({
|
|
31
|
+
imagePosition: "top",
|
|
32
|
+
card: defaultValue(input.card, false),
|
|
33
|
+
flush: defaultValue(input.flush, true),
|
|
34
|
+
image: {
|
|
35
|
+
src: coverImage.src,
|
|
36
|
+
alt: coverImage.alt || linkTitle,
|
|
37
|
+
fluid: true,
|
|
38
|
+
ar: "3:4",
|
|
39
|
+
width: input.imageWidth || 300,
|
|
40
|
+
link: {
|
|
41
|
+
href: issue.canonicalPath,
|
|
42
|
+
title: linkTitle
|
|
43
|
+
},
|
|
44
|
+
options: {
|
|
45
|
+
fit: "max"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
body: {
|
|
49
|
+
title: {
|
|
50
|
+
tag: "h5",
|
|
51
|
+
renderBody: function(out) {
|
|
52
|
+
marko_web_magazine_issue_name_tag({
|
|
53
|
+
tag: null,
|
|
54
|
+
obj: issue,
|
|
55
|
+
link: {
|
|
56
|
+
title: linkTitle
|
|
57
|
+
}
|
|
58
|
+
}, out, __component, "4");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, out, __component, "0");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
marko_template._ = marko_renderer(render, {
|
|
66
|
+
d_: true,
|
|
67
|
+
e_: marko_componentType
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
marko_template.meta = {
|
|
71
|
+
id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/nodes/magazine-latest-issue.marko",
|
|
72
|
+
tags: [
|
|
73
|
+
"@mindful-web/marko-web/components/element/magazine-issue/name.marko",
|
|
74
|
+
"@mindful-web/marko-web/components/node/index.marko"
|
|
75
|
+
]
|
|
76
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"<theme-magazine-latest-issue-node>": {
|
|
3
|
+
"template": "./magazine-latest-issue.marko",
|
|
4
|
+
"@node": "object",
|
|
5
|
+
"@flush": "boolean",
|
|
6
|
+
"@card": "boolean",
|
|
7
|
+
"@image-width": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"default-value": 300
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"<theme-magazine-issue-archive-node>": {
|
|
13
|
+
"template": "./magazine-issue-archive.marko",
|
|
14
|
+
"@node": "object",
|
|
15
|
+
"@image-width": "number",
|
|
16
|
+
"@full-height": "boolean",
|
|
17
|
+
"@flush": "boolean",
|
|
18
|
+
"@card": "boolean",
|
|
19
|
+
"@with-title": "boolean"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getAsArray, getAsObject } from "@mindful-web/object-path";
|
|
2
|
+
import defaultValue from "@mindful-web/marko-core/utils/default-value";
|
|
3
|
+
|
|
4
|
+
$ const { site, i18n } = out.global;
|
|
5
|
+
$ const buttons = input.buttons || defaultValue(site.get("magazine.buttons"), ["subscribe", "digital-edition", "pdf", "archives", "change-address", "renewal", "cancel", "reprints", "e-inquiry"]);
|
|
6
|
+
|
|
7
|
+
$ const link = { class: "btn btn-primary" };
|
|
8
|
+
$ const targetBlankLink = {
|
|
9
|
+
...link,
|
|
10
|
+
target: "_blank"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
$ const issue = getAsObject(input, "issue");
|
|
14
|
+
|
|
15
|
+
<for|button| of=buttons>
|
|
16
|
+
<if(button === "subscribe")>
|
|
17
|
+
<marko-web-magazine-publication-subscribe-url tag=null obj=issue.publication link=targetBlankLink>
|
|
18
|
+
${i18n("Subscribe")}
|
|
19
|
+
</marko-web-magazine-publication-subscribe-url>
|
|
20
|
+
</if>
|
|
21
|
+
<if(button === "renewal")>
|
|
22
|
+
<marko-web-magazine-publication-renewal-url tag=null obj=issue.publication link=targetBlankLink>
|
|
23
|
+
${i18n("Renew")}
|
|
24
|
+
</marko-web-magazine-publication-renewal-url>
|
|
25
|
+
</if>
|
|
26
|
+
<if(button === "cancel")>
|
|
27
|
+
<marko-web-magazine-publication-cancel-url tag=null obj=issue.publication link=targetBlankLink>
|
|
28
|
+
${i18n("Cancel")}
|
|
29
|
+
</marko-web-magazine-publication-cancel-url>
|
|
30
|
+
</if>
|
|
31
|
+
<if(button === "change-address")>
|
|
32
|
+
<marko-web-magazine-publication-change-address-url tag=null obj=issue.publication link=targetBlankLink>
|
|
33
|
+
${i18n("Change Address")}
|
|
34
|
+
</marko-web-magazine-publication-change-address-url>
|
|
35
|
+
</if>
|
|
36
|
+
<if(button === "digital-edition")>
|
|
37
|
+
<marko-web-magazine-issue-digital-edition-url tag=null obj=issue link=targetBlankLink>
|
|
38
|
+
${i18n("Digital Edition")}
|
|
39
|
+
</marko-web-magazine-issue-digital-edition-url>
|
|
40
|
+
</if>
|
|
41
|
+
<if(button === "pdf")>
|
|
42
|
+
<marko-web-magazine-issue-pdf-url tag=null obj=issue link=targetBlankLink>
|
|
43
|
+
${i18n("Download PDF")}
|
|
44
|
+
</marko-web-magazine-issue-pdf-url>
|
|
45
|
+
</if>
|
|
46
|
+
<if(button === "archives")>
|
|
47
|
+
<marko-web-magazine-publication-name tag=null obj=issue.publication link=link>
|
|
48
|
+
${i18n("Archives")}
|
|
49
|
+
</marko-web-magazine-publication-name>
|
|
50
|
+
</if>
|
|
51
|
+
<if(button === "reprints")>
|
|
52
|
+
<marko-web-magazine-publication-reprints-url tag=null obj=issue.publication link=targetBlankLink>
|
|
53
|
+
${i18n("Reprints")}
|
|
54
|
+
</marko-web-magazine-publication-reprints-url>
|
|
55
|
+
</if>
|
|
56
|
+
<if(button === "e-inquiry")>
|
|
57
|
+
<marko-web-magazine-publication-einquiry-url tag=null obj=issue.publication link=targetBlankLink>
|
|
58
|
+
${i18n("E-Inquiry")}
|
|
59
|
+
</marko-web-magazine-publication-einquiry-url>
|
|
60
|
+
</if>
|
|
61
|
+
</for>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/publication-buttons.marko",
|
|
6
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
7
|
+
module_objectPath_module = require("@mindful-web/object-path"),
|
|
8
|
+
objectPath_module = module_objectPath_module.default || module_objectPath_module,
|
|
9
|
+
getAsArray = module_objectPath_module.getAsArray,
|
|
10
|
+
getAsObject = module_objectPath_module.getAsObject,
|
|
11
|
+
module_defaultValue = require("@mindful-web/marko-core/utils/default-value"),
|
|
12
|
+
defaultValue = module_defaultValue.default || module_defaultValue,
|
|
13
|
+
marko_forOf = require("marko/dist/runtime/helpers/for-of"),
|
|
14
|
+
helpers_escape_xml = require("marko/dist/runtime/html/helpers/escape-xml"),
|
|
15
|
+
marko_escapeXml = helpers_escape_xml.x,
|
|
16
|
+
marko_web_magazine_publication_subscribe_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/subscribe-url.marko"),
|
|
17
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
18
|
+
marko_web_magazine_publication_subscribe_url_tag = marko_loadTag(marko_web_magazine_publication_subscribe_url_template),
|
|
19
|
+
marko_web_magazine_publication_renewal_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/renewal-url.marko"),
|
|
20
|
+
marko_web_magazine_publication_renewal_url_tag = marko_loadTag(marko_web_magazine_publication_renewal_url_template),
|
|
21
|
+
marko_web_magazine_publication_cancel_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/cancel-url.marko"),
|
|
22
|
+
marko_web_magazine_publication_cancel_url_tag = marko_loadTag(marko_web_magazine_publication_cancel_url_template),
|
|
23
|
+
marko_web_magazine_publication_change_address_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/change-address-url.marko"),
|
|
24
|
+
marko_web_magazine_publication_change_address_url_tag = marko_loadTag(marko_web_magazine_publication_change_address_url_template),
|
|
25
|
+
marko_web_magazine_issue_digital_edition_url_template = require("@mindful-web/marko-web/components/element/magazine-issue/digital-edition-url.marko"),
|
|
26
|
+
marko_web_magazine_issue_digital_edition_url_tag = marko_loadTag(marko_web_magazine_issue_digital_edition_url_template),
|
|
27
|
+
marko_web_magazine_issue_pdf_url_template = require("@mindful-web/marko-web/components/element/magazine-issue/pdf-url.marko"),
|
|
28
|
+
marko_web_magazine_issue_pdf_url_tag = marko_loadTag(marko_web_magazine_issue_pdf_url_template),
|
|
29
|
+
marko_web_magazine_publication_name_template = require("@mindful-web/marko-web/components/element/magazine-publication/name.marko"),
|
|
30
|
+
marko_web_magazine_publication_name_tag = marko_loadTag(marko_web_magazine_publication_name_template),
|
|
31
|
+
marko_web_magazine_publication_reprints_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/reprints-url.marko"),
|
|
32
|
+
marko_web_magazine_publication_reprints_url_tag = marko_loadTag(marko_web_magazine_publication_reprints_url_template),
|
|
33
|
+
marko_web_magazine_publication_einquiry_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/einquiry-url.marko"),
|
|
34
|
+
marko_web_magazine_publication_einquiry_url_tag = marko_loadTag(marko_web_magazine_publication_einquiry_url_template);
|
|
35
|
+
|
|
36
|
+
function render(input, out, __component, component, state) {
|
|
37
|
+
var data = input;
|
|
38
|
+
|
|
39
|
+
const { site, i18n } = out.global;
|
|
40
|
+
|
|
41
|
+
const buttons = input.buttons || defaultValue(site.get("magazine.buttons"), ["subscribe", "digital-edition", "pdf", "archives", "change-address", "renewal", "cancel", "reprints", "e-inquiry"]);
|
|
42
|
+
|
|
43
|
+
const link = { class: "btn btn-primary" };
|
|
44
|
+
|
|
45
|
+
const targetBlankLink = {
|
|
46
|
+
...link,
|
|
47
|
+
target: "_blank"
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const issue = getAsObject(input, "issue");
|
|
51
|
+
|
|
52
|
+
var $for$0 = 0;
|
|
53
|
+
|
|
54
|
+
marko_forOf(buttons, function(button) {
|
|
55
|
+
var $keyScope$0 = "[" + (($for$0++) + "]");
|
|
56
|
+
|
|
57
|
+
if (button === "subscribe") {
|
|
58
|
+
marko_web_magazine_publication_subscribe_url_tag({
|
|
59
|
+
tag: null,
|
|
60
|
+
obj: issue.publication,
|
|
61
|
+
link: targetBlankLink,
|
|
62
|
+
renderBody: function(out) {
|
|
63
|
+
out.w(marko_escapeXml(i18n("Subscribe")));
|
|
64
|
+
}
|
|
65
|
+
}, out, __component, "0" + $keyScope$0);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (button === "renewal") {
|
|
69
|
+
marko_web_magazine_publication_renewal_url_tag({
|
|
70
|
+
tag: null,
|
|
71
|
+
obj: issue.publication,
|
|
72
|
+
link: targetBlankLink,
|
|
73
|
+
renderBody: function(out) {
|
|
74
|
+
out.w(marko_escapeXml(i18n("Renew")));
|
|
75
|
+
}
|
|
76
|
+
}, out, __component, "1" + $keyScope$0);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (button === "cancel") {
|
|
80
|
+
marko_web_magazine_publication_cancel_url_tag({
|
|
81
|
+
tag: null,
|
|
82
|
+
obj: issue.publication,
|
|
83
|
+
link: targetBlankLink,
|
|
84
|
+
renderBody: function(out) {
|
|
85
|
+
out.w(marko_escapeXml(i18n("Cancel")));
|
|
86
|
+
}
|
|
87
|
+
}, out, __component, "2" + $keyScope$0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (button === "change-address") {
|
|
91
|
+
marko_web_magazine_publication_change_address_url_tag({
|
|
92
|
+
tag: null,
|
|
93
|
+
obj: issue.publication,
|
|
94
|
+
link: targetBlankLink,
|
|
95
|
+
renderBody: function(out) {
|
|
96
|
+
out.w(marko_escapeXml(i18n("Change Address")));
|
|
97
|
+
}
|
|
98
|
+
}, out, __component, "3" + $keyScope$0);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (button === "digital-edition") {
|
|
102
|
+
marko_web_magazine_issue_digital_edition_url_tag({
|
|
103
|
+
tag: null,
|
|
104
|
+
obj: issue,
|
|
105
|
+
link: targetBlankLink,
|
|
106
|
+
renderBody: function(out) {
|
|
107
|
+
out.w(marko_escapeXml(i18n("Digital Edition")));
|
|
108
|
+
}
|
|
109
|
+
}, out, __component, "4" + $keyScope$0);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (button === "pdf") {
|
|
113
|
+
marko_web_magazine_issue_pdf_url_tag({
|
|
114
|
+
tag: null,
|
|
115
|
+
obj: issue,
|
|
116
|
+
link: targetBlankLink,
|
|
117
|
+
renderBody: function(out) {
|
|
118
|
+
out.w(marko_escapeXml(i18n("Download PDF")));
|
|
119
|
+
}
|
|
120
|
+
}, out, __component, "5" + $keyScope$0);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (button === "archives") {
|
|
124
|
+
marko_web_magazine_publication_name_tag({
|
|
125
|
+
tag: null,
|
|
126
|
+
obj: issue.publication,
|
|
127
|
+
link: link,
|
|
128
|
+
renderBody: function(out) {
|
|
129
|
+
out.w(marko_escapeXml(i18n("Archives")));
|
|
130
|
+
}
|
|
131
|
+
}, out, __component, "6" + $keyScope$0);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (button === "reprints") {
|
|
135
|
+
marko_web_magazine_publication_reprints_url_tag({
|
|
136
|
+
tag: null,
|
|
137
|
+
obj: issue.publication,
|
|
138
|
+
link: targetBlankLink,
|
|
139
|
+
renderBody: function(out) {
|
|
140
|
+
out.w(marko_escapeXml(i18n("Reprints")));
|
|
141
|
+
}
|
|
142
|
+
}, out, __component, "7" + $keyScope$0);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (button === "e-inquiry") {
|
|
146
|
+
marko_web_magazine_publication_einquiry_url_tag({
|
|
147
|
+
tag: null,
|
|
148
|
+
obj: issue.publication,
|
|
149
|
+
link: targetBlankLink,
|
|
150
|
+
renderBody: function(out) {
|
|
151
|
+
out.w(marko_escapeXml(i18n("E-Inquiry")));
|
|
152
|
+
}
|
|
153
|
+
}, out, __component, "8" + $keyScope$0);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
marko_template._ = marko_renderer(render, {
|
|
159
|
+
d_: true,
|
|
160
|
+
e_: marko_componentType
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
marko_template.meta = {
|
|
164
|
+
id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/publication-buttons.marko",
|
|
165
|
+
tags: [
|
|
166
|
+
"@mindful-web/marko-web/components/element/magazine-publication/subscribe-url.marko",
|
|
167
|
+
"@mindful-web/marko-web/components/element/magazine-publication/renewal-url.marko",
|
|
168
|
+
"@mindful-web/marko-web/components/element/magazine-publication/cancel-url.marko",
|
|
169
|
+
"@mindful-web/marko-web/components/element/magazine-publication/change-address-url.marko",
|
|
170
|
+
"@mindful-web/marko-web/components/element/magazine-issue/digital-edition-url.marko",
|
|
171
|
+
"@mindful-web/marko-web/components/element/magazine-issue/pdf-url.marko",
|
|
172
|
+
"@mindful-web/marko-web/components/element/magazine-publication/name.marko",
|
|
173
|
+
"@mindful-web/marko-web/components/element/magazine-publication/reprints-url.marko",
|
|
174
|
+
"@mindful-web/marko-web/components/element/magazine-publication/einquiry-url.marko"
|
|
175
|
+
]
|
|
176
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getAsArray, getAsObject } from "@mindful-web/object-path";
|
|
2
|
+
import defaultValue from "@mindful-web/marko-core/utils/default-value";
|
|
3
|
+
|
|
4
|
+
$ const { site, i18n } = out.global;
|
|
5
|
+
$ const buttons = input.buttons || defaultValue(site.get("magazine.links"), ["subscribe", "digital-edition", "pdf", "archives", "change-address", "renewal", "cancel", "reprints", "e-inquiry"]);
|
|
6
|
+
|
|
7
|
+
$ const link = { class: "magazine-link" };
|
|
8
|
+
$ const targetBlankLink = {
|
|
9
|
+
...link,
|
|
10
|
+
target: "_blank"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
$ const issue = getAsObject(input, "issue");
|
|
14
|
+
|
|
15
|
+
<for|button| of=buttons>
|
|
16
|
+
<if(button === "subscribe")>
|
|
17
|
+
<marko-web-magazine-publication-subscribe-url tag=null obj=issue.publication link=targetBlankLink>
|
|
18
|
+
${i18n("Subscribe")}
|
|
19
|
+
</marko-web-magazine-publication-subscribe-url>
|
|
20
|
+
</if>
|
|
21
|
+
<if(button === "renewal")>
|
|
22
|
+
<marko-web-magazine-publication-renewal-url tag=null obj=issue.publication link=targetBlankLink>
|
|
23
|
+
${i18n("Renew")}
|
|
24
|
+
</marko-web-magazine-publication-renewal-url>
|
|
25
|
+
</if>
|
|
26
|
+
<if(button === "cancel")>
|
|
27
|
+
<marko-web-magazine-publication-cancel-url tag=null obj=issue.publication link=targetBlankLink>
|
|
28
|
+
${i18n("Cancel")}
|
|
29
|
+
</marko-web-magazine-publication-cancel-url>
|
|
30
|
+
</if>
|
|
31
|
+
<if(button === "change-address")>
|
|
32
|
+
<marko-web-magazine-publication-change-address-url tag=null obj=issue.publication link=targetBlankLink>
|
|
33
|
+
${i18n("Change Address")}
|
|
34
|
+
</marko-web-magazine-publication-change-address-url>
|
|
35
|
+
</if>
|
|
36
|
+
<if(button === "digital-edition")>
|
|
37
|
+
<marko-web-magazine-issue-digital-edition-url tag=null obj=issue link=targetBlankLink>
|
|
38
|
+
${i18n("Digital Edition")}
|
|
39
|
+
</marko-web-magazine-issue-digital-edition-url>
|
|
40
|
+
</if>
|
|
41
|
+
<if(button === "pdf")>
|
|
42
|
+
<marko-web-magazine-issue-pdf-url tag=null obj=issue link=targetBlankLink>
|
|
43
|
+
${i18n("Download PDF")}
|
|
44
|
+
</marko-web-magazine-issue-pdf-url>
|
|
45
|
+
</if>
|
|
46
|
+
<if(button === "archives")>
|
|
47
|
+
<marko-web-magazine-publication-name tag=null obj=issue.publication link=link>
|
|
48
|
+
${i18n("Archives")}
|
|
49
|
+
</marko-web-magazine-publication-name>
|
|
50
|
+
</if>
|
|
51
|
+
<if(button === "reprints")>
|
|
52
|
+
<marko-web-magazine-publication-reprints-url tag=null obj=issue.publication link=targetBlankLink>
|
|
53
|
+
${i18n("Reprints")}
|
|
54
|
+
</marko-web-magazine-publication-reprints-url>
|
|
55
|
+
</if>
|
|
56
|
+
<if(button === "e-inquiry")>
|
|
57
|
+
<marko-web-magazine-publication-einquiry-url tag=null obj=issue.publication link=targetBlankLink>
|
|
58
|
+
${i18n("E-Inquiry")}
|
|
59
|
+
</marko-web-magazine-publication-einquiry-url>
|
|
60
|
+
</if>
|
|
61
|
+
</for>
|