Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

small fixes from bug_526468 branch

  • Loading branch information...
commit 4beef88182933bf14c233daa4528c95f4baac881 1 parent 2eda785
@sergiocharpineljr sergiocharpineljr authored
View
7 ispdb/config/models.py
@@ -220,13 +220,13 @@ def __unicode__(self): return self.url
class EnableURLInst(models.Model):
+ instruction = models.TextField(
+ max_length=100,
+ verbose_name="Instruction")
language = models.CharField(
max_length=10,
verbose_name="Language",
choices=settings.LANGUAGES)
- instruction = models.CharField(
- max_length=100,
- verbose_name="Instruction")
enableurl = models.ForeignKey(EnableURL, related_name="instructions")
def __str__(self): return str(self.instruction)
@@ -487,6 +487,7 @@ class Meta:
def __init__(self, *args, **kwargs):
http_accept_language = kwargs.pop('http_accept_language', '')
super(EnableURLInstForm, self).__init__(*args, **kwargs)
+ self.fields['instruction'].widget.attrs.update({'rows': 2, 'cols': 20})
choices = []
# add HTTP_ACCEPTED_LANG first
if http_accept_language:
View
30 ispdb/fixtures/xml_testdata.json
@@ -63,7 +63,7 @@
"pk": 2,
"model": "config.docurldesc",
"fields": {
- "docurl": 1,
+ "docurl": 2,
"description": "test",
"language": "en"
}
@@ -72,7 +72,7 @@
"pk": 3,
"model": "config.docurldesc",
"fields": {
- "docurl": 1,
+ "docurl": 2,
"description": "test2",
"language": "fr"
}
@@ -93,5 +93,31 @@
"instruction": "test",
"language": "en"
}
+ },
+ {
+ "pk": 2,
+ "model": "config.enableurl",
+ "fields": {
+ "url": "http://test.com/",
+ "config": 1
+ }
+ },
+ {
+ "pk": 2,
+ "model": "config.enableurlinst",
+ "fields": {
+ "enableurl": 2,
+ "instruction": "test",
+ "language": "en"
+ }
+ },
+ {
+ "pk": 3,
+ "model": "config.enableurlinst",
+ "fields": {
+ "enableurl": 2,
+ "instruction": "test2",
+ "language": "fr"
+ }
}
]
View
3  ispdb/templates/config/details.html
@@ -282,8 +282,7 @@
{% for inst in enableurl.inst_formset %}
<table class="tab_inst">
<tr>
- <td>{{ inst.language.label }}:</td><td>{{ inst.language|data_verbose_field }}</td>
- <td>{{ inst.instruction.label }}:</td><td>{{ inst.instruction.value }}</td>
+ <td>{{ inst.instruction.label }}:</td><td>{{ inst.instruction.value }}</td><td> {{ inst.language|data_verbose_field }}</td>
</tr>
</table>
{% endfor %}
View
32 ispdb/templates/config/enter_config.html
@@ -100,12 +100,12 @@
var check = $('#id_'+prefix+'-DELETE');
if (check.val() == "True"){
check.val("False");
- $('#id_'+prefix+'-instruction').removeAttr("readonly");
+ $('#id_'+prefix+'-instruction').removeAttr("disabled");
$('#id_'+prefix+'-language').removeAttr("disabled");
$(this).text("Remove");
- }else{
+ } else {
check.val("True");
- $('#id_'+prefix+'-instruction').attr("readonly", "readonly");
+ $('#id_'+prefix+'-instruction').attr("disabled", "disabled");
$('#id_'+prefix+'-language').attr("disabled", "disabled");
$(this).text("Undo");
}
@@ -118,7 +118,7 @@
$('#id_'+prefix+'-url').removeAttr("readonly");
$(this).closest('tr').next().find('div').show();
$(this).text("Remove");
- }else{
+ } else {
check.val("True");
$('#id_'+prefix+'-url').attr("readonly", "readonly");
$(this).closest('tr').next().find('div').hide();
@@ -310,7 +310,7 @@
</table></div></td></td></tr>
{% endwith %}
</table>
-<textarea style="display:none" id="enableurl_template">
+<table style="display:none" id="enableurl_template">
{% with config_form.enableurl_formset.empty_form as form %}
<tr>
<th class="noborder">{{ form.url.label_tag }}:</th>
@@ -321,29 +321,29 @@
</td>
</tr>
{% endwith %}
-</textarea>
-<textarea style="display:none" id="inst_template">
+</table>
+<table style="display:none" id="inst_template">
{% with config_form.enableurl_formset.empty_inst_form as form %}
<tr>
<th>{{ form.instruction.label_tag }}:</th>
- <td>{{ form.language }}</td>
+ <td>{{ form.instruction }}</td>
<td>
- {{ form.instruction }}
+ {{ form.language }}
{{ form.DELETE }}
<a class="link delete inst" value="{1}-{0}">Remove</a>
</td>
</tr>
{% endwith %}
-</textarea>
-<textarea style="display:none" id="inst_full_template">
+</table>
+<table style="display:none" id="inst_full_template">
{% with config_form.enableurl_formset.empty_inst_form as form %}
<tr><td class="noborder"><td class="noborder"><div id="{1}"><table class="tab_insts">
<input type="hidden" name="{1}-TOTAL_FORMS" value="1" id="id_{1}-TOTAL_FORMS" /><input type="hidden" name="{1}-INITIAL_FORMS" value="0" id="{1}-INITIAL_FORMS" /><input type="hidden" name="{1}-MAX_NUM_FORMS" id="id_{1}-MAX_NUM_FORMS" />
<tr>
<th>{{ form.instruction.label_tag }}:</th>
- <td>{{ form.language }}</td>
+ <td>{{ form.instruction }}</td>
<td>
- {{ form.instruction }}
+ {{ form.language }}
{{ form.DELETE }}
<a class="link delete inst" value="{1}-{0}">Remove</a>
</td>
@@ -351,7 +351,7 @@
<tr><td><a class="link add_inst" value="{1}">add another instruction</a></td></tr>
</table></div></td></td></tr>
{% endwith %}
-</textarea>
+</table>
<form action="{{ callback }}" method="POST">{% csrf_token %}
@@ -497,9 +497,9 @@ <h3 class="hidden" id="problem">There are missing or incorrect values in the for
{{ inst_form.id }}
<tr>
<th>{{ inst_form.instruction.label_tag }}:</th>
- <td>{{ inst_form.language.errors }}{{ inst_form.language }}</td>
+ <td>{{ inst_form.instruction.errors }}{{ inst_form.instruction }}</td>
<td>
- {{ inst_form.instruction.errors }}{{ inst_form.instruction }}
+ {{ inst_form.language.errors }}{{ inst_form.language }}
{{ inst_form.DELETE }}
{% if inst_form.DELETE.value == "True" %}
<a class="link delete inst" value="{{inst_form.prefix}}">Undo</a>
View
3  ispdb/templates/config/show_issue.html
@@ -161,8 +161,7 @@
<table class="tab_inst">
{% for inst in enableurl.inst_formset %}
<tr>
- <td>{{ inst.language.label }}:</td><td>{{ inst.language|data_verbose_field }}</td>
- <td>{{ inst.instruction.label }}:</td><td>{{ inst.instruction.value }}</td>
+ <td>{{ inst.instruction.label }}:</td><td>{{ inst.instruction.value }}</td><td> {{ inst.language|data_verbose_field }}</td>
</tr>
{% endfor %}
</table>
Please sign in to comment.
Something went wrong with that request. Please try again.