Skip to content

Commit

Permalink
adding the Kuenstler view html
Browse files Browse the repository at this point in the history
  • Loading branch information
fifthaccess committed May 2, 2022
1 parent 25824a7 commit 2fae40c
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#from addItemForm import AddItemForm
from controllers.index import index_blueprint
from controllers.manager import manager_blueprint
from controllers.kuenstler import kuenstler_blueprint
app = Flask(__name__)
app.secret_key = "fifth"

Expand All @@ -18,5 +19,6 @@

app.register_blueprint(index_blueprint)
app.register_blueprint(manager_blueprint)
app.register_blueprint(kuenstler_blueprint)
if __name__ == "__main__":
app.run(debug=True)
2 changes: 1 addition & 1 deletion controllers/kuenstler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def kuenstler_view():

kuenstler = session.query(Kuenstler).order_by(Kuenstler.KuenstlerId).all()

return render_template("manager/viewmanagers.html", managers = kuenstler, headline = "Kuenstler")
return render_template("kuenstler/viewKuenstler.html", kuenstlers = kuenstler, headline = "Kuenstler") # kuenstlers wird nur beutzt wegen dem identischen pural wie singular von kuenstler
4 changes: 2 additions & 2 deletions controllers/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ def manager_delete():
return render_template("manager/viewmanagers.html", managers = managers, headline = "Managers", form = del_form )
else:
print("invalide Form")
return render_template("manager/deleteManager.html", managers = managers, headline = "Delete Managers", form = del_form )
return render_template("manager/deletemanager.html", managers = managers, headline = "Delete Managers", form = del_form )

else:
return render_template("manager/deleteManager.html", managers = managers, headline = "Delete Managers", form = del_form )
return render_template("manager/deletemanager.html", managers = managers, headline = "Delete Managers", form = del_form )

@manager_blueprint.route('/managers/edit', methods=["Get", "Post"])
def manager_edit():
Expand Down
61 changes: 61 additions & 0 deletions templates/kuenstler/viewKuenstler.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{%extends 'base.html'%}

{%block body%}

<!--{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
{% for message in messages %}
{{ message }}
{% endfor %}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endif %}
{% endwith %}-->


<a class="nav-link dropdown-toggle" href="/products" id="navbarDropdownMenuLink" role="button"
data-bs-toggle="dropdown" aria-expanded="false">
Optionen
</a>

<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="/">Hauptseite</a></li>
<!-- <li><a class="dropdown-item" href="/managers">View Managers</a></li>
<li><a class="dropdown-item" href="/managers/add">Add Managers</a></li>
<li><a class="dropdown-item" href="/managers/delete">Delete Managers</a></li>
<li><a class="dropdown-item" href="/products/add">Hinzufügen</a></li>-->
</ul>

<table class="table">
<thead>
<tr>
<th scope="col">KuenstlerId</th>
<th scope="col">ManagerID</th>
<th scope="col">Vorname</th>
<th scope="col">Nachname</th>
<th scope="col">Herkunftsland</th>
<th scope="col">Gehalt</th>
<th scope="col">edit</th>
</tr>
</thead>
<tbody>

{% for kuenstler in kuenstlers %}
<tr>
<td>{{kuenstler.KuenstlerId}}</td>
<td>{{kuenstler.ManagerID}}</td>
<td>{{kuenstler.Vorname}}</td>
<td>{{kuenstler.Nachname}}</td>
<td>{{kuenstler.Herkunftsland}}</td>
<td>{{kuenstler.Gehalt}}</td>
<td><button class="btn btn-info " onclick= "window.location.href='/managers/edit?itemid={{kuenstler.KuenstlerId}}'">✏️</button></td>

</tr>
{% endfor %}


</tbody>
</table>

{%endblock%}

0 comments on commit 2fae40c

Please sign in to comment.