Created
February 3, 2012 10:32
-
-
Save anonymous/1729568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript" | |
src="/medias/jquery-1.2.6.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
$("#driver1").click(function(event) { | |
// click : temperature de selection, propriete, reference | |
$.getJSON("/run_DHM/", {'topic': $("#topic").val(), 'propriete': $("#driver").val(), 'reference': $("#ref").val() }, function(data) { | |
$("td.min").html(data['val_min']); | |
$("td.max").html(data['val_max']); | |
}); // getjson | |
}); // click | |
}); | |
</script> | |
</head> | |
<div id="content"> | |
<body bgcolor="F7FBFA"> | |
{% if object.get_physical_properties %} | |
<ul> | |
<TT> <strong><font size="4" color="black">Materiau : </font></strong><font size="4" color="red"> <strong>{{ object }}</strong></font></TT> | |
{% for prop in object.get_physical_properties|slice:":1" %} | |
<TT> {{ prop.name.description|linebreaks }}</TT> | |
{% endfor %} | |
{% for prop in object.get_physical_properties %} | |
{% ifchanged prop.nature_unit %} {# test unique sur le changement de propriete avec la precedente #} | |
<thead> | |
<p style=background-color:PowderBlue;> <TT><font size="4" color="black"><strong> {{prop.nature_unit}} </strong></font></TT></p> | |
</thead> | |
{% for media in object.get_medias %} | |
{% ifequal prop.nature_unit media.nature %} {# test l'egalite sur la propriete #} | |
<a href="{{ media.source.url }}">{{ media.name }} {{ media.get_format_display }}</a> | |
{% endifequal %} | |
{% endfor %} | |
<table width="100%" border="1" style="border: 0.5px;" cellspacing="0" cellpadding="0" > | |
<div> | |
<tr bgcolor="dddddd"> | |
<td width="160" <TT><strong>Propriete </strong></TT></td> | |
<td width="120" <TT><strong>Temperature </strong></TT></td> | |
<td width="120" <TT><strong>Valeur min </strong></TT></td> | |
<td width="120" <TT><strong>Valeur max</strong></TT></td> | |
<td width="120" <TT><strong>Unite</strong></TT></td> | |
<td width="160" <TT><strong>Reference</strong></TT></td> | |
</tr> | |
<tr> | |
{# test si un lien dynamique est associe a la propriete #} | |
{% ifequal prop.val_champ prop.lien %} | |
<form action= "/run_DHM/" method="POST"> | |
{% ifequal prop.val_champ "durete Vickers___ " %} | |
<td width="160" <TT><INPUT type="text" value="{{prop.val_champ}}" id= "driver1" name="propriete" /></TT> | |
</td> | |
<td width="120"<TT><select name="topic" id= "topic"></TT> | |
<optgroup label="degres"> | |
<option selected="selected" value="0">-- select --</option> | |
<option value="100">100</option> | |
<option value="200">200</option> | |
<option value="300">300</option> | |
<option value="400">400</option> | |
<option value="500">500</option> | |
</optgroup> | |
</select> | |
</td> | |
<td class= "min" width="120" <TT> {{prop.val1}}</TT> </td> | |
<td class= "max" width="120" <TT> {{prop.val2}}</TT> </td> | |
<td width="120" <TT> {{ prop.val_unit }} </TT></td> | |
<td width="160" <TT><INPUT type="text" value= "{{ object }}" id= "ref" name="reference"/></TT></td> | |
{% endifequal %} | |
</form> | |
{% else %} {# pas de lien dynamique #} | |
<td class= "neo1" width="160" <TT>{{ prop.val_champ}} </TT></td> | |
<td class= "neo2" width="120" <TT>-</TT> </span> | |
<td class= "neo3" width="120" <TT> {{ prop.val1 }}</TT> </td> | |
<td class= "neo4" width="120" <TT> {{ prop.val2 }}</TT> </td> | |
<td class= "neo5" width="120" <TT> {{ prop.val_unit }} </TT></td> | |
<td class= "neo6" width="160" <TT>-</TT> </td> | |
{% endifequal %} | |
</tr> | |
</div> | |
</table> | |
{% else %} {# test unique sur le changement de propriete avec la precedente #} | |
<table width="100%" border="1" style="border: 0.5px;" cellspacing="0" cellpadding="0" > | |
<div> | |
<tr> | |
{% ifequal prop.val_champ prop.lien %} | |
<form action= "/run_DHM/" method="POST"> | |
{% ifequal prop.val_champ "durete Vickers___" %} | |
<td width="160" <TT><INPUT type="text" value="{{prop.val_champ}}" id= "driver1" name="propriete" /></TT> | |
</td> | |
<td width="120"<TT><select name="topic" id= "topic"></TT> | |
<optgroup label="degres"> | |
<option selected="selected" value="0">-- select --</option> | |
<option value="100">100</option> | |
<option value="200">200</option> | |
<option value="300">300</option> | |
<option value="400">400</option> | |
<option value="500">500</option> | |
</optgroup> | |
</select> | |
</td> | |
<td class= "min" width="120" <TT> {{prop.val1}} </TT> </td> | |
<td class= "max" width="120" <TT> {{prop.val2}} </TT> </td> | |
<td width="120" <TT> {{ prop.val_unit }} </TT></td> | |
<td width="160" <TT><INPUT type="text" value= "{{ object }}" id= "ref" name="reference"/></TT></td> | |
{% endifequal %} | |
</form> | |
{% else %} {# pas de lien dynamique #} | |
<td class= "neo1" width="160" <TT>{{ prop.val_champ}} </TT></td> | |
<td class= "neo2" width="120" <TT>-</TT> </span> | |
<td class= "neo3" width="120" <TT> {{ prop.val1 }}</TT> </td> | |
<td class= "neo4" width="120" <TT> {{ prop.val2 }}</TT> </td> | |
<td class= "neo5" width="120" <TT> {{ prop.val_unit }} </TT></td> | |
<td class= "neo6" width="160" <TT>-</TT> </td> | |
{% endifequal %} | |
</tr> | |
</div> | |
</table> | |
{% endifchanged %} | |
{% endfor %} | |
</ul> | |
<a href="javascript:history.go(-1)">Retour liste</a> | | |
<a href="{% url edition_media object.pk %}">Edition du formulaire medias </a> | <a href="{% url edition object.id %}">Edition du formulaire general </a> | |
|<a href="{% url delete object.id %}">Supression des donnees materiau </a> | |
{% else %} | |
<font size="3" color="black">aucune donnee materiau...</font> | |
<a href="{% url edition object.pk %}">Edition du formulaire general </a> | <a href="{% url delete object.id %}">Supression des donnees materiau </a> | | |
<a href="javascript:history.go(-1)">Retour liste </a> | |
{#<a href="{% url record %}">Insertion donnees</a> | #} | |
{% endif %} | |
</div> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment