summaryrefslogtreecommitdiff
path: root/sysret.org/themes/tabi-lean/templates/partials/iine_button.html
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2025-09-13 15:01:06 -0600
committerAlejandro Soto <alejandro@34project.org>2025-09-13 15:01:06 -0600
commitf4fcda54638685899c730b3fa90a87d80d6dbef5 (patch)
tree0737e627cce304c3a9c4e757bc5f6571a7456091 /sysret.org/themes/tabi-lean/templates/partials/iine_button.html
parentd8b9cf1f61cc07d625f1c37ccc28adfd58918416 (diff)
parent2c13119932765c6d788f08fb53abc244407c0d80 (diff)
Merge commit '6a7d3111b31e73fc66af5360149d41f690fbcaa4'
Diffstat (limited to 'sysret.org/themes/tabi-lean/templates/partials/iine_button.html')
-rw-r--r--sysret.org/themes/tabi-lean/templates/partials/iine_button.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/sysret.org/themes/tabi-lean/templates/partials/iine_button.html b/sysret.org/themes/tabi-lean/templates/partials/iine_button.html
new file mode 100644
index 0000000..508fd3a
--- /dev/null
+++ b/sysret.org/themes/tabi-lean/templates/partials/iine_button.html
@@ -0,0 +1,33 @@
+{% import "macros/settings.html" as macros_settings %}
+{%- set button_icon = button_icon | default(value=macros_settings::evaluate_setting_priority(setting="iine_icon", page=page | default(value=""), section=section | default(value=""), default_global_value="heart")) -%}
+{%- if config.extra.iine_unified_languages and lang != config.default_language -%}
+ {%- set unified_slug = page.path | replace(from='/' ~ lang ~ '/', to='/') -%}
+ {%- set slug = slug | default(value=unified_slug) -%}
+{%- else -%}
+ {%- set slug = slug | default(value=page.path) -%}
+{%- endif -%}
+{%- if label -%}
+ {%- set final_label = label -%}
+{%- elif language_strings -%}
+ {%- set final_label = macros_translate::translate(key="like_this_post", default="Like this post", language_strings=language_strings) -%}
+{%- else -%}
+ {%- set final_label = "Like this post" -%}
+{%- endif -%}
+
+{%- if button_icon == "heart" -%}
+ {%- set icon_display = "♥️" -%}
+{%- elif button_icon == "thumbs_up" -%}
+ {%- set icon_display = "👍" -%}
+{%- elif button_icon == "upvote" -%}
+ {%- set icon_display = "⬆️" -%}
+{%- else -%}
+ {%- set icon_display = button_icon -%}
+{%- endif -%}
+
+<form method="post" action="https://vhiweeypifbwacashxjz.supabase.co/rest/v1/rpc/increment_hits?apikey=sb_publishable_EoB7MFJhCmb6PiAk-GPJ4w_PGhQ44Ru" class="iine-form">
+ <input type="hidden" name="page_slug" value="{%- if slug -%}{{ slug }}{%- else -%}{{ current_url | default(value=page.path) }}{%- endif -%}">
+ <button class="iine-button" type="submit"
+ {%- if slug %} data-slug="{{ slug }}"{% endif %}
+ {%- if button_icon %} data-icon="{{ button_icon }}"{% endif %}
+ aria-label="{{ final_label }}" title="{{ final_label }}">{{ icon_display }}</button>
+</form>