##// END OF EJS Templates
- Habilitando la edicion del perfil y estandarizando el menu de perfiles.
jsalyrosas -
r182:183
parent child
Show More
@@ -0,0 +1,38
1 {% extends "abscontrol/index.html" %}
2 {% block title %}ABS CONTROL:::::NEW PROFILE{% endblock %}
3 {% block scripting %}
4 <script src="/static/static/js/profiles.js"></script>
5 {% endblock %}
6 {% block mnu_profile %}
7 <nav class="MnuHorizontal" id="mnuProfiles">
8 <ul>
9 <li><a href="#" id="lnkChangeProfile">Save</a></li>
10 <li><a href="/abscontrol/edit/{{ objProfile.id }}/">Cancel</a></li>
11 </ul>
12 </nav>
13 {% endblock %}
14 {% block maincolumn%}
15 <div id="maincolumn">
16 <form action="/abscontrol/update/{{ objProfile.id }}/" method="post" id="frmProfile">
17 <div id="divProfile">
18 <label for="lblName">Profile: {{ profile_name }}</label>
19 <input type="text" name="txtProfile" value="{{ objProfile.name }}"/>
20 </div>
21 <div class="cleardivs"></div>
22 <input type="hidden" name="mode" value="e">
23 </form>
24 <div id="navPatterns">
25 <nav class="" id="navPatternList">
26 <ul>
27 {% for element in lsPatterns %}
28 {% if patternChoosen.id == element.id %}
29 <li><a href="/abscontrol/{{ objProfile.id }}/edit/{{ element.id }}" class="lnkPatternSelected">{{ element.value }}</a></li>
30 {% else %}
31 <li><a href="/abscontrol/{{ objProfile.id }}/edit/{{ element.id }}" class="lnkPattern">{{ element.value }}</a></li>
32 {% endif %}
33 {% endfor %}
34 </ul>
35 </nav>
36 </div>
37 </div>
38 {% endblock %}
@@ -7,6 +7,7
7 7 url(r'^view/(?P<profile_id>\d+)/$', 'view'),
8 8 url(r'^edit/(?P<profile_id>\d+)/$', 'edit'),
9 9 url(r'^update/(?P<profile_id>\d+)/$', 'update'),
10 url(r'^changeName/(?P<profile_id>\d+)/$', 'changeName'),
10 11 #url(r'^(?P<profile_id>\d+)/$', 'detail'),
11 12 url(r'^(?P<profile_id>\d+)/add/$', 'addPattern'),
12 13 url(r'^(?P<profile_id>\d+)/save/$', 'savePattern'),
@@ -109,7 +109,25
109 109 return redirect(newurl)
110 110
111 111 def update(request, profile_id):
112 pass
112 txtProfile = request.POST["txtProfile"]
113
114 objProfile = Profile.objects.get(pk=profile_id)
115 objProfile.name = txtProfile
116 objProfile.state = 1
117 objProfile.save()
118
119 newurl = '/abscontrol/view/%d' % objProfile.id
120 return redirect(newurl)
121
122 def changeName(request, profile_id):
123 profile_list = Profile.objects.filter(state=1)
124 objProfile = Profile.objects.get(pk=profile_id)
125 lsPatterns = objProfile.pattern_set.all()
126
127 return render_to_response('abscontrol/changeName.html', {'profile_list': profile_list,
128 'objProfile': objProfile,
129 'lsPatterns' : lsPatterns,
130 })
113 131
114 132 def view(request, profile_id):
115 133 nextPattern = 0
@@ -276,6 +294,7
276 294 return render_to_response('abscontrol/import.html', {'profile_list': profile_list,})
277 295
278 296 def showImport(request):
297 profile_list = Profile.objects.filter(state=1)
279 298 if request.method == 'POST':
280 299 txtFilename = request.FILES['txtFile']
281 300 if txtFilename:
@@ -294,6 +313,7
294 313
295 314 return render_to_response('abscontrol/upload-edit.html', {'txtFilename': txtFilename, 'patterns' : patterns,
296 315 'expName' : expName, 'num_patterns' : num_patterns,
316 'profile_list': profile_list,
297 317 })
298 318
299 319 def saveImport(request):
@@ -23,7 +23,8
23 23 /****************************************************************************************/
24 24 .mnu{ height: 22px; border: 0px solid #c55 !important;}
25 25 .mnu li{ display:inline;}
26 .MnuVertical, .MnuHorizontal { font-family: 'Droid Sans', sans-serif; font-size: 1.2em; font-style: italic; text-shadow: 2px 2px #eee}
26 .MnuVertical, .MnuHorizontal { font-family: 'Droid Sans', sans-serif; font-size: inherit;
27 font-style: normal; text-shadow: 2px 2px #eee;}
27 28 .MnuHorizontal ul{ list-style: none; list-style-type: none; margin: 0;}
28 29
29 30 /*.MnuHorizontal{ display: -webkit-box; -webkit-box-orient:horizontal;}*/
@@ -37,10 +38,12
37 38 #infoProfiles label {padding: 10px 10px 10px 12px; margin: 10px 0}
38 39 #infoProfiles select {padding: 4px 0px; margin: 0; font-family: 'Droid Sans', sans-serif;
39 40 font-size: 12px; letter-spacing: 0.029em; width: 200px;}
40 #mnuProfiles{margin: 0px; border: 0px solid #1494F6 !important; float: left; padding: 2px 10px}
41 #mnuProfiles{margin: 0px 0px 0px 0px; border: 0px solid #1494F6 !important; float: right; padding: 2px 10px}
41 42 #mnuProfiles ul{list-style: none; list-style-type: none; margin: 0; padding-left: 20px; border: 0px solid #f00 !important}
42 43 #mnuProfiles li{ width: 80px; padding: 2px; border: 0px solid #c55 !important; float: left; }
43 #mnuProfiles a{ font-weight: normal; color: #1494F6; display: block; border: 0px solid #1cc !important; text-align: center}
44 #mnuProfiles a{ font-weight: normal; color: #1494F6; display: block; border: 0px solid #1cc !important; text-align: center;
45 border-bottom: 1px solid #1494F6 !important; text-decoration: none; padding: 0px 4px;
46 line-height: 18px; margin: 6px 6px;}
44 47
45 48 /****************************************************************************************/
46 49 /******** FORMULARIO DE PERFILES *************************************/
@@ -32,4 +32,7
32 32 profile_id = $(this).attr("alt");
33 33 location.href = "/abscontrol/send/" + profile_id + "/";
34 34 });
35 $('#lnkUpdateProfile').click(function(){
36 $('#frmProfile').submit();
37 });
35 38 }); No newline at end of file
@@ -20,6 +20,9
20 20 $('#lnkSaveImport').click(function(){
21 21 $('#frmImportProfile').submit();
22 22 });
23 $('#lnkUpload').click(function(){
24 $('#frmImport').submit();
25 });
23 26 $('#lnkExport').click(function(){
24 27 profile_id = $(this).attr("alt");
25 28 location.href="/abscontrol/export/" + profile_id + "/";
@@ -28,4 +31,7
28 31 profile_id = $(this).attr("alt");
29 32 location.href="/abscontrol/send/" + profile_id + "/";
30 33 });
34 $('#lnkChangeProfile').click(function(){
35 $('#frmProfile').submit();
36 });
31 37 }); No newline at end of file
@@ -4,13 +4,13
4 4 <script src="/static/static/js/patterns.js"></script>
5 5 {% endblock %}
6 6 {% block mnu_profile %}
7 <nav class="MnuVertical" id="mnuProfiles">
7 <nav class="MnuHorizontal" id="mnuProfiles">
8 8 <ul>
9 9 <li><a href="/abscontrol/new/">New</a></li>
10 10 {% if objProfile.state == 0 %}
11 <li><a href="/abscontrol/update/{{ objProfile.id }}/?opt=changeName">Save</a></li>
11 <li><a href="/abscontrol/changeName/{{ objProfile.id }}/">Save</a></li>
12 12 {% else %}
13 <li><a href="/abscontrol/update/{{ objProfile.id }}/?opt=update">Save</a></li>
13 <li><a href="#" id="lnkUpdateProfile">Save</a></li>
14 14 {% endif %}
15 15 <li><a href="#">Save as</a></li>
16 16 <li><a href="/abscontrol/import/">Import</a></li>
@@ -22,10 +22,19
22 22 {% endblock %}
23 23 {% block maincolumn%}
24 24 <div id="maincolumn">
25 {% if objProfile.state == 1 %}
26 <form action="/abscontrol/update/{{ objProfile.id }}/" method="post" id="frmProfile">
25 27 <div id="divProfile">
26 28 <label for="lblName">Profile:</label>
27 <label for="lblProfile">{{ objProfile.name }}</label>
29 <input type="text" name="txtProfile" value="{{ objProfile.name }}"/>
28 30 </div>
31 <input type="hidden" name="mode" value="e">
32 </form>
33 {% else %}
34 <div id="divProfile">
35 <label for="lblName">Profile: {{ objProfile.name }}</label>
36 </div>
37 {% endif %}
29 38 {% if patternChoosen %}
30 39 <div id="navPatterns">
31 40 <nav class="" id="navPatternList">
@@ -1,14 +1,21
1 1 {% extends "abscontrol/index.html" %}
2 2 {% block title %}ABS CONTROL:::::IMPORT PROFILE{% endblock %}
3 3
4 {% block mnu_profile %}
5 <nav class="MnuHorizontal" id="mnuProfiles">
6 <ul>
7 <li><a href="#" id="lnkUpload">Upload</a></li>
8 <li><a href="#" id="lnkCancel">Cancel</a></li>
9 </ul>
10 </nav>
11 {% endblock %}
4 12 {% block maincolumn %}
5 13 <div id="maincolumn">
6 <form action="/abscontrol/showImport/" method="post" enctype="multipart/form-data">
14 <form name="frmImport" id="frmImport" action="/abscontrol/showImport/" method="post" enctype="multipart/form-data">
7 15 <div id="divPattern">
8 16 <div class="divUes">
9 17 <label for="lblFile">Choose File:</label>
10 18 <input type="file" name="txtFile" />
11 <input type="submit" name="btnSend" value="Upload" />
12 19 </div>
13 20 </div>
14 21 </form>
@@ -35,7 +35,7
35 35 </div>
36 36 {% block mnu_profile %}
37 37 <div id="mnuProfiles">
38 <nav class="MnuVertical" id="navProfiles">
38 <nav class="MnuHorizontal" id="navProfiles">
39 39 <ul>
40 40 <li><a href="/abscontrol/new">New</a></li>
41 41 {% if objProfile %}
@@ -4,7 +4,7
4 4 <script src="/static/static/js/profiles.js"></script>
5 5 {% endblock %}
6 6 {% block mnu_profile %}
7 <nav class="MnuVertical" id="mnuProfiles">
7 <nav class="MnuHorizontal" id="mnuProfiles">
8 8 <ul>
9 9 <li><a href="/abscontrol/new">New</a></li>
10 10 <li><a href="#" id="lnkSaveImport">Save</a></li>
@@ -2,7 +2,7
2 2 {% block title %}ABS CONTROL:::::IMPORT PROFILE{% endblock %}
3 3
4 4 {% block mnu_profile %}
5 <nav class="MnuVertical" id="mnuProfiles">
5 <nav class="MnuHorizontal" id="mnuProfiles">
6 6 <ul>
7 7 <li><a href="/abscontrol/new">New</a></li>
8 8 <li><a href="#">Save</a></li>
@@ -2,7 +2,7
2 2 {% block title %}ABS CONTROL:::PROFILE:::{{ objProfile.name }}{% endblock %}
3 3
4 4 {% block mnu_profile %}
5 <nav class="MnuVertical" id="mnuProfiles">
5 <nav class="MnuHorizontal" id="mnuProfiles">
6 6 <ul>
7 7 <li><a href="/abscontrol/new">New</a></li>
8 8 {% if patternChoosen %}
@@ -19,10 +19,12
19 19 {% endblock %}
20 20 {% block maincolumn%}
21 21 <div id="maincolumn">
22 {% if objProfile.state == 0 %}
22 23 <div id="divProfile">
23 24 <label for="lblName">Profile:</label>
24 25 <label for="lblProfile">{{ objProfile.name }}</label>
25 26 </div>
27 {% endif %}
26 28 {% if patternChoosen %}
27 29 <div id="navPatterns">
28 30 <nav class="" id="navPatternList">
General Comments 0
You need to be logged in to leave comments. Login now