mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
lots of cleanup and refactoring
This commit is contained in:
@@ -13,22 +13,19 @@
|
||||
|
||||
<h3>{% trans 'Edit' %} {{ title }}</h3>
|
||||
|
||||
{% if form.Meta.model|get_class == 'Storage' %} <!-- TODO make one include for this text block -->
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h4 class="alert-heading"><i class="far fa-exclamation-triangle"></i> {% trans 'Security Warning' %}</h4>
|
||||
<p>{% blocktrans %}
|
||||
The <b>Password and Token</b> field are stored as <b>plain text</b> inside the database.
|
||||
This is necessary because they are needed to make API requests, but it also increases the risk of someone stealing it. <br/>
|
||||
To limit the possible damage use read only tokens or accounts if available or create separate accounts with limited access (only to recipes).
|
||||
{% endblocktrans %}</p>
|
||||
</div>
|
||||
{% if form.Meta.model|get_class == 'Storage' %}
|
||||
{% include 'include/storage_backend_warning.html' %}
|
||||
{% endif %}
|
||||
|
||||
<form action="." method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Submit" class="btn btn-success">
|
||||
<a href="{% url 'redirect_delete' form.instance|get_class|lower form.instance.pk %}" class="btn btn-danger">{% trans 'Delete' %}</a>
|
||||
<a href="{% url 'redirect_delete' form.instance|get_class|lower form.instance.pk %}"
|
||||
class="btn btn-danger">{% trans 'Delete' %}</a>
|
||||
{% if view_url %}
|
||||
<a href="{{ view_url }}" class="btn btn-info">{% trans 'View' %} <i class="far fa-eye"></i></a>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
{% render_table table %}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -13,15 +13,8 @@
|
||||
|
||||
<h3>{% trans 'New' %} {{ title }} </h3>
|
||||
|
||||
{% if form.Meta.model|get_class == 'Storage' %} <!-- TODO make one include for this text block -->
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h4 class="alert-heading"><i class="far fa-exclamation-triangle"></i> {% trans 'Security Warning' %}</h4>
|
||||
<p>{% blocktrans %}
|
||||
The <b>Password and Token</b> field are stored as <b>plain text</b> inside the database.
|
||||
This is necessary because they are needed to make API requests, but it also increases the risk of someone stealing it. <br/>
|
||||
To limit the possible damage use read only tokens or accounts if available or create separate accounts with limited access (only to recipes).
|
||||
{% endblocktrans %}</p>
|
||||
</div>
|
||||
{% if form.Meta.model|get_class == 'Storage' %}
|
||||
{% include 'include/storage_backend_warning.html' %}
|
||||
{% endif %}
|
||||
|
||||
<form action="." method="post">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
{% load django_tables2 %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
|
||||
<div class="table-container">
|
||||
{% block table %}
|
||||
<table {% render_attrs table.attrs class="table" %}>
|
||||
|
||||
Reference in New Issue
Block a user