Revert "try new method"
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s

This reverts commit c6784759cd.
This commit is contained in:
pierre geeraert
2026-06-09 22:47:54 +01:00
parent c6784759cd
commit 4e6637aba9
+39 -19
View File
@@ -235,27 +235,47 @@
<li>Statistics</li>
<li>Great Support</li>
</ul>
<div class="schedule-updater" style="margin-top: 15px;">
<label for="schedule-{{ forloop.counter }}" style="display:block; font-size: 12px; margin-bottom: 5px;">Select Schedule:</label>
<a class="btn-price" href="#">Get This Plan</a>
<!-- Triggers a POST request to '/run-my-module/' without reloading -->
<!-- When clicked, 'Run Module' changes to 'Done!' -->
<button hx-post="{% url 'run_my_action_url' %}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
Run Module
</button>
<script>
function vote(kind) {
$.getJSON("/vote/", { pk:{ { object.pk }}, vote: kind }, function(json){
alert("Was successful?: " + json['success']);
});
}
function addClickHandlers() {
$("#upvote").click( function() { vote("up") });
$("#downvote").click( function() { vote("down") });
}
$(document).ready(addClickHandlers);
</script>
<select class="form-control" name="schedule_id" id="schedule-{{ forloop.counter }}">
{% for schedule in list_schedule %}
<option value="{{ schedule.id }}">{{ schedule.name }}</option>
{% endfor %}
</select>
<div id="resultarea"></div>
<div id="status-message"></div>
<select class="btn-price" name="cars" id="cars">
<button class="btn-price" style="margin-top: 10px; width: 100%;"
hx-post="{% url 'change_schedule' %}"
hx-include="#schedule-{{ forloop.counter }}"
hx-vals='{"server_name": "{{ server.1 }}"}'
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-target="#status-{{ forloop.counter }}"
hx-swap="innerHTML">
Update Schedule
</button>
</div>
<div id="status-{{ forloop.counter }}" style="margin-top: 10px; font-size: 13px; font-weight: bold;"></div>
{% for schedule in list_schedule %}
<tr>
<option value="{{ schedule }}">{{ schedule }}</option>
</tr>
{% endfor %}
</select>
<button class="btn-price" style="margin-top: 10px; width: 100%;"
hx-post="{% url 'change_schedule' %}"
hx-include="#schedule-{{ forloop.counter }}"
hx-vals='{"server_name": "{{ server.1 }}"}'
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-target="#status-{{ forloop.counter }}"
hx-swap="innerHTML">
Update Schedule
</button>
</div>
</div>
{% endfor %}
{% endblock %}