Conjunto de cambios beac5e8 en consulta_publica para base


Ignorar:
Fecha y hora:
22/03/2017 15:53:09 (hace 7 años)
Autor:
Antonio Araujo <aaraujo@…>
Branches:
master, base, constituyente, estudiantes, general, plan_patria, sala
Children:
81b0915
Parents:
bae8490 (diferencia), 95b08c1 (diferencia)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Mensaje:

Merge branch 'master' of https://planificacion.cenditel.gob.ve/scm/git/consulta_publica

Ubicación:
base
Ficheros:
3 editados

Leyenda

No modificado
Añadido
Eliminado
  • base/functions.py

    rb2927f0 rbae8490  
    8282    tuplaNameEntity = ('', 'Seleccione...'),
    8383    uniqueEntities = []
    84     index = 0
     84    nidEntities = []
    8585
    8686    for dicc in data:
    8787        tmpEntity = dicc['name_ente']
    88         if tmpEntity not in uniqueEntities:
    89             uniqueEntities.append(dicc['name_ente'])
     88        tmpNidEntity = dicc['nid']
     89        if  tmpEntity.startswith('Ministerio') and  tmpEntity not in uniqueEntities:
     90            uniqueEntities.append(tmpEntity)
     91            nidEntities.append(tmpNidEntity)
    9092        else:
    9193            continue
    92     for item in uniqueEntities:
    93         if ( item.startswith('Ministerio') ):
    94             tuplaNameEntity += (index+1, item),
     94
     95    for i in range(0, len(uniqueEntities)) :
     96        tuplaNameEntity += (nidEntities[i], uniqueEntities[i]),
    9597
    9698    return tuplaNameEntity
     
    120122    tuplaSector = ('', 'Seleccione...'),
    121123    uniqueSectors = []
    122     index = 0
     124    nidEntities = []
    123125
    124126    for dicc in data:
    125127        tmpSector = dicc['sector']
    126         if tmpSector not in uniqueSectors:
    127             uniqueSectors.append(dicc['sector'])
     128        tmpNidEntity = dicc['nid']
     129        if tmpSector.startswith('Vicepresidencia') and tmpSector not in uniqueSectors:
     130            uniqueSectors.append(tmpSector)
     131            nidEntities.append(tmpNidEntity)
    128132        else:
    129133            continue
    130     for item in uniqueSectors:
    131         if ( item.startswith('Vicepresidencia') ):
    132             tuplaSector += (index+1, item),
     134
     135    for i in range(0, len(uniqueSectors)) :
     136        tuplaSector += (nidEntities[i], uniqueSectors[i]),
    133137
    134138    return tuplaSector
     
    141145    @author Antonio Araujo (aaraujo at cenditel.gob.ve)
    142146    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
    143     @date 15-03-2017
     147    @date 22-03-2017
    144148    @return Devuelve una tupla con los ambitos
    145149    """
     
    147151    # TODO: especificar la URL del servicio a traves de una configuracion y gestion
    148152    # de error en solicitud http
    149     url =  'http://192.168.12.152:8080/services_sipes/entes_planificadores/views/servicios_webs?display_id=page_1'
     153    url = 'http://192.168.12.152:8080/services_sipes/entes_planificadores/views/lista_ambitos_y_sectores?display_id=ambitos'
    150154    r = requests.get(url)
    151155    if not r.status_code == 200:
     
    155159    data = r.json()
    156160
    157     # tupla de ambitos
    158161    tuplaScope = ('', 'Seleccione...'),
    159     uniqueScope = []
    160     index = 0
    161162
    162163    for dicc in data:
    163         tmpScope = dicc['ambito']
    164         if tmpScope not in uniqueScope:
    165             uniqueScope.append(dicc['ambito'])
    166         else:
    167             continue
    168     for item in uniqueScope:
    169         #if ( item.startswith('') ):
    170         tuplaScope += (index+1, item),
     164        if dicc['parent_id'] == '0' :
     165            tuplaScope += (dicc['id'], dicc['nombre']),
    171166
    172167    return tuplaScope
     168
     169def cargar_sectores():
     170    """!
     171    Función que permite cargar los sectores
     172
     173    @author Antonio Araujo (aaraujo at cenditel.gob.ve)
     174    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
     175    @date 22-03-2017
     176    @return Devuelve una tupla con los ambitos
     177    """
     178
     179    # TODO: especificar la URL del servicio a traves de una configuracion y gestion
     180    # de error en solicitud http
     181    url = 'http://192.168.12.152:8080/services_sipes/entes_planificadores/views/lista_ambitos_y_sectores?display_id=ambitos'
     182    r = requests.get(url)
     183    if not r.status_code == 200:
     184        print "ERROR:"
     185        return ('', 'ocurrio error...'),
     186
     187    data = r.json()
     188    tuplaSector = ('', 'Seleccione...'),
     189
     190    for dicc in data:
     191        if dicc['parent_id'] != '0' :
     192            tuplaSector += (dicc['parent_id'], dicc['nombre']),
     193
     194    return tuplaSector
  • base/templates/base.footer.html

    r99ac420 r95b08c1  
    1 <footer class="navbar-default">
     1<footer class="navbar-default navbar-fixed-bottom">
    22    <div class="container-fluid">
    33        <div class="row">
  • base/templates/base.template.html

    r99ac420 r95b08c1  
    1717    </head>
    1818    <body>
    19         <div class="wrapper">
    20             {% include 'base.nav.bar.html' %}
    21             <div class="container content-wrapper">
    22                 {% block content %}{% endblock %}
    23             </div>
    24             {% block modals %}{% endblock %}
     19        {% include 'base.nav.bar.html' %}
     20        <div class="container">
     21            {% block content %}{% endblock %}
    2522        </div>
     23        {% block modals %}{% endblock %}
    2624        {% include 'base.footer.html' %}
    2725    </body>
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.