@rmdes/indiekit-endpoint-microsub 1.0.0-beta.3 → 1.0.0-beta.4
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/lib/controllers/reader.js +6 -0
- package/package.json +1 -1
- package/views/channel-new.njk +3 -3
- package/views/channel.njk +2 -2
- package/views/compose.njk +3 -3
- package/views/item.njk +4 -4
- package/views/partials/actions.njk +3 -3
- package/views/partials/item-card.njk +1 -1
- package/views/reader.njk +3 -3
- package/views/settings.njk +3 -3
|
@@ -39,6 +39,7 @@ export async function channels(request, response) {
|
|
|
39
39
|
response.render("reader", {
|
|
40
40
|
title: request.__("microsub.reader.title"),
|
|
41
41
|
channels: channelList,
|
|
42
|
+
baseUrl: request.baseUrl,
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -50,6 +51,7 @@ export async function channels(request, response) {
|
|
|
50
51
|
export async function newChannel(request, response) {
|
|
51
52
|
response.render("channel-new", {
|
|
52
53
|
title: request.__("microsub.channels.new"),
|
|
54
|
+
baseUrl: request.baseUrl,
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -97,6 +99,7 @@ export async function channel(request, response) {
|
|
|
97
99
|
channel: channelDocument,
|
|
98
100
|
items: timeline.items,
|
|
99
101
|
paging: timeline.paging,
|
|
102
|
+
baseUrl: request.baseUrl,
|
|
100
103
|
});
|
|
101
104
|
}
|
|
102
105
|
|
|
@@ -120,6 +123,7 @@ export async function settings(request, response) {
|
|
|
120
123
|
channel: channelDocument.name,
|
|
121
124
|
}),
|
|
122
125
|
channel: channelDocument,
|
|
126
|
+
baseUrl: request.baseUrl,
|
|
123
127
|
});
|
|
124
128
|
}
|
|
125
129
|
|
|
@@ -175,6 +179,7 @@ export async function item(request, response) {
|
|
|
175
179
|
response.render("item", {
|
|
176
180
|
title: itemDocument.name || "Item",
|
|
177
181
|
item: itemDocument,
|
|
182
|
+
baseUrl: request.baseUrl,
|
|
178
183
|
});
|
|
179
184
|
}
|
|
180
185
|
|
|
@@ -191,6 +196,7 @@ export async function compose(request, response) {
|
|
|
191
196
|
replyTo,
|
|
192
197
|
likeOf,
|
|
193
198
|
repostOf,
|
|
199
|
+
baseUrl: request.baseUrl,
|
|
194
200
|
});
|
|
195
201
|
}
|
|
196
202
|
|
package/package.json
CHANGED
package/views/channel-new.njk
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
4
|
<div class="channel-new">
|
|
5
|
-
<a href="{{
|
|
5
|
+
<a href="{{ baseUrl }}/channels" class="back-link">
|
|
6
6
|
{{ icon("arrow-left") }} {{ __("microsub.channels.title") }}
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
-
<form method="post" action="{{
|
|
9
|
+
<form method="post" action="{{ baseUrl }}/channels/new">
|
|
10
10
|
{{ field({
|
|
11
11
|
label: {
|
|
12
12
|
text: __("microsub.channels.new")
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
{{ button({
|
|
25
25
|
text: __("microsub.channels.create")
|
|
26
26
|
}) }}
|
|
27
|
-
<a href="{{
|
|
27
|
+
<a href="{{ baseUrl }}/channels" class="button button--secondary">
|
|
28
28
|
{{ __("Cancel") }}
|
|
29
29
|
</a>
|
|
30
30
|
</div>
|
package/views/channel.njk
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
{% block content %}
|
|
4
4
|
<div class="channel">
|
|
5
5
|
<header class="channel__header">
|
|
6
|
-
<a href="{{
|
|
6
|
+
<a href="{{ baseUrl }}/channels" class="back-link">
|
|
7
7
|
{{ icon("arrow-left") }} {{ __("microsub.channels.title") }}
|
|
8
8
|
</a>
|
|
9
9
|
<div class="channel__actions">
|
|
10
|
-
<a href="{{
|
|
10
|
+
<a href="{{ baseUrl }}/channels/{{ channel.uid }}/settings" class="button button--secondary button--small">
|
|
11
11
|
{{ icon("settings") }} {{ __("microsub.channels.settings") }}
|
|
12
12
|
</a>
|
|
13
13
|
</div>
|
package/views/compose.njk
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
4
|
<div class="compose">
|
|
5
|
-
<a href="{{
|
|
5
|
+
<a href="{{ baseUrl }}/channels" class="back-link">
|
|
6
6
|
{{ icon("arrow-left") }} {{ __("Back") }}
|
|
7
7
|
</a>
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
{% endif %}
|
|
26
26
|
|
|
27
|
-
<form method="post" action="{{
|
|
27
|
+
<form method="post" action="{{ baseUrl }}/compose">
|
|
28
28
|
{% if replyTo %}
|
|
29
29
|
<input type="hidden" name="in-reply-to" value="{{ replyTo }}">
|
|
30
30
|
{% endif %}
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
{{ button({
|
|
53
53
|
text: __("microsub.compose.submit")
|
|
54
54
|
}) }}
|
|
55
|
-
<a href="{{
|
|
55
|
+
<a href="{{ baseUrl }}/channels" class="button button--secondary">
|
|
56
56
|
{{ __("microsub.compose.cancel") }}
|
|
57
57
|
</a>
|
|
58
58
|
</div>
|
package/views/item.njk
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
4
|
<article class="item">
|
|
5
|
-
<a href="{{
|
|
5
|
+
<a href="{{ baseUrl }}/channels" class="back-link">
|
|
6
6
|
{{ icon("arrow-left") }} {{ __("Back") }}
|
|
7
7
|
</a>
|
|
8
8
|
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
{% endif %}
|
|
69
69
|
|
|
70
70
|
<footer class="item__actions">
|
|
71
|
-
<a href="{{
|
|
71
|
+
<a href="{{ baseUrl }}/compose?replyTo={{ item.url | urlencode }}" class="button button--secondary button--small">
|
|
72
72
|
{{ icon("reply") }} {{ __("microsub.item.reply") }}
|
|
73
73
|
</a>
|
|
74
|
-
<a href="{{
|
|
74
|
+
<a href="{{ baseUrl }}/compose?likeOf={{ item.url | urlencode }}" class="button button--secondary button--small">
|
|
75
75
|
{{ icon("heart") }} {{ __("microsub.item.like") }}
|
|
76
76
|
</a>
|
|
77
|
-
<a href="{{
|
|
77
|
+
<a href="{{ baseUrl }}/compose?repostOf={{ item.url | urlencode }}" class="button button--secondary button--small">
|
|
78
78
|
{{ icon("repost") }} {{ __("microsub.item.repost") }}
|
|
79
79
|
</a>
|
|
80
80
|
<a href="{{ item.url }}" class="button button--secondary button--small" target="_blank" rel="noopener">
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{# Item action buttons #}
|
|
2
2
|
<div class="item-actions">
|
|
3
|
-
<a href="{{
|
|
3
|
+
<a href="{{ baseUrl }}/compose?replyTo={{ itemUrl | urlencode }}" class="item-actions__button" title="{{ __('microsub.item.reply') }}">
|
|
4
4
|
{{ icon("reply") }}
|
|
5
5
|
</a>
|
|
6
|
-
<a href="{{
|
|
6
|
+
<a href="{{ baseUrl }}/compose?likeOf={{ itemUrl | urlencode }}" class="item-actions__button" title="{{ __('microsub.item.like') }}">
|
|
7
7
|
{{ icon("heart") }}
|
|
8
8
|
</a>
|
|
9
|
-
<a href="{{
|
|
9
|
+
<a href="{{ baseUrl }}/compose?repostOf={{ itemUrl | urlencode }}" class="item-actions__button" title="{{ __('microsub.item.repost') }}">
|
|
10
10
|
{{ icon("repost") }}
|
|
11
11
|
</a>
|
|
12
12
|
<a href="{{ itemUrl }}" class="item-actions__button" target="_blank" rel="noopener" title="{{ __('microsub.item.viewOriginal') }}">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Item card for timeline display #}
|
|
2
2
|
<article class="item-card{% if item._is_read %} item-card--read{% endif %}">
|
|
3
|
-
<a href="{{
|
|
3
|
+
<a href="{{ baseUrl }}/item/{{ item.uid }}" class="item-card__link">
|
|
4
4
|
{% if item.author %}
|
|
5
5
|
<div class="item-card__author">
|
|
6
6
|
{% if item.author.photo %}
|
package/views/reader.njk
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<ul class="reader__channels">
|
|
7
7
|
{% for channel in channels %}
|
|
8
8
|
<li class="reader__channel">
|
|
9
|
-
<a href="{{
|
|
9
|
+
<a href="{{ baseUrl }}/channels/{{ channel.uid }}" class="reader__channel-link">
|
|
10
10
|
<span class="reader__channel-name">
|
|
11
11
|
{% if channel.uid === "notifications" %}
|
|
12
12
|
{{ icon("bell") }}
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
{% endfor %}
|
|
22
22
|
</ul>
|
|
23
23
|
<p class="reader__actions">
|
|
24
|
-
<a href="{{
|
|
24
|
+
<a href="{{ baseUrl }}/channels/new" class="button button--secondary">
|
|
25
25
|
{{ icon("plus") }} {{ __("microsub.channels.new") }}
|
|
26
26
|
</a>
|
|
27
27
|
</p>
|
|
28
28
|
{% else %}
|
|
29
29
|
{{ prose({ text: __("microsub.channels.empty") }) }}
|
|
30
30
|
<p>
|
|
31
|
-
<a href="{{
|
|
31
|
+
<a href="{{ baseUrl }}/channels/new" class="button button--primary">
|
|
32
32
|
{{ __("microsub.channels.new") }}
|
|
33
33
|
</a>
|
|
34
34
|
</p>
|
package/views/settings.njk
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
4
|
<div class="settings">
|
|
5
|
-
<a href="{{
|
|
5
|
+
<a href="{{ baseUrl }}/channels/{{ channel.uid }}" class="back-link">
|
|
6
6
|
{{ icon("arrow-left") }} {{ channel.name }}
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
-
<form method="post" action="{{
|
|
9
|
+
<form method="post" action="{{ baseUrl }}/channels/{{ channel.uid }}/settings">
|
|
10
10
|
{{ fieldset({
|
|
11
11
|
legend: {
|
|
12
12
|
text: __("microsub.settings.excludeTypes"),
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
{{ button({
|
|
73
73
|
text: __("microsub.settings.save")
|
|
74
74
|
}) }}
|
|
75
|
-
<a href="{{
|
|
75
|
+
<a href="{{ baseUrl }}/channels/{{ channel.uid }}" class="button button--secondary">
|
|
76
76
|
{{ __("Cancel") }}
|
|
77
77
|
</a>
|
|
78
78
|
</div>
|