@@ -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 | url(r'^view/(?P<profile_id>\d+)/$', 'view'), |
|
7 | url(r'^view/(?P<profile_id>\d+)/$', 'view'), | |
8 | url(r'^edit/(?P<profile_id>\d+)/$', 'edit'), |
|
8 | url(r'^edit/(?P<profile_id>\d+)/$', 'edit'), | |
9 | url(r'^update/(?P<profile_id>\d+)/$', 'update'), |
|
9 | url(r'^update/(?P<profile_id>\d+)/$', 'update'), | |
|
10 | url(r'^changeName/(?P<profile_id>\d+)/$', 'changeName'), | |||
10 | #url(r'^(?P<profile_id>\d+)/$', 'detail'), |
|
11 | #url(r'^(?P<profile_id>\d+)/$', 'detail'), | |
11 | url(r'^(?P<profile_id>\d+)/add/$', 'addPattern'), |
|
12 | url(r'^(?P<profile_id>\d+)/add/$', 'addPattern'), | |
12 | url(r'^(?P<profile_id>\d+)/save/$', 'savePattern'), |
|
13 | url(r'^(?P<profile_id>\d+)/save/$', 'savePattern'), |
@@ -109,7 +109,25 | |||||
109 | return redirect(newurl) |
|
109 | return redirect(newurl) | |
110 |
|
110 | |||
111 | def update(request, profile_id): |
|
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 | def view(request, profile_id): |
|
132 | def view(request, profile_id): | |
115 | nextPattern = 0 |
|
133 | nextPattern = 0 | |
@@ -276,6 +294,7 | |||||
276 | return render_to_response('abscontrol/import.html', {'profile_list': profile_list,}) |
|
294 | return render_to_response('abscontrol/import.html', {'profile_list': profile_list,}) | |
277 |
|
295 | |||
278 | def showImport(request): |
|
296 | def showImport(request): | |
|
297 | profile_list = Profile.objects.filter(state=1) | |||
279 | if request.method == 'POST': |
|
298 | if request.method == 'POST': | |
280 | txtFilename = request.FILES['txtFile'] |
|
299 | txtFilename = request.FILES['txtFile'] | |
281 | if txtFilename: |
|
300 | if txtFilename: | |
@@ -294,6 +313,7 | |||||
294 |
|
313 | |||
295 | return render_to_response('abscontrol/upload-edit.html', {'txtFilename': txtFilename, 'patterns' : patterns, |
|
314 | return render_to_response('abscontrol/upload-edit.html', {'txtFilename': txtFilename, 'patterns' : patterns, | |
296 | 'expName' : expName, 'num_patterns' : num_patterns, |
|
315 | 'expName' : expName, 'num_patterns' : num_patterns, | |
|
316 | 'profile_list': profile_list, | |||
297 | }) |
|
317 | }) | |
298 |
|
318 | |||
299 | def saveImport(request): |
|
319 | def saveImport(request): |
@@ -23,7 +23,8 | |||||
23 | /****************************************************************************************/ |
|
23 | /****************************************************************************************/ | |
24 | .mnu{ height: 22px; border: 0px solid #c55 !important;} |
|
24 | .mnu{ height: 22px; border: 0px solid #c55 !important;} | |
25 | .mnu li{ display:inline;} |
|
25 | .mnu li{ display:inline;} | |
26 |
.MnuVertical, .MnuHorizontal { font-family: 'Droid Sans', sans-serif; font-size: |
|
26 | .MnuVertical, .MnuHorizontal { font-family: 'Droid Sans', sans-serif; font-size: inherit; | |
|
27 | font-style: normal; text-shadow: 2px 2px #eee;} | |||
27 | .MnuHorizontal ul{ list-style: none; list-style-type: none; margin: 0;} |
|
28 | .MnuHorizontal ul{ list-style: none; list-style-type: none; margin: 0;} | |
28 |
|
29 | |||
29 | /*.MnuHorizontal{ display: -webkit-box; -webkit-box-orient:horizontal;}*/ |
|
30 | /*.MnuHorizontal{ display: -webkit-box; -webkit-box-orient:horizontal;}*/ | |
@@ -37,10 +38,12 | |||||
37 | #infoProfiles label {padding: 10px 10px 10px 12px; margin: 10px 0} |
|
38 | #infoProfiles label {padding: 10px 10px 10px 12px; margin: 10px 0} | |
38 | #infoProfiles select {padding: 4px 0px; margin: 0; font-family: 'Droid Sans', sans-serif; |
|
39 | #infoProfiles select {padding: 4px 0px; margin: 0; font-family: 'Droid Sans', sans-serif; | |
39 | font-size: 12px; letter-spacing: 0.029em; width: 200px;} |
|
40 | font-size: 12px; letter-spacing: 0.029em; width: 200px;} | |
40 |
#mnuProfiles{margin: 0px; border: 0px solid #1494F6 !important; float: |
|
41 | #mnuProfiles{margin: 0px 0px 0px 0px; border: 0px solid #1494F6 !important; float: right; padding: 2px 10px} | |
41 | #mnuProfiles ul{list-style: none; list-style-type: none; margin: 0; padding-left: 20px; border: 0px solid #f00 !important} |
|
42 | #mnuProfiles ul{list-style: none; list-style-type: none; margin: 0; padding-left: 20px; border: 0px solid #f00 !important} | |
42 | #mnuProfiles li{ width: 80px; padding: 2px; border: 0px solid #c55 !important; float: left; } |
|
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 | /******** FORMULARIO DE PERFILES *************************************/ |
|
49 | /******** FORMULARIO DE PERFILES *************************************/ |
@@ -32,4 +32,7 | |||||
32 | profile_id = $(this).attr("alt"); |
|
32 | profile_id = $(this).attr("alt"); | |
33 | location.href = "/abscontrol/send/" + profile_id + "/"; |
|
33 | location.href = "/abscontrol/send/" + profile_id + "/"; | |
34 | }); |
|
34 | }); | |
|
35 | $('#lnkUpdateProfile').click(function(){ | |||
|
36 | $('#frmProfile').submit(); | |||
|
37 | }); | |||
35 | }); No newline at end of file |
|
38 | }); |
@@ -20,6 +20,9 | |||||
20 | $('#lnkSaveImport').click(function(){ |
|
20 | $('#lnkSaveImport').click(function(){ | |
21 | $('#frmImportProfile').submit(); |
|
21 | $('#frmImportProfile').submit(); | |
22 | }); |
|
22 | }); | |
|
23 | $('#lnkUpload').click(function(){ | |||
|
24 | $('#frmImport').submit(); | |||
|
25 | }); | |||
23 | $('#lnkExport').click(function(){ |
|
26 | $('#lnkExport').click(function(){ | |
24 | profile_id = $(this).attr("alt"); |
|
27 | profile_id = $(this).attr("alt"); | |
25 | location.href="/abscontrol/export/" + profile_id + "/"; |
|
28 | location.href="/abscontrol/export/" + profile_id + "/"; | |
@@ -28,4 +31,7 | |||||
28 | profile_id = $(this).attr("alt"); |
|
31 | profile_id = $(this).attr("alt"); | |
29 | location.href="/abscontrol/send/" + profile_id + "/"; |
|
32 | location.href="/abscontrol/send/" + profile_id + "/"; | |
30 | }); |
|
33 | }); | |
|
34 | $('#lnkChangeProfile').click(function(){ | |||
|
35 | $('#frmProfile').submit(); | |||
|
36 | }); | |||
31 | }); No newline at end of file |
|
37 | }); |
@@ -4,13 +4,13 | |||||
4 | <script src="/static/static/js/patterns.js"></script> |
|
4 | <script src="/static/static/js/patterns.js"></script> | |
5 | {% endblock %} |
|
5 | {% endblock %} | |
6 | {% block mnu_profile %} |
|
6 | {% block mnu_profile %} | |
7 |
<nav class="Mnu |
|
7 | <nav class="MnuHorizontal" id="mnuProfiles"> | |
8 | <ul> |
|
8 | <ul> | |
9 | <li><a href="/abscontrol/new/">New</a></li> |
|
9 | <li><a href="/abscontrol/new/">New</a></li> | |
10 | {% if objProfile.state == 0 %} |
|
10 | {% if objProfile.state == 0 %} | |
11 |
<li><a href="/abscontrol/ |
|
11 | <li><a href="/abscontrol/changeName/{{ objProfile.id }}/">Save</a></li> | |
12 | {% else %} |
|
12 | {% else %} | |
13 |
<li><a href=" |
|
13 | <li><a href="#" id="lnkUpdateProfile">Save</a></li> | |
14 | {% endif %} |
|
14 | {% endif %} | |
15 | <li><a href="#">Save as</a></li> |
|
15 | <li><a href="#">Save as</a></li> | |
16 | <li><a href="/abscontrol/import/">Import</a></li> |
|
16 | <li><a href="/abscontrol/import/">Import</a></li> | |
@@ -22,10 +22,19 | |||||
22 | {% endblock %} |
|
22 | {% endblock %} | |
23 | {% block maincolumn%} |
|
23 | {% block maincolumn%} | |
24 | <div id="maincolumn"> |
|
24 | <div id="maincolumn"> | |
|
25 | {% if objProfile.state == 1 %} | |||
|
26 | <form action="/abscontrol/update/{{ objProfile.id }}/" method="post" id="frmProfile"> | |||
25 | <div id="divProfile"> |
|
27 | <div id="divProfile"> | |
26 | <label for="lblName">Profile:</label> |
|
28 | <label for="lblName">Profile:</label> | |
27 |
< |
|
29 | <input type="text" name="txtProfile" value="{{ objProfile.name }}"/> | |
28 | </div> |
|
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 | {% if patternChoosen %} |
|
38 | {% if patternChoosen %} | |
30 | <div id="navPatterns"> |
|
39 | <div id="navPatterns"> | |
31 | <nav class="" id="navPatternList"> |
|
40 | <nav class="" id="navPatternList"> |
@@ -1,14 +1,21 | |||||
1 | {% extends "abscontrol/index.html" %} |
|
1 | {% extends "abscontrol/index.html" %} | |
2 | {% block title %}ABS CONTROL:::::IMPORT PROFILE{% endblock %} |
|
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 | {% block maincolumn %} |
|
12 | {% block maincolumn %} | |
5 | <div id="maincolumn"> |
|
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 | <div id="divPattern"> |
|
15 | <div id="divPattern"> | |
8 | <div class="divUes"> |
|
16 | <div class="divUes"> | |
9 | <label for="lblFile">Choose File:</label> |
|
17 | <label for="lblFile">Choose File:</label> | |
10 | <input type="file" name="txtFile" /> |
|
18 | <input type="file" name="txtFile" /> | |
11 | <input type="submit" name="btnSend" value="Upload" /> |
|
|||
12 | </div> |
|
19 | </div> | |
13 | </div> |
|
20 | </div> | |
14 | </form> |
|
21 | </form> |
@@ -35,7 +35,7 | |||||
35 | </div> |
|
35 | </div> | |
36 | {% block mnu_profile %} |
|
36 | {% block mnu_profile %} | |
37 | <div id="mnuProfiles"> |
|
37 | <div id="mnuProfiles"> | |
38 |
<nav class="Mnu |
|
38 | <nav class="MnuHorizontal" id="navProfiles"> | |
39 | <ul> |
|
39 | <ul> | |
40 | <li><a href="/abscontrol/new">New</a></li> |
|
40 | <li><a href="/abscontrol/new">New</a></li> | |
41 | {% if objProfile %} |
|
41 | {% if objProfile %} |
@@ -4,7 +4,7 | |||||
4 | <script src="/static/static/js/profiles.js"></script> |
|
4 | <script src="/static/static/js/profiles.js"></script> | |
5 | {% endblock %} |
|
5 | {% endblock %} | |
6 | {% block mnu_profile %} |
|
6 | {% block mnu_profile %} | |
7 |
<nav class="Mnu |
|
7 | <nav class="MnuHorizontal" id="mnuProfiles"> | |
8 | <ul> |
|
8 | <ul> | |
9 | <li><a href="/abscontrol/new">New</a></li> |
|
9 | <li><a href="/abscontrol/new">New</a></li> | |
10 | <li><a href="#" id="lnkSaveImport">Save</a></li> |
|
10 | <li><a href="#" id="lnkSaveImport">Save</a></li> |
@@ -2,7 +2,7 | |||||
2 | {% block title %}ABS CONTROL:::::IMPORT PROFILE{% endblock %} |
|
2 | {% block title %}ABS CONTROL:::::IMPORT PROFILE{% endblock %} | |
3 |
|
3 | |||
4 | {% block mnu_profile %} |
|
4 | {% block mnu_profile %} | |
5 |
<nav class="Mnu |
|
5 | <nav class="MnuHorizontal" id="mnuProfiles"> | |
6 | <ul> |
|
6 | <ul> | |
7 | <li><a href="/abscontrol/new">New</a></li> |
|
7 | <li><a href="/abscontrol/new">New</a></li> | |
8 | <li><a href="#">Save</a></li> |
|
8 | <li><a href="#">Save</a></li> |
@@ -2,7 +2,7 | |||||
2 | {% block title %}ABS CONTROL:::PROFILE:::{{ objProfile.name }}{% endblock %} |
|
2 | {% block title %}ABS CONTROL:::PROFILE:::{{ objProfile.name }}{% endblock %} | |
3 |
|
3 | |||
4 | {% block mnu_profile %} |
|
4 | {% block mnu_profile %} | |
5 |
<nav class="Mnu |
|
5 | <nav class="MnuHorizontal" id="mnuProfiles"> | |
6 | <ul> |
|
6 | <ul> | |
7 | <li><a href="/abscontrol/new">New</a></li> |
|
7 | <li><a href="/abscontrol/new">New</a></li> | |
8 | {% if patternChoosen %} |
|
8 | {% if patternChoosen %} | |
@@ -19,10 +19,12 | |||||
19 | {% endblock %} |
|
19 | {% endblock %} | |
20 | {% block maincolumn%} |
|
20 | {% block maincolumn%} | |
21 | <div id="maincolumn"> |
|
21 | <div id="maincolumn"> | |
|
22 | {% if objProfile.state == 0 %} | |||
22 | <div id="divProfile"> |
|
23 | <div id="divProfile"> | |
23 | <label for="lblName">Profile:</label> |
|
24 | <label for="lblName">Profile:</label> | |
24 | <label for="lblProfile">{{ objProfile.name }}</label> |
|
25 | <label for="lblProfile">{{ objProfile.name }}</label> | |
25 | </div> |
|
26 | </div> | |
|
27 | {% endif %} | |||
26 | {% if patternChoosen %} |
|
28 | {% if patternChoosen %} | |
27 | <div id="navPatterns"> |
|
29 | <div id="navPatterns"> | |
28 | <nav class="" id="navPatternList"> |
|
30 | <nav class="" id="navPatternList"> |
General Comments 0
You need to be logged in to leave comments.
Login now