summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coip/apps/name/forms.py4
-rw-r--r--templates/apps/name/edit.html13
-rw-r--r--templates/edit_fieldsets_tabs.html45
3 files changed, 49 insertions, 13 deletions
diff --git a/coip/apps/name/forms.py b/coip/apps/name/forms.py
index d1fed90..0e77a22 100644
--- a/coip/apps/name/forms.py
+++ b/coip/apps/name/forms.py
@@ -26,11 +26,11 @@ class NameEditForm(BetterModelForm):
widgets = {'description': forms.Textarea(attrs={'cols': 62, 'rows': 6}),
'short': forms.TextInput(attrs={'size': 40})}
fieldsets = [('step1', {'fields': ['short', 'description'],
- 'legend': 'Step 1: Describe your group',
+ 'legend': 'Name and Description',
'classes': ['step'],
'description': 'Provide a short and (optionally) longer description of your group.'}),
('step2', {'fields': ['format'],
- 'legend': 'Step 2: (optional): Advanced options',
+ 'legend': 'Advanced',
'classes': ['step','submit_step'],
'description': 'Only change these settings if you know what you are doing.'})
]
diff --git a/templates/apps/name/edit.html b/templates/apps/name/edit.html
index d963048..80177c1 100644
--- a/templates/apps/name/edit.html
+++ b/templates/apps/name/edit.html
@@ -1,15 +1,6 @@
-{% extends "edit_fieldsets.html" %}
+{% extends "edit_fieldsets_tabs.html" %}
{% block widgets %}
$('#id_expires').datepicker({'dateFormat': 'yy-mm-dd','timeFormat': 'hh:ii:ss'});
$('#id_description').wysiwyg();
- $('#wizard').formwizard({
- validationEnabled: true,
- focusFirstInput: true,
- textSubmit: "Finish",
- validationOptions: {
- rules: {
- short: 'required'
- }
- }
- });
+ $('#tabs').tabs();
{% endblock %} \ No newline at end of file
diff --git a/templates/edit_fieldsets_tabs.html b/templates/edit_fieldsets_tabs.html
new file mode 100644
index 0000000..04f7a69
--- /dev/null
+++ b/templates/edit_fieldsets_tabs.html
@@ -0,0 +1,45 @@
+{% extends "tree.html" %}
+{% block widgets %}{% endblock %}
+{% block content %}
+ {% block beforeform %}
+ {% endblock %}
+ <h2>{{formtitle}}</h2>
+
+ <form method="POST">
+ {% if form.non_field_errors %}{{ form.non_field_errors }}{% endif %}
+ <div id="tabs">
+ <ul>
+ {% for fieldset in form.fieldsets %}
+ <li><a href="#{{fieldset.name}}">{{fieldset.legend}}</a></li>
+ {% endfor %}
+ </ul>
+ {% for fieldset in form.fieldsets %}
+ <div class="fieldset" id="{{fieldset.name}}">
+ {% if fieldset.description %}
+ <p class="description">{{ fieldset.description }}</p>
+ {% endif %}
+ <ul class="inputs">
+ {% for field in fieldset %}
+ {% if field.is_hidden %}
+ {{ field }}
+ {% else %}
+ <li class="inputs {% if field.field.required %}required{% endif %}" {{ field.row_attrs }}>
+ {{ field.errors }}
+ <label for="id_{{ field.html_name }}" class="fieldlabel">{{ field.label }}
+ {% if field.field.required %}<b>*</b>{% endif %}</label>
+ <div class="fieldinput">{{ field }}</div>
+ </li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+ </div>
+ {% endfor %}
+ </div>
+ <ul class="ilist" style="padding-bottom: 30px; padding-top: 10px; padding-left: 0px;">
+ <li class="button left"><input type="submit" value="Update"/></li>
+ {% if name %}
+ <li class="button right"><input type="button" onClick="document.location='{{name.url}}'" value="Cancel"/></li>
+ {% endif %}
+ </ul>
+ </form>
+{% endblock %} \ No newline at end of file