mirror of
https://github.com/StefBuwalda/WebTech.git
synced 2025-10-30 03:10:00 +00:00
123123123
This commit is contained in:
@@ -6,27 +6,35 @@
|
||||
<div class="grid-container">
|
||||
{% for service in services%}
|
||||
<div class="bg-light container-xxl">
|
||||
<div class="row" onclick="location.href='{{service.url}}';" style="cursor: pointer;" >
|
||||
<div class="row" onclick="location.href='{{service.url}}';" style="cursor: pointer;">
|
||||
Name: {{service["name"]}} <br>
|
||||
URL: {{service["url"]}}
|
||||
</div>
|
||||
<div class="dots dropdown">
|
||||
<button class="btn btn-light" type="button" id="threeDotDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<button class="btn btn-light" type="button" id="threeDotDropdown" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
⋮
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="threeDotDropdown">
|
||||
<li><a class="dropdown-item">Edit</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item">Edit</a>
|
||||
<form action="{{ url_for('dash.edit_service', service_id=service.id) }}" method="POST"
|
||||
style="display:inline;">
|
||||
<button type="submit" class="dropdown-item">Update</button>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form action="{{ url_for('dash.delete_item', service_id=service.id) }}" method="POST" style="display:inline;">
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li>
|
||||
<form action="{{ url_for('dash.delete_item', service_id=service.id) }}" method="POST"
|
||||
style="display:inline;">
|
||||
<button type="submit" class="dropdown-item">Delete</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{%endblock%}
|
||||
|
||||
{%endblock%}
|
||||
9
application/dash/templates/edit_service.html
Normal file
9
application/dash/templates/edit_service.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends 'base_template.html' %}
|
||||
|
||||
{% block title %}
|
||||
Add service
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
123
|
||||
{% endblock %}
|
||||
@@ -54,3 +54,13 @@ def service():
|
||||
return render_template(
|
||||
"add_service.html", form=service_form, active_page="service"
|
||||
)
|
||||
|
||||
|
||||
@dash_blueprint.route("/edit_service/<int:service_id>", methods=["POST"])
|
||||
@login_required
|
||||
def edit_service(service_id: int):
|
||||
service = Service.query.get_or_404(service_id)
|
||||
if current_user.id != service.user_id:
|
||||
redirect(url_for("dash.index"))
|
||||
|
||||
return render_template("edit_service.html")
|
||||
|
||||
Reference in New Issue
Block a user