# SVN changeset patch # User jsalyrosas # Date 2013-05-22 20:02:54.133260 # Revision 183 - Habilitando la edicion del perfil y estandarizando el menu de perfiles. Index: trunk/webapp/abscontrol/urls.py =================================================================== diff --git a/trunk/webapp/abscontrol/urls.py b/trunk/webapp/abscontrol/urls.py --- a/trunk/webapp/abscontrol/urls.py (revision 182) +++ b/trunk/webapp/abscontrol/urls.py (revision 183) @@ -7,6 +7,7 @@ url(r'^view/(?P\d+)/$', 'view'), url(r'^edit/(?P\d+)/$', 'edit'), url(r'^update/(?P\d+)/$', 'update'), + url(r'^changeName/(?P\d+)/$', 'changeName'), #url(r'^(?P\d+)/$', 'detail'), url(r'^(?P\d+)/add/$', 'addPattern'), url(r'^(?P\d+)/save/$', 'savePattern'), Index: trunk/webapp/abscontrol/views.py =================================================================== diff --git a/trunk/webapp/abscontrol/views.py b/trunk/webapp/abscontrol/views.py --- a/trunk/webapp/abscontrol/views.py (revision 182) +++ b/trunk/webapp/abscontrol/views.py (revision 183) @@ -109,7 +109,25 @@ return redirect(newurl) def update(request, profile_id): - pass + txtProfile = request.POST["txtProfile"] + + objProfile = Profile.objects.get(pk=profile_id) + objProfile.name = txtProfile + objProfile.state = 1 + objProfile.save() + + newurl = '/abscontrol/view/%d' % objProfile.id + return redirect(newurl) + +def changeName(request, profile_id): + profile_list = Profile.objects.filter(state=1) + objProfile = Profile.objects.get(pk=profile_id) + lsPatterns = objProfile.pattern_set.all() + + return render_to_response('abscontrol/changeName.html', {'profile_list': profile_list, + 'objProfile': objProfile, + 'lsPatterns' : lsPatterns, + }) def view(request, profile_id): nextPattern = 0 @@ -276,6 +294,7 @@ return render_to_response('abscontrol/import.html', {'profile_list': profile_list,}) def showImport(request): + profile_list = Profile.objects.filter(state=1) if request.method == 'POST': txtFilename = request.FILES['txtFile'] if txtFilename: @@ -294,6 +313,7 @@ return render_to_response('abscontrol/upload-edit.html', {'txtFilename': txtFilename, 'patterns' : patterns, 'expName' : expName, 'num_patterns' : num_patterns, + 'profile_list': profile_list, }) def saveImport(request): Index: trunk/webapp/static/css/style.css =================================================================== diff --git a/trunk/webapp/static/css/style.css b/trunk/webapp/static/css/style.css --- a/trunk/webapp/static/css/style.css (revision 182) +++ b/trunk/webapp/static/css/style.css (revision 183) @@ -23,7 +23,8 @@ /****************************************************************************************/ .mnu{ height: 22px; border: 0px solid #c55 !important;} .mnu li{ display:inline;} -.MnuVertical, .MnuHorizontal { font-family: 'Droid Sans', sans-serif; font-size: 1.2em; font-style: italic; text-shadow: 2px 2px #eee} +.MnuVertical, .MnuHorizontal { font-family: 'Droid Sans', sans-serif; font-size: inherit; + font-style: normal; text-shadow: 2px 2px #eee;} .MnuHorizontal ul{ list-style: none; list-style-type: none; margin: 0;} /*.MnuHorizontal{ display: -webkit-box; -webkit-box-orient:horizontal;}*/ @@ -37,10 +38,12 @@ #infoProfiles label {padding: 10px 10px 10px 12px; margin: 10px 0} #infoProfiles select {padding: 4px 0px; margin: 0; font-family: 'Droid Sans', sans-serif; font-size: 12px; letter-spacing: 0.029em; width: 200px;} -#mnuProfiles{margin: 0px; border: 0px solid #1494F6 !important; float: left; padding: 2px 10px} +#mnuProfiles{margin: 0px 0px 0px 0px; border: 0px solid #1494F6 !important; float: right; padding: 2px 10px} #mnuProfiles ul{list-style: none; list-style-type: none; margin: 0; padding-left: 20px; border: 0px solid #f00 !important} #mnuProfiles li{ width: 80px; padding: 2px; border: 0px solid #c55 !important; float: left; } -#mnuProfiles a{ font-weight: normal; color: #1494F6; display: block; border: 0px solid #1cc !important; text-align: center} +#mnuProfiles a{ font-weight: normal; color: #1494F6; display: block; border: 0px solid #1cc !important; text-align: center; + border-bottom: 1px solid #1494F6 !important; text-decoration: none; padding: 0px 4px; + line-height: 18px; margin: 6px 6px;} /****************************************************************************************/ /******** FORMULARIO DE PERFILES *************************************/ Index: trunk/webapp/static/js/patterns.js =================================================================== diff --git a/trunk/webapp/static/js/patterns.js b/trunk/webapp/static/js/patterns.js --- a/trunk/webapp/static/js/patterns.js (revision 182) +++ b/trunk/webapp/static/js/patterns.js (revision 183) @@ -32,4 +32,7 @@ profile_id = $(this).attr("alt"); location.href = "/abscontrol/send/" + profile_id + "/"; }); + $('#lnkUpdateProfile').click(function(){ + $('#frmProfile').submit(); + }); }); \ No newline at end of file Index: trunk/webapp/static/js/profiles.js =================================================================== diff --git a/trunk/webapp/static/js/profiles.js b/trunk/webapp/static/js/profiles.js --- a/trunk/webapp/static/js/profiles.js (revision 182) +++ b/trunk/webapp/static/js/profiles.js (revision 183) @@ -20,6 +20,9 @@ $('#lnkSaveImport').click(function(){ $('#frmImportProfile').submit(); }); + $('#lnkUpload').click(function(){ + $('#frmImport').submit(); + }); $('#lnkExport').click(function(){ profile_id = $(this).attr("alt"); location.href="/abscontrol/export/" + profile_id + "/"; @@ -28,4 +31,7 @@ profile_id = $(this).attr("alt"); location.href="/abscontrol/send/" + profile_id + "/"; }); + $('#lnkChangeProfile').click(function(){ + $('#frmProfile').submit(); + }); }); \ No newline at end of file Index: trunk/webapp/templates/abscontrol/changeName.html =================================================================== diff --git a/trunk/webapp/templates/abscontrol/changeName.html b/trunk/webapp/templates/abscontrol/changeName.html new file mode 10644 --- /dev/null (revision 0) +++ b/trunk/webapp/templates/abscontrol/changeName.html (revision 183) @@ -0,0 +1,38 @@ +{% extends "abscontrol/index.html" %} +{% block title %}ABS CONTROL:::::NEW PROFILE{% endblock %} +{% block scripting %} + +{% endblock %} +{% block mnu_profile %} + +{% endblock %} +{% block maincolumn%} +
+
+
+ + +
+
+ +
+ +
+{% endblock %} Index: trunk/webapp/templates/abscontrol/edit.html =================================================================== diff --git a/trunk/webapp/templates/abscontrol/edit.html b/trunk/webapp/templates/abscontrol/edit.html --- a/trunk/webapp/templates/abscontrol/edit.html (revision 182) +++ b/trunk/webapp/templates/abscontrol/edit.html (revision 183) @@ -4,13 +4,13 @@ {% endblock %} {% block mnu_profile %} -