@@ -95,48 +95,74 @@ <h2 class="h5 mb-1" style="font-size: 1.125rem">
95
95
</ p >
96
96
{% endif %}
97
97
98
- {% set next = loop.index if not loop.last else loop.index - 1 -%}
98
+ {% set next_index = loop.index if not loop.last else loop.index - 1 -%}
99
+ {% set next = url_for('.entries', **request.args) + '#entry-' + (next_index|string) %}
99
100
< form action ="{{ url_for('.mark_as') }} " method ="post "
100
- hx-post ="{{ url_for('.mark_as') }} "
101
+ hx-target ="closest form "
102
+
101
103
class ="my-2 ">
102
104
{#- TODO: aria stuff #}
103
105
{% block entry_form scoped %}
104
106
105
107
< button type ="submit " name ="read "
106
108
value ="{{ 'false' if entry.read else 'true' }} "
109
+ hx-post ="{{ url_for('.mark_as') }} "
110
+ hx-disabled-elt ="this "
107
111
class ="btn btn-outline-secondary btn-sm{% if entry.read %} active{% endif %} "
108
112
{% if entry.read -%}
109
113
aria-pressed ="true "
110
114
{% endif -%}
111
115
style ="width: 4rem ">
112
- < i class ="bi {{
116
+
117
+ < i class ="label bi {{
113
118
'bi-check-circle-fill' if entry.read is true else 'bi-check-lg'
114
119
}} "> </ i >
120
+
121
+ < div class ="spinner-border htmx-indicator " role ="status " style ="width: 0.875rem; height: 0.875rem; ">
122
+ < span class ="visually-hidden "> loading...</ span >
123
+ </ div >
124
+
115
125
</ button >
116
126
117
127
< div class ="btn-group " role ="group " aria-label ="importance ">
118
128
< button type ="submit " name ="important "
119
129
value ="{{ 'none' if entry.important is true else 'true' }} "
130
+ hx-post ="{{ url_for('.mark_as') }} "
131
+ hx-disabled-elt ="this, next button "
120
132
class ="btn btn-outline-secondary btn-sm {% if entry.important is true %} active{% endif %} "
121
133
{% if entry.important is true -%}
122
134
aria-pressed ="true "
123
135
{% endif -%}
124
136
style ="width: 2rem ">
125
- < i class ="bi {{
137
+
138
+ < i class ="label bi {{
126
139
'bi-star-fill' if entry.important is true else 'bi-star'
127
140
}} "> </ i >
141
+
142
+ < div class ="spinner-border htmx-indicator " role ="status " style ="width: 0.875rem; height: 0.875rem; ">
143
+ < span class ="visually-hidden "> loading...</ span >
144
+ </ div >
145
+
128
146
</ button >
129
147
130
148
< button type ="submit " name ="important "
131
149
value ="{{ 'none' if entry.important is false else 'false' }} "
150
+ hx-post ="{{ url_for('.mark_as') }} "
151
+ hx-disabled-elt ="this, previous button "
132
152
class ="btn btn-outline-secondary btn-sm {% if entry.important is false %} active{% endif %} "
133
153
{% if entry.important is false -%}
134
154
aria-pressed ="true "
135
155
{% endif -%}
136
156
style ="width: 2rem ">
137
- < i class ="bi {{
157
+
158
+ < i class ="label bi {{
138
159
'bi-arrow-down-circle-fill' if entry.important is false else 'bi-arrow-down'
139
160
}} "> </ i >
161
+
162
+ < div class ="spinner-border htmx-indicator " role ="status " style ="width: 0.875rem; height: 0.875rem; ">
163
+ < span class ="visually-hidden "> loading...</ span >
164
+ </ div >
165
+
140
166
</ button >
141
167
</ div >
142
168
@@ -152,11 +178,7 @@ <h2 class="h5 mb-1" style="font-size: 1.125rem">
152
178
153
179
< input type ="hidden " name ="feed-url " value ="{{ entry.feed_url }} ">
154
180
< input type ="hidden " name ="entry-id " value ="{{ entry.id }} ">
155
-
156
- {% if next -%}
157
- < input type ="hidden " name ="next "
158
- value ="{{ url_for('.entries', **request.args) }}#entry-{{ next }} ">
159
- {%- endif %}
181
+ < input type ="hidden " name ="next " value ="{{ next }} ">
160
182
161
183
{% endblock %}
162
184
</ form >
0 commit comments