You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example the TITLE will be the h2 text of the formset that will contain all the fields on the array.
12
+
The description is an optional text to be displayed after the TITLE.
13
+
The FIELD_NAME will be the names of the fields of your form, this is required.
14
+
GRID_NUMBER will be the grid (1-12) space that will fill your field in the Bootstrap row, if omitted the space will be 0.
15
+
Lastly, the VALUE_DICT refers to a dictionary that will tell your field when can be visible, if omitted the field will always be visible.
16
+
IMPORTANT: if you miss a field on the `bootstrap_field_info` it will set to not required.
17
+
18
+
An important feature of this form, is the use of the TypeHead lib for autocomplete CharFields, so the user has already some possible answers.
19
+
This can be done by adding the `api_fields` .
20
+
This information is stored in the `api_fields` to the Meta class inside your form, where the API url is required. Other optional fields are `restrict` and
21
+
`others` field to restrict the options of the field or add the Others option. For example, in this application,
22
+
it has been used to list all the possible countries and avoid custom answers.
It's important to notice that all the text that will be printed out is surrounded by a low bash and parentheses. In
53
82
future versions, this will allow to translate the displayed text in an easy way.
54
83
55
84
```python
56
85
label = _('How old are you?')
57
86
```
87
+
88
+
## TabsViewMixin
89
+
90
+
This is a simple Mixin to display Tab navigation on your TemplateView or any View class that inherits this class.
91
+
The navigation tabs are the navigation that is displayed on top of your template container.
92
+
93
+
### Methods
94
+
95
+
#### get_current_tabs
96
+
This method is meant to be overridden and return an array to be with tuples. The first element of the tuple will be the text of the tab and the second will be the url, those 2 are mandatory.
97
+
The 3rd is and optional variable that can be set to None to be omitted and displays a warning symbol.
98
+
Finally, the 4th variable is to set the tab to active with a boolean, if None or unset the tab will be active if the path equals the url.
99
+
Data can be passed to the method with the `get_context_data` kwargs at the super of your view.
100
+
101
+
#### get_back_url
102
+
Method that returns the url that will be updated to the context with the name `back`.
103
+
104
+
## PermissionRequiredMixin
105
+
This Mixin is mean to inherit any type of View class and expands the base [Django PermissionRequiredMixin](https://docs.djangoproject.com/en/4.1/topics/auth/default/#the-permissionrequiredmixin-mixin) class.
106
+
The new functionality is that you can put a dictionary on the `permission_required` in order to change the permissions between the HTTP method: GET, POST, etc.
<p>{% blocktrans %}This is the main application of {{ app_hack }}. From here you can apply as all the possible roles and participate to {{ app_hack }}.{% endblocktrans %}</p>
8
-
{% if not accepted_application %}
9
-
<p>{% blocktrans %}All the applications are reviewed by the organizing team, please be patient if your application is still on review.{% endblocktrans %}</p>
{% if application_type.user_instance and application_type.user_instance.invited %}
15
-
<divclass="list-group-item list-group-item-{{ application_type.user_instance.get_public_status_color|default:theme }} {% if not application_type.user_instance and not application_type.active %}disabled{% endif %}">
<astyle="flex: inherit" href="{% url 'change_status_application' application_type.user_instance.get_uuid application_type.user_instance.STATUS_CANCELLED %}" onclick="return confirm('{% trans 'Are you sure you want to cancel this application?' %}')" class="btn btn-danger col-4">{% trans 'Cancel application' %}</a>
<astyle="flex: inherit" href="{% url 'change_status_application' application_type.user_instance.get_uuid application_type.user_instance.STATUS_CONFIRMED %}" onclick="return confirm('{% blocktrans %}Your {{ application_type }} invitation will be confirmed. This means that all your other applications will be cancelled. Are you sure you want to confirm this one?{% endblocktrans %}')" class="btn btn-primary col-4">{% trans 'Confirm invitation' %}</a>
29
-
</div>
30
-
</div>
31
-
{% else %}
32
-
<ahref="{% if application_type.user_instance %}{% url 'edit_application' application_type.user_instance.get_uuid %}{% elif application_type.active %}{% url 'apply' %}?type={{ application_type.name }}{% endif %}" class="list-group-item list-group-item-action list-group-item-{{ application_type.user_instance.get_public_status_color|default:theme }} {% if not application_type.user_instance and not application_type.active %}disabled{% endif %}">
<ahref="{% url 'change_status_application' accepted_application.get_uuid accepted_application.STATUS_CANCELLED %}" onclick="return confirm('{% trans 'Are you sure you want to cancel this application? You will lose your invitation.' %}')" class="btn btn-danger col-4">{% trans 'Cancel application' %}</a>
0 commit comments