Fix #1125 Clean /account/

This commit is contained in:
Nicolas Le Goff
2013-03-25 22:56:24 +01:00
committed by Romain Neutron
parent 7870e4ca7d
commit 4162fe7626
18 changed files with 1772 additions and 710 deletions

View File

@@ -1,167 +1,175 @@
{% extends 'account/base.html.twig' %} {% extends 'account/base.html.twig' %}
{% block content %} {% block title %}
<form name="updatingDemand" id="updatingDemand" action="/account/" method="post"> {% trans 'Granted bases' %}
<table border="0" style="table-layout: fixed; font-size: 11px;" cellspacing=0 width="100%"> {% endblock %}
<tr>
<td style="width: 180px; text-align: right">&nbsp;</td>
<td width="15px" style="width: 15px">&nbsp;</td>
<td style="width: 180px;">&nbsp;</td>
</tr>
{% for sbasId, baseInsc in inscriptions %}
{% if baseInsc['CollsRegistered'] or baseInsc['CollsRefuse'] or baseInsc['CollsWait'] or baseInsc['CollsIntime'] or baseInsc['CollsOuttime'] or baseInsc['CollsNonactif'] or baseInsc['CollsCGU'] or baseInsc['Colls'] %}
<tr>
<td colspan="3" style="text-align: center;"><h3>{{ sbasId | sbas_names(app) }}</h3></td>
</tr>
{% endif %}
{% if baseInsc['CollsRegistered'] is not none %} {% set selected = "access" %}
{% for base in baseInsc['CollsRegistered']%}
{% for collId, isTrue in base %} {% block content %}
<form name="updatingDemand" id="updatingDemand" action="/account/" method="post">
<table style="table-layout: fixed; width:100%">
<tr>
<td style="width: 180px; text-align: right">&nbsp;</td>
<td width="15px" style="width: 15px">&nbsp;</td>
<td style="width: 180px;">&nbsp;</td>
</tr>
{% for sbasId, baseInsc in inscriptions %}
{% if baseInsc['CollsRegistered'] or baseInsc['CollsRefuse'] or baseInsc['CollsWait'] or baseInsc['CollsIntime'] or baseInsc['CollsOuttime'] or baseInsc['CollsNonactif'] or baseInsc['CollsCGU'] or baseInsc['Colls'] %}
<tr>
<td colspan="3" style="text-align: center;"><h3>{{ sbasId | sbas_names(app) }}</h3></td>
</tr>
{% endif %}
{% if baseInsc['CollsRegistered'] is not none %}
{% for base in baseInsc['CollsRegistered']%}
{% for collId, isTrue in base %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align:center;">
{% trans 'login::register: acces authorise sur la collection ' %}{{ sbasId |sbas_names(app) }}
{% if isTrue | trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
<tr style="height: 5px;">
<td>
</td>
</tr>
{% endif %}
{% if baseInsc['CollsRefuse'] %}
{% for collId, isTrue in baseInsc['CollsRefuse'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %} {% set base_id = sbasId |base_from_coll(collId, app) %}
<tr> <tr>
<td colspan="3" style="text-align:center;"> <td colspan="3" style="text-align: center;">
{% trans 'login::register: acces authorise sur la collection ' %}{{ sbasId |sbas_names(app) }} <span style="color: red;">{% trans 'login::register: acces refuse sur la collection ' %}{{ sbasId |sbas_names(app) }}</span>
{% if isTrue | trim != '' %} {% if isTrue | trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a> <a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
{% endfor %} <tr style="height: 5px;">
<tr style="height: 5px;"> <td>
<td>
</td>
</tr>
{% endif %}
{% if baseInsc['CollsRefuse'] %}
{% for collId, isTrue in baseInsc['CollsRefuse'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;">
<span style="color: red;">{% trans 'login::register: acces refuse sur la collection ' %}{{ sbasId |sbas_names(app) }}</span>
{% if isTrue | trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td> </td>
</tr> </tr>
{% endfor %}
<tr style="height: 5px;">
<td>
</td>
</tr>
{% endif %}
{% if baseInsc['CollsWait'] %}
{% for collId, isTrue in baseInsc['CollsWait'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;">
<span style="color: orange;">{% trans 'login::register: en attente d\'acces sur' %} {{ sbasId |sbas_names(app) }}</span>
{% if isTrue | trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %}
{% if baseInsc['CollsIntime'] %}
{% for collId, isTrue in baseInsc['CollsIntime'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;">
<span>{% trans 'login::register: acces temporaire sur' %} {{ sbasId |sbas_names(app) }}</span>
{% if isTrue |trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %}
{% if baseInsc['CollsOuttime'] %}
{% for collId, isTrue in baseInsc['CollsOuttime'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;">
<span style="color:red;">{% trans 'login::register: acces temporaire termine sur ' %}{{ sbasId |sbas_names(app) }}</span>
{% if isTrue |trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %}
{% if baseInsc['CollsNonactif'] %}
{% for collId, isTrue in baseInsc['CollsNonactif'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;">
<span style="color:red;">{% trans 'login::register: acces supendu sur' %} {{ sbasId |sbas_names(app) }}</span>
{% if isTrue |trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %}
{% if (baseInsc['CollsCGU'] or baseInsc['Colls']) and baseInsc['inscript'] %}
{% if baseInsc['Colls'] %}
{% if baseInsc['CGU'] %}
<tr>
<td colspan="3" style="text-align: center;">{% trans 'login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes' %}</td>
</tr>
<tr>
<td colspan="3" style="text-align: center;"><div style="width: 90%; height: 120px; text-align: left; overflow: auto;">{{ baseInsc['CGU'] }}</div></td>
</tr>
{% endif %}
{% for collId, collName in baseInsc['Colls'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td style="text-align: right;">{{ collName }}</td>
<td></td>
<td class="TD_R" style="width: 200px;">
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
<span>{% trans 'login::register: Faire une demande d\'acces' %}</span>
</td>
</tr>
{% endfor %}
{% endif %} {% endif %}
{% if baseInsc['CollsCGU'] %}
{% for collId, collDesc in baseInsc['CollsCGU'] %} {% if baseInsc['CollsWait'] %}
{% for collId, isTrue in baseInsc['CollsWait'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %} {% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;"><hr style="width: 80%"/></td>
</tr>
<tr>
<td colspan="3" style="text-align: center;">{% trans 'login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes' %}</td>
</tr>
<tr> <tr>
<td colspan="3" style="text-align: center;"> <td colspan="3" style="text-align: center;">
<div style="width: 90%; height: 120px; text-align: left; overflow: auto;">{{ collDesc['CGU'] }}</div> <span style="color: orange;">{% trans 'login::register: en attente d\'acces sur' %} {{ sbasId |sbas_names(app) }}</span>
</td> {% if isTrue | trim != '' %}
</tr> <a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
<tr> {% endif %}
<td style="text-align: right;">{{ collDesc['name'] }}</td>
<td></td>
<td class="TD_R" style="width: 200px;">
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
<span>{% trans 'login::register: Faire une demande d\'acces' %}</span>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% if baseInsc['CollsIntime'] %}
</table> {% for collId, isTrue in baseInsc['CollsIntime'] %}
<input type="submit" class="btn btn-info" value="{% trans 'boutton::valider' %}"/> {% set base_id = sbasId |base_from_coll(collId, app) %}
</form> <tr>
<td colspan="3" style="text-align: center;">
<span>{% trans 'login::register: acces temporaire sur' %} {{ sbasId |sbas_names(app) }}</span>
{% if isTrue |trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %}
{% if baseInsc['CollsOuttime'] %}
{% for collId, isTrue in baseInsc['CollsOuttime'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;">
<span style="color:red;">{% trans 'login::register: acces temporaire termine sur ' %}{{ sbasId |sbas_names(app) }}</span>
{% if isTrue |trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %}
{% if baseInsc['CollsNonactif'] %}
{% for collId, isTrue in baseInsc['CollsNonactif'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;">
<span style="color:red;">{% trans 'login::register: acces supendu sur' %} {{ sbasId |sbas_names(app) }}</span>
{% if isTrue |trim != '' %}
<a class="inscriptlink" href="/prod/TOU/?to_display[]={{sbasId}}">{% trans 'login::register::CGU: lire les CGU' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr style="height: 5px;"><td></td></tr>
{% endif %}
{% if (baseInsc['CollsCGU'] or baseInsc['Colls']) and baseInsc['inscript'] %}
{% if baseInsc['Colls'] %}
{% if baseInsc['CGU'] %}
<tr>
<td colspan="3" style="text-align: center;">{% trans 'login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes' %}</td>
</tr>
<tr>
<td colspan="3" style="text-align: center;"><div style="width: 90%; height: 120px; text-align: left; overflow: auto;">{{ baseInsc['CGU'] }}</div></td>
</tr>
{% endif %}
{% for collId, collName in baseInsc['Colls'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td style="text-align: right;">{{ collName }}</td>
<td></td>
<td class="TD_R" style="width: 200px;">
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
<span>{% trans 'login::register: Faire une demande d\'acces' %}</span>
</td>
</tr>
{% endfor %}
{% endif %}
{% if baseInsc['CollsCGU'] %}
{% for collId, collDesc in baseInsc['CollsCGU'] %}
{% set base_id = sbasId |base_from_coll(collId, app) %}
<tr>
<td colspan="3" style="text-align: center;"><hr style="width: 80%"/></td>
</tr>
<tr>
<td colspan="3" style="text-align: center;">{% trans 'login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes' %}</td>
</tr>
<tr>
<td colspan="3" style="text-align: center;">
<div style="width: 90%; height: 120px; text-align: left; overflow: auto;">{{ collDesc['CGU'] }}</div>
</td>
</tr>
<tr>
<td style="text-align: right;">{{ collDesc['name'] }}</td>
<td></td>
<td class="TD_R" style="width: 200px;">
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
<span>{% trans 'login::register: Faire une demande d\'acces' %}</span>
</td>
</tr>
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
</table>
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="{% trans 'boutton::valider' %}">
</div>
</form>
{% endblock %} {% endblock %}

View File

@@ -2,12 +2,15 @@
{% import "login/common/macros.html.twig" as auth_macro %} {% import "login/common/macros.html.twig" as auth_macro %}
{% set selected = "informations" %}
{% block head %} {% block head %}
<link rel="stylesheet" type="text/css" href="/include/minify/?f=/skins/account/geonames.css"> <link rel="stylesheet" type="text/css" href="/include/minify/f=/skins/account/css/geonames.css">
<script type="text/javascript" src="/include/minify/?f=/include/account/geonames.js"></script> <script type="text/javascript" src="/include/minify/f=/skins/account/js/geonames.js"></script>
<script type="text/javascript">
initialize_geoname_field($('#form_geonameid')); <script type="text/javascript">
</script> initialize_geoname_field($('#form_geonameid'));
</script>
{% endblock %} {% endblock %}
{% block title %} {% block title %}
@@ -15,215 +18,214 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<table style="width: 100%"> <div class="row-fluid">
<tr valign="top"> <div class="span12" id="phr-account">
<td>
{% if notice | trim != '' %} {% if notice | trim != '' %}
<div class="notice alert alert-error">{{ notice }}</div> <div class="notice alert alert-error">{{ notice }}</div>
{% endif %} {% endif %}
{{ auth_macro.flashes() }} {{ auth_macro.flashes() }}
<form name="account" id="account" class="form-horizontal" action="/account/" method="post"> <form name="account" id="account" class="form-horizontal" action="/account/" method="post">
<fieldset> <legend>{% trans 'Informations personnelles' %}</legend>
<div class="control-group">
<div class="controls">
<p><a href="/account/reset-password/" target="_self">{% trans 'admin::compte-utilisateur changer mon mot de passe' %}</a></p>
</div>
</div>
<legend>{% trans 'Informations personnelles' %}</legend>
<div class="control-group">
<div class="controls">
<p><a href="/account/reset-password/" target="_self">{% trans 'admin::compte-utilisateur changer mon mot de passe' %}</a></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<div class="controls">
<p>{{ app['authentication'].getUser().get_login() }}</p>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_gender">{% trans 'admin::compte-utilisateur sexe' %}</label>
<div class="controls">
<select>
<option {% if app['authentication'].getUser().get_gender() == "0" %}selected{% endif %} value="0" >
{% trans 'admin::compte-utilisateur:sexe: mademoiselle' %}
</option>
<option {% if app['authentication'].getUser().get_gender() == "1" %}selected{% endif %} value="1" >
{% trans 'admin::compte-utilisateur:sexe: madame' %}
</option>
<option {% if app['authentication'].getUser().get_gender() == "2" %}selected{% endif %} value="2" >
{% trans 'admin::compte-utilisateur:sexe: monsieur' %}
</option>
</select>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_lastname">{% trans 'admin::compte-utilisateur nom' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_lastname" id="form_lastname" value="{{ app['authentication'].getUser().get_lastname() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_firstname" id="form_firstname" value="{{ app['authentication'].getUser().get_firstname() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur email' %}</label>
<div class="controls">
<p>{{ app['authentication'].getUser().get_email() }} <a href="/account/reset-email/" target="_self">{% trans 'login:: Changer mon adresse email' %}</a></p>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_address">{% trans 'admin::compte-utilisateur adresse' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_address" id="form_address" value="{{ app['authentication'].getUser().get_address() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_zip">{% trans 'admin::compte-utilisateur code postal' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_zip" id="form_zip" value="{{ app['authentication'].getUser().get_zipcode() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_city">{% trans 'admin::compte-utilisateur ville' %}</label>
<div class="controls">
<input class="input_element geoname_field" type="text" name="form_geonameid" id="form_geonameid" geonameid="{{ app['authentication'].getUser().get_geonameid() }}" value="{{ app['geonames'].name_from_id(app['authentication'].getUser().get_geonameid()) }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label"></label>
<div class="controls">
<div id="test_city" style="position: absolute; width: 200px; max-height: 200px; overflow-y: auto; z-index: 99999;"></div>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_function">{% trans 'admin::compte-utilisateur poste' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_function" id="form_function" value="{{ app['authentication'].getUser().get_position() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_company">{% trans 'admin::compte-utilisateur societe' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_company" id="form_company" value="{{ app['authentication'].getUser().get_company() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_activity">{% trans 'admin::compte-utilisateur activite' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_activity" id="form_activity" value="{{ app['authentication'].getUser().get_job() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_phone">{% trans 'admin::compte-utilisateur telephone' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_phone" id="form_phone" value="{{ app['authentication'].getUser().get_tel() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_fax">{% trans 'admin::compte-utilisateur fax' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_fax" id="form_fax" value="{{ app['authentication'].getUser().get_fax() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<legend>{% trans 'Notification par email' %}</legend> <div class="control-group">
{% for notification_group, nots in notifications%} <label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<p style="font-weight: bold;">{{ notification_group }}</p> <div class="controls">
{% for notification in nots %} <p>{{ app['authentication'].getUser().get_login() }}</p>
<div class="control-group"> <p class="form_alert help-block"></p>
<label class="form_label control-label"></label> </div>
<div class="controls"> </div>
<label class="checkbox" for="notif_{{ notification['id'] }}"> <div class="control-group">
<input type="checkbox" id="notif_{{ notification['id'] }}" name="notifications[{{ notification['id'] }}]" {% if not app['authentication'].getUser().getPrefs('notification_' ~ notification['id']) == '0' %}checked{% endif %} value="1"/> <label class="form_label control-label" for="form_gender">{% trans 'admin::compte-utilisateur sexe' %}</label>
{{ notification['description'] }} <div class="controls">
</label> <select class="input-xlarge">
<p class="form_alert help-block"></p> <option {% if app['authentication'].getUser().get_gender() == "0" %}selected{% endif %} value="0" >
</div> {% trans 'admin::compte-utilisateur:sexe: mademoiselle' %}
</option>
<option {% if app['authentication'].getUser().get_gender() == "1" %}selected{% endif %} value="1" >
{% trans 'admin::compte-utilisateur:sexe: madame' %}
</option>
<option {% if app['authentication'].getUser().get_gender() == "2" %}selected{% endif %} value="2" >
{% trans 'admin::compte-utilisateur:sexe: monsieur' %}
</option>
</select>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_lastname">{% trans 'admin::compte-utilisateur nom' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_lastname" id="form_lastname" value="{{ app['authentication'].getUser().get_lastname() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_firstname" id="form_firstname" value="{{ app['authentication'].getUser().get_firstname() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur email' %}</label>
<div class="controls">
<p>{{ app['authentication'].getUser().get_email() }} <a href="/account/reset-email/" target="_self">{% trans 'login:: Changer mon adresse email' %}</a></p>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_address">{% trans 'admin::compte-utilisateur adresse' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_address" id="form_address" value="{{ app['authentication'].getUser().get_address() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_zip">{% trans 'admin::compte-utilisateur code postal' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_zip" id="form_zip" value="{{ app['authentication'].getUser().get_zipcode() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_city">{% trans 'admin::compte-utilisateur ville' %}</label>
<div class="controls">
<input class="input_element input-xlarge geoname_field" type="text" name="form_geonameid" id="form_geonameid" geonameid="{{ app['authentication'].getUser().get_geonameid() }}" value="{{ app['geonames'].name_from_id(app['authentication'].getUser().get_geonameid()) }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label"></label>
<div class="controls">
<div id="test_city" style="position: absolute; width: 200px; max-height: 200px; overflow-y: auto; z-index: 99999;"></div>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_function">{% trans 'admin::compte-utilisateur poste' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_function" id="form_function" value="{{ app['authentication'].getUser().get_position() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_company">{% trans 'admin::compte-utilisateur societe' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_company" id="form_company" value="{{ app['authentication'].getUser().get_company() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_activity">{% trans 'admin::compte-utilisateur activite' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_activity" id="form_activity" value="{{ app['authentication'].getUser().get_job() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_phone">{% trans 'admin::compte-utilisateur telephone' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_phone" id="form_phone" value="{{ app['authentication'].getUser().get_tel() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_fax">{% trans 'admin::compte-utilisateur fax' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_fax" id="form_fax" value="{{ app['authentication'].getUser().get_fax() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<legend>{% trans 'Notification par email' %}</legend>
{% for notification_group, nots in notifications%}
<p style="font-weight: bold;">{{ notification_group }}</p>
{% for notification in nots %}
<div class="control-group">
<label class="form_label control-label"></label>
<div class="controls">
<label class="checkbox" for="notif_{{ notification['id'] }}">
<input type="checkbox" id="notif_{{ notification['id'] }}" name="notifications[{{ notification['id'] }}]" {% if not app['authentication'].getUser().getPrefs('notification_' ~ notification['id']) == '0' %}checked{% endif %} value="1"/>
{{ notification['description'] }}
</label>
<p class="form_alert help-block"></p>
</div> </div>
{% endfor %} </div>
{% endfor %} {% endfor %}
{% endfor %}
<legend>{% trans 'FTP' %}</legend> <legend>{% trans 'FTP' %}</legend>
<div class="control-group">
<label class="form_label control-label" for="form_activeFTP">{% trans 'admin::compte-utilisateur:ftp: Activer le compte FTP' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="checkbox" name="form_activeFTP" id="form_activeFTP" {% if app['authentication'].getUser().get_activeftp() %}checked{% endif %} onchange="if(this.checked){$('#ftpinfos').slideDown();}else{$('#ftpinfos').slideUp();}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div id="ftpinfos" style="display: {% if app['authentication'].getUser().get_activeftp() %}block{% else %}none{% endif %}">
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_activeFTP">{% trans 'admin::compte-utilisateur:ftp: Activer le compte FTP' %}</label> <label class="form_label control-label" for="form_addrFTP">{% trans 'phraseanet:: adresse' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="checkbox" name="form_activeFTP" id="form_activeFTP" {% if app['authentication'].getUser().get_activeftp() %}checked{% endif %} onchange="if(this.checked){$('#ftpinfos').slideDown();}else{$('#ftpinfos').slideUp();}" /> <input class="input_element input-xlarge" type="text" name="form_addrFTP" id="form_addrFTP" value="{{ app['authentication'].getUser().get_ftp_address() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div id="ftpinfos" style="display: {% if app['authentication'].getUser().get_activeftp() %}block{% else %}none{% endif %}"> <div class="control-group">
<div class="control-group"> <label class="form_label control-label" for="form_loginFTP">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<label class="form_label control-label" for="form_addrFTP">{% trans 'phraseanet:: adresse' %}</label> <div class="controls">
<div class="controls"> <input class="input_element input-xlarge" type="text" name="form_loginFTP" id="form_loginFTP" value="{{ app['authentication'].getUser().get_ftp_login() }}" />
<input class="input_element" type="text" name="form_addrFTP" id="form_addrFTP" value="{{ app['authentication'].getUser().get_ftp_address() }}" /> <p class="form_alert help-block"></p>
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_loginFTP">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_loginFTP" id="form_loginFTP" value="{{ app['authentication'].getUser().get_ftp_login() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_pwdFTP">{% trans 'admin::compte-utilisateur mot de passe' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_pwdFTP" id="form_pwdFTP" value="{{ app['authentication'].getUser().get_ftp_password() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_destFTP">{% trans 'admin::compte-utilisateur:ftp: repertoire de destination ftp' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_destFTP" id="form_destFTP" value="{{ app['authentication'].getUser().get_ftp_dir() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_prefixFTPfolder">{% trans 'admin::compte-utilisateur:ftp: prefixe des noms de dossier ftp' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_prefixFTPfolder" id="form_prefixFTPfolder" value="{{ app['authentication'].getUser().get_ftp_dir_prefix() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_passifFTP">{% trans 'admin::compte-utilisateur:ftp: Utiliser le mode passif' %}</label>
<div class="controls">
<input class="input_element" type="checkbox" name="form_passifFTP" id="form_passifFTP" {% if app['authentication'].getUser().get_ftp_passif() == "1" %}checked{% endif %} />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_retryFTP">{% trans 'admin::compte-utilisateur:ftp: Nombre d\'essais max' %}</label>
<div class="controls">
<input class="input_element" type="text" name="form_retryFTP" id="form_retryFTP" value="5" />
<p class="form_alert help-block"></p>
</div>
</div> </div>
</div> </div>
<div class="control-group">
<label class="form_label control-label" for="form_pwdFTP">{% trans 'admin::compte-utilisateur mot de passe' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_pwdFTP" id="form_pwdFTP" value="{{ app['authentication'].getUser().get_ftp_password() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_destFTP">{% trans 'admin::compte-utilisateur:ftp: repertoire de destination ftp' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_destFTP" id="form_destFTP" value="{{ app['authentication'].getUser().get_ftp_dir() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_prefixFTPfolder">{% trans 'admin::compte-utilisateur:ftp: prefixe des noms de dossier ftp' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_prefixFTPfolder" id="form_prefixFTPfolder" value="{{ app['authentication'].getUser().get_ftp_dir_prefix() }}" />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_passifFTP">{% trans 'admin::compte-utilisateur:ftp: Utiliser le mode passif' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="checkbox" name="form_passifFTP" id="form_passifFTP" {% if app['authentication'].getUser().get_ftp_passif() == "1" %}checked{% endif %} />
<p class="form_alert help-block"></p>
</div>
</div>
<div class="control-group">
<label class="form_label control-label" for="form_retryFTP">{% trans 'admin::compte-utilisateur:ftp: Nombre d\'essais max' %}</label>
<div class="controls">
<input class="input_element input-xlarge" type="text" name="form_retryFTP" id="form_retryFTP" value="5" />
<p class="form_alert help-block"></p>
</div>
</div>
</div>
<div class="form-actions" style="background-color: transparent;"> <div class="form-actions" style="background-color: transparent;">
<input type="submit" class="btn btn-primary" value="{% trans 'boutton::valider' %}"> <input type="submit" class="btn btn-primary" value="{% trans 'boutton::valider' %}">
</div> </div>
</fieldset>
</form> </form>
</td> </div>
</tr> </div>
</table>
{% endblock %} {% endblock %}

View File

@@ -1,5 +1,9 @@
{% extends 'account/base.html.twig' %} {% extends 'account/base.html.twig' %}
{% block title %}
{% trans 'Granted third party applications' %}
{% endblock %}
{% block head %} {% block head %}
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
@@ -46,63 +50,59 @@ $(document).ready(function(){
</script> </script>
{% endblock %} {% endblock %}
{% set selected = "applications" %}
{% block content %} {% block content %}
<table class='app-placement'> <div class="row-fluid">
<tbody> <div class="span6">
<tr>
<td style='width:600px;'>
<div id="content-apps"> <div id="content-apps">
<h3>{% trans 'Vous avez autorise ces applications a acceder a votre compte' %}</h3> <h3>{% trans 'Vous avez autorise ces applications a acceder a votre compte' %}</h3>
{% if applications|length > 0 %} {% if applications|length > 0 %}
<ul class='app-list'> <ul class='unstyled app-list'>
{% for application in applications %} {% for application in applications %}
<li id='app_{{application.get_id}}'> <li id='app_{{application.get_id}}'>
<div> <div>
{% set account = application.get_user_account(app['authentication'].getUser()) %} {% set account = application.get_user_account(app['authentication'].getUser()) %}
{% if account.is_revoked() is empty %} {% if account.is_revoked() is empty %}
<button type='button' class='revoke app-btn' value='{{application.get_id()}}'>{% trans 'Revoquer l\'access' %}</button> <button type='button' class='revoke app-btn btn btn-danger btn-small' value='{{application.get_id()}}'>{% trans 'Revoquer l\'access' %}</button>
{% else %} {% else %}
<button type='button' class='authorize app-btn' value='{{application.get_id()}}'>{% trans 'Authoriser l\'access' %}</button> <button type='button' class='authorize app-btn btn btn-success btn-small' value='{{application.get_id()}}'>{% trans 'Authoriser l\'access' %}</button>
{% endif %} {% endif %}
<span class='app-row'> <span class='app-row'>
<a href="{{application.get_website()}}" target="_blank"> <a href="{{application.get_website()}}" target="_blank">
<strong>{{application.get_name()}}</strong> <strong>{{application.get_name()}}</strong>
</a> </a>
{% if application.get_creator() is not none %} {% if application.get_creator() is not none %}
{% set user_name = application.get_creator().get_display_name() %} {% set user_name = application.get_creator().get_display_name() %}
{% trans %} {% trans %}
par {{user_name}} par {{user_name}}
{% endtrans %} {% endtrans %}
{% endif%} {% endif%}
</span> </span>
<span class='app-row'> <span class='app-row'>
<font size="1"><i>{{ app['date-formatter'].getPrettyString(application.get_created_on()) }}</i></font> <font size="1"><i>{{ app['date-formatter'].getPrettyString(application.get_created_on()) }}</i></font>
</span> </span>
<span class='app-row'>{{ application.get_description() }}</span> <span class='app-row'>{{ application.get_description()|truncate(80, true, '...') }}</span>
</div> </div>
</li> </li>
{%endfor%} {%endfor%}
</ul> </ul>
{% else %} {% else %}
<div> <div>
{% trans 'Aucune application n\'a accés à vos données.' %} {% trans 'Aucune application n\'a accés à vos données.' %}
</div> </div>
{% endif %} {% endif %}
</div>
</td>
<td style="vertical-align:top;">
<div class="side-section" style="margin:10px;text-align:left;">
<h3>{% trans 'Applications' %}</h3>
<p>
{% trans 'Naviguez et gerez les applications que vous souhaitez autoriser a acceder a vos informations Phraseanet' %}
</p>
<h3>{% trans 'Developpeurs' %}</h3>
<p>
{% trans 'Les developpeurs peuvent editer l\'enregistrement de leurs application grace a l\'onglet "developpeurs" ci-dessus' %}
</p>
</div> </div>
</td> </div>
</tr> <div class="span6">
</tbody> <h3>{% trans 'Applications' %}</h3>
</table> <p>
{% trans 'Naviguez et gerez les applications que vous souhaitez autoriser a acceder a vos informations Phraseanet' %}
</p>
<h3>{% trans 'Developpeurs' %}</h3>
<p>
{% trans 'Les developpeurs peuvent editer l\'enregistrement de leurs application grace a l\'onglet "developpeurs" ci-dessus' %}
</p>
</div>
</div>
{% endblock %} {% endblock %}

View File

@@ -1,44 +1,43 @@
<html lang="{{ app['locale.I18n'] }}"> <html lang="{{ app['locale.I18n'] }}">
<head> <head>
<title>{{ app['phraseanet.registry'].get('GV_homeTitle') }} {% block title %}{% endblock %}</title> <title>{{ app['phraseanet.registry'].get('GV_homeTitle') }} {% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="/include/minify/?f=/skins/login/home.css,/skins/html5/bootstrap/css/bootstrap.min.css,/skins/html5/bootstrap/css/bootstrap-responsive.min.css,/skins/login/css/main.css"/> <link rel="stylesheet" type="text/css" href="/include/minify/f=/skins/build/css/account.css"/>
<script type="text/javascript" language="javascript" src="/include/minify/?f=include/jslibs/jquery-1.7.1.js,include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script> <script type="text/javascript" language="javascript" src="/include/minify/f=/assets/jquery/jquery.js"></script>
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>
<body> <body>
<div style="width: 950px; margin-left: auto; margin-right: auto;"> <div class="container">
<div style="margin-top: 70px; height: 35px;"> <div class="row-fluid">
<table style="width: 100%;"> <div class="span12">
<tr style="height: 35px;">
<td style="width: 580px;">
<span class="title-name">{{ app['phraseanet.registry'].get('GV_homeTitle') }}</span>
<span class="title-desc">{{ block('title') }}</span>
</td>
<td style="color: #b1b1b1; text-align: right;">
</td>
</tr>
</table>
</div>
<div class="tab-pane">
<div id="id-main" class="tab-content" style="height: auto;display: block; overflow-y: auto; overflow-x: hidden;">
{% block menu %} {% block menu %}
<ul class='account-menu'> <div id="main-bar" class="navbar">
<li><a href="/account/">{% trans 'Informations' %}</a></li> <div class="navbar-inner">
<li><a href="/account/access/">{% trans 'Acces' %}</a></li> <span class="brand">{{ app['phraseanet.registry'].get('GV_homeTitle') }}<span class="section-title"> {{ block('title') }}</span></span>
<li><a href="/account/security/sessions/">{% trans 'Sessions' %}</a></li> <ul class="nav">
<li><a href="/account/security/applications/">{% trans 'Applications' %}</a></li> <li {% if selected == "informations" %}class="active"{% endif %}><a href="/account/">{% trans 'Informations' %}</a></li>
<li><a href="/developers/applications/">{% trans 'Developpeur' %}</a></li> <li {% if selected == "access" %}class="active"{% endif %}><a href="/account/access/">{% trans 'Acces' %}</a></li>
</ul> <li {% if selected == "sessions" %}class="active"{% endif %}><a href="/account/security/sessions/">{% trans 'Sessions' %}</a></li>
<li {% if selected == "applications" %}class="active"{% endif %}><a href="/account/security/applications/">{% trans 'Applications' %}</a></li>
<li {% if selected == "developer" %}class="active"{% endif %}><a href="/developers/applications/">{% trans 'Developpeur' %}</a></li>
</ul>
</div>
</div>
{% endblock %} {% endblock %}
</div>
<div> </div>
<div class="row-fluid">
<div class="span12">
<div class="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
</div> </div>
<div style="text-align: right; position: relative; margin: 18px 10px 0 0; font-size: 10px; font-weight: normal;"> </div>
<span>&copy; Copyright Alchemy 2005-{{ "now"|date("Y") }}</span> <div class="row-fluid">
<div class="span12 text-right">
<div class="footer">
<span>&copy; Copyright Alchemy 2005-{{ "now"|date("Y") }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -45,14 +45,16 @@ $(document).ready(function() {
</script> </script>
{% endblock %} {% endblock %}
{% set selected = "" %}
{% block content %} {% block content %}
{% if updateMsg is not none %} {% if updateMsg is not none %}
<div class="alert alert-info"> <div class="alert alert-info">
<div>{{ updateMsg }}</div> <div>{{ updateMsg }}</div>
<a href="/account/" target="_self">{% trans 'admin::compte-utilisateur retour a mon compte'%}</a> <a href="/account/" target="_self">{% trans 'admin::compte-utilisateur retour a mon compte'%}</a>
</div> </div>
{% else %} {% else %}
{% if noticeMsg is not none %} {% if noticeMsg is not none %}
<div class="notice" style="text-align:center;margin:20px 0"> <div class="notice" style="text-align:center;margin:20px 0">
@@ -68,7 +70,7 @@ $(document).ready(function() {
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label> <label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<div class="controls"> <div class="controls">
<p>{{ app['authentication'].getUser().get_login() }}</p> <p style="line-height: 30px;">{{ app['authentication'].getUser().get_login() }}</p>
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
@@ -94,14 +96,14 @@ $(document).ready(function() {
</div> </div>
</div> </div>
<div class="form-actions" style="background-color: transparent;"> <div class="form-actions" style="background-color: transparent;">
<input type="submit" class="btn" value="{% trans 'boutton::valider' %}" style="margin: 20px auto;" /> <input type="submit" class="btn btn-success" value="{% trans 'boutton::valider' %}" style="margin: 20px auto;" />
<input type="button" class="btn" value="{% trans 'boutton::annuler' %}" onclick="self.location.replace('/account/');" /> <input type="button" class="btn" value="{% trans 'boutton::annuler' %}" onclick="self.location.replace('/account/');" />
</div> </div>
</form> </form>
<p> <div class="well well-small alert-info">
{% trans 'admin::compte-utilisateur: Pourquoi me demande-t-on mon mot de passe pour changer mon adresse email ?'%} {% trans 'admin::compte-utilisateur: Pourquoi me demande-t-on mon mot de passe pour changer mon adresse email ?'%}
<br /> <br />
{% trans 'admin::compte-utilisateur: Votre adresse e-mail sera utilisee lors de la perte de votre mot de passe afin de pouvoir le reinitialiser, il est important que vous soyez la seule personne a pouvoir la changer.'%} {% trans 'admin::compte-utilisateur: Votre adresse e-mail sera utilisee lors de la perte de votre mot de passe afin de pouvoir le reinitialiser, il est important que vous soyez la seule personne a pouvoir la changer.'%}
</p> </div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@@ -1,76 +1,81 @@
{% extends 'account/base.html.twig' %} {% extends 'account/base.html.twig' %}
{% block title %} {% block title %}
{% trans 'Mes sessions' %} {% trans 'Access history' %}
{% endblock %} {% endblock %}
{% set selected = "sessions" %}
{% block content %} {% block content %}
<div> <div class="row-fluid">
<table style="width: 80%; margin: 0 auto;"> <div class="span12">
<tbody> <table class="table table-striped">
<tr> <thead>
<td> <tr>
</td> <th></th>
<td> <th>
{% trans 'Date de connexion' %} {% trans 'Date de connexion' %}
</td> </th>
<td> <th>
{% trans 'Dernier access' %} {% trans 'Dernier access' %}
</td> </th>
<td> <th>
{% trans 'IP' %} {% trans 'IP' %}
</td> </th>
<td> <th>
{% trans 'Browser' %} {% trans 'Browser' %}
</td> </th>
<td> <th>
{% trans 'ecran' %} {% trans 'ecran' %}
</td> </th>
<td> <th>
{% trans 'Session persistante' %} {% trans 'Session persistante' %}
</td> </th>
</tr>
{% for row in sessions %}
<tr>
<td>
{% if app['session'].get('phrasea_session_id') != row.Id() %}
<img src="/skins/icons/delete.png"/>
{% endif %}
</td>
<td>
{{ app['date-formatter'].getDate(row.getCreated()) }}
</td>
<td>
{{ app['date-formatter'].getDate(row.getUpdated()) }}
</td>
<td>
{% set geoname = app['geonames'].find_geoname_from_ip(row.getIpAddress()) %}
{% if geoname['city'] %}
{% set ip_infos = geoname['city'] ~ ' (' ~ geoname['country'] ~ ')' %}
{% elseif geoname['fips'] %}
{% set ip_infos = geoname['fips'] ~ ' (' ~ geoname['country'] ~ ')' %}
{% elseif geoname['country'] %}
{% set ip_infos = geoname['country'] %}
{% else %}
{% set ip_infos = '' %}
{% endif %}
{{ row.getIpAddress() }}
{{ ip_infos }}
</td>
<td>
{{ row.getBrowserName() }} {{ row.getBrowserVersion() }}
</td>
<td>
{{ row.getScreenWidth() }} x {{ row.getScreenHeight() }}
</td>
<td>
{% if row.getToken %}{{ yes }}{% endif %}
</td>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for row in sessions %}
<tr>
<td>
{% if app['session'].get('phrasea_session_id') != row.Id() %}
<img src="/skins/icons/delete.png"/>
{% endif %}
</td>
<td>
{{ app['date-formatter'].getDate(row.getCreated()) }}
</td>
<td>
{{ app['date-formatter'].getDate(row.getUpdated()) }}
</td>
<td>
{% set geoname = app['geonames'].find_geoname_from_ip(row.getIpAddress()) %}
{% if geoname['city'] %}
{% set ip_infos = geoname['city'] ~ ' (' ~ geoname['country'] ~ ')' %}
{% elseif geoname['fips'] %}
{% set ip_infos = geoname['fips'] ~ ' (' ~ geoname['country'] ~ ')' %}
{% elseif geoname['country'] %}
{% set ip_infos = geoname['country'] %}
{% else %}
{% set ip_infos = '' %}
{% endif %}
{{ row.getIpAddress() }}
{{ ip_infos }}
</td>
<td>
{{ row.getBrowserName() }} {{ row.getBrowserVersion() }}
</td>
<td>
{{ row.getScreenWidth() }} x {{ row.getScreenHeight() }}
</td>
<td>
{% if row.getToken %}{{ yes }}{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -2,89 +2,98 @@
{% use "developers/header.html.twig" with header as parent_header %} {% use "developers/header.html.twig" with header as parent_header %}
{% block title %}
{% trans 'Client application' %}
{% endblock %}
{% block head %} {% block head %}
{{ block('parent_header') }} {{ block('parent_header') }}
{% endblock %} {% endblock %}
{% set selected = "" %}
{% block content %} {% block content %}
<div class="row-fluid">
<div class="span12">
<h1>{% trans 'Application' %}</h1>
<input type="hidden" value="{{application.get_id}}" name="app_id"/>
<h1 style='text-align:left'>{% trans 'Application' %}</h1> <div>
<input type="hidden" value="{{application.get_id}}" name="app_id"/> <div><strong><a class="link" href="/developers/application/{{application.get_id}}/">{{application.get_name}}</a></strong></div>
<div> <div>{{application.get_description }}</div>
<ul class='app-list'> </div>
<li>
<div>
<span class='app-row'><strong><a class="link" href="/developers/application/{{application.get_id}}/">{{application.get_name}}</a></strong></span>
<span class='app-row'>{{application.get_description }}</span>
</div>
</li>
</ul>
</div>
<h1 style='text-align:left'>{% trans 'settings OAuth' %}</h1>
<p style='text-align:left'>{% trans 'Les parametres oauth de votre application.' %}</p>
<table id="app-oauth-setting">
<tbody>
<tr>
<td>Client ID</td>
<td>{{application.get_client_id}}</td>
</tr>
<tr>
<td>Client Secret</td>
<td>{{application.get_client_secret}}</td>
</tr>
<tr>
<td>{% trans 'URL de callback' %}</td>
{% if application.get_type == constant('API_OAuth2_Application::DESKTOP_TYPE') %}
<td>
<span>{{application.get_redirect_uri}}</span>
</td>
{% else %}
<td class="url_callback"><span class="url_callback_input">{{application.get_redirect_uri}}</span>
<button type="button" class="save_callback" style="display:none;">save</button>
<button type="button" class="modifier_callback" style="display:none;">modifier</button>
</td>
{%endif%}
</tr>
<tr>
<td>Authorize endpoint</td>
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/authorize</td>
</tr>
<tr>
<td>Access endpoint</td>
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/token</td>
</tr>
<tr>
<td>{% trans 'Activer le grant_type de type password pour votre application' %}</td>
<td><input class="grant-type" type='checkbox' {{ application.is_password_granted() ? "checked='checked'" : ""}} name="grant" value='{{application.get_id()}}'></td>
</tr>
</tbody>
</table>
<h1 style='text-align:left'>{% trans 'Votre token d\'access' %}</h1> <h1 >{% trans 'settings OAuth' %}</h1>
<p style='text-align:left'> {% trans 'Les paramétres oauth de votre application.' %}</p> <p >{% trans 'Les parametres oauth de votre application.' %}</p>
<table id="app-access-token-setting">
<tbody> <table id="app-oauth-setting" class="table table-condensed table-bordered">
<tr> <tbody>
<td style='width:25%'> <tr>
{% trans 'Token' %} <td>Client ID</td>
</td> <td>{{application.get_client_id()}}</td>
<td> </tr>
<span id="my_access_token"> <tr>
{% if not token is none %} <td>Client Secret</td>
{{token|default('')}} <td>{{application.get_client_secret}}</td>
{% else %} </tr>
{% trans 'Le token n\'a pas encore ete genere' %} <tr>
{% endif %} <td>{% trans 'URL de callback' %}</td>
</span> {% if application.get_type == constant('API_OAuth2_Application::DESKTOP_TYPE') %}
</td> <td>
</tr> <span>{{application.get_redirect_uri}}</span>
<tr> </td>
<td style='width:25%'></td> {% else %}
<td><button id="generate_access" type="button" value="{{application.get_id}}">{% trans 'boutton::generer' %}</button></td> <td class="url_callback">
</tr> <span class="url_callback_input">{{application.get_redirect_uri}}</span>
</tbody> <button type="button" class="save_callback btn btn-small btn-info" style="display:none;">
</table> save
<div style='text-align:left'> </button>
<a class="link" href="/developers/applications/"><button>{% trans 'boutton::retour' %}</button></a> <button type="button" class="modifier_callback btn btn-small">
modifier
</button>
</td>
{%endif%}
</tr>
<tr>
<td>Authorize endpoint</td>
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/authorize</td>
</tr>
<tr>
<td>Access endpoint</td>
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/token</td>
</tr>
<tr>
<td>{% trans 'Activer le grant_type de type password pour votre application' %}</td>
<td><input class="grant-type" type='checkbox' {{ application.is_password_granted() ? "checked='checked'" : ""}} name="grant" value='{{application.get_id()}}'></td>
</tr>
</tbody>
</table>
<h1>{% trans 'Votre token d\'access' %}</h1>
<p> {% trans 'Les paramétres oauth de votre application.' %}</p>
<table id="app-access-token-setting table" class="table table-condensed table-bordered">
<tbody>
<tr>
<td>
{% trans 'Token' %}
</td>
<td>
<span id="my_access_token">
{% if not token is none %}
{{token|default('')}}
{% else %}
{% trans 'Le token n\'a pas encore ete genere' %}
{% endif %}
</span>
<button id="generate_access" class="btn btn-small btn-info" type="button" value="{{application.get_id}}">{% trans 'boutton::generer' %}</button>
</td>
</tr>
</tbody>
</table>
<div>
<a class="btn btn-primary" href="/developers/applications/">{% trans 'boutton::retour' %}</a>
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -2,50 +2,56 @@
{% use "developers/header.html.twig" with header as parent_header %} {% use "developers/header.html.twig" with header as parent_header %}
{% block title %}
{% trans 'new client application' %}
{% endblock %}
{% block head %} {% block head %}
{{ block('parent_header') }} {{ block('parent_header') }}
{% endblock %} {% endblock %}
{% set selected = "" %}
{# form input macro #} {# form input macro #}
{% macro input(name, value, violations, property, type, size) %} {% macro input(name, value, violations, property, class='', type, size) %}
{% if violations is none %} {% if violations is none %}
<input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" /> <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" {% if class is not empty %}class="{{ class }}"{% endif %}/>
{% else %} {% else %}
{% set hasError = "false" %} {% set hasError = "false" %}
{% for violation in violations %} {% for violation in violations %}
{% if violation.getPropertyPath == property and hasError == "false" %} {% if violation.getPropertyPath == property and hasError == "false" %}
{% set hasError = "true" %} {% set hasError = "true" %}
<input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value }}" size="{{ size|default(20) }}" /> <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value }}" size="{{ size|default(20) }}" {% if class is not empty %}class="{{ class }}"{% endif %}/>
<div style="color:red" > {{ violation.getInvalidValue }} - {{violation.getMessage}} </div> <span class="help-block" style="color:red"> {{ violation.getInvalidValue }} - {{violation.getMessage}} </span>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if hasError == "false" %} {% if hasError == "false" %}
<input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" /> <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" {% if class is not empty %}class="{{ class }}"{% endif %}/>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{# form textare macro #} {# form textare macro #}
{% macro textarea(name, value, violations,property, rows, cols) %} {% macro textarea(name, value, violations,property, rows, cols, class='') %}
{% if violations is none %} {% if violations is none %}
<textarea name="{{ name }}" rows="{{ rows|default(4)}}" cols="{{cols|default(20)}}" >{{ value|e}}</textarea> <textarea name="{{ name }}" rows="{{ rows|default(4)}}" cols="{{cols|default(20)}}" {% if class is not empty %}class="{{ class }}"{% endif %}>{{ value|e}}</textarea>
{% else %} {% else %}
{% set hasError = "false" %} {% set hasError = "false" %}
{% for violation in violations %} {% for violation in violations %}
{% if violation.getPropertyPath == property and hasError == "false" %} {% if violation.getPropertyPath == property and hasError == "false" %}
{% set hasError = "true" %} {% set hasError = "true" %}
<textarea name="{{ name }}" rows="{{ rows|default(4)}}" cols="{{cols|default(20)}}" >{{ violation.getInvalidValue}}</textarea> <textarea name="{{ name }}" rows="{{ rows|default(4)}}" cols="{{cols|default(20)}}" {% if class is not empty %}class="{{ class }}"{% endif %}>{{ violation.getInvalidValue}}</textarea>
<div style="color:red" > {{violation.getMessage}} </div> <span class="help-block" style="color:red"> {{violation.getMessage}} </span>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if hasError == "false" %} {% if hasError == "false" %}
<textarea name="{{ name }}" rows="{{ rows|default(4)}}" cols="{{cols|default(20)}}" >{{ value|e}}</textarea> <textarea name="{{ name }}" rows="{{ rows|default(4)}}" cols="{{cols|default(20)}}" {% if class is not empty %}class="{{ class }}"{% endif %}>{{ value|default('')|e}}</textarea>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% block content %} {% block content %}
<form id="form_create" action="/developers/application/" method="POST"> <form id="form_create" action="/developers/application/" method="POST" class="form-horizontal">
{% if form is none %} {% if form is none %}
{% set name, description, website, callback = '', '', '', ''%} {% set name, description, website, callback = '', '', '', ''%}
{% set app_type = 'web'%} {% set app_type = 'web'%}
@@ -56,49 +62,68 @@
{% set callback = form.callback %} {% set callback = form.callback %}
{% set app_type = form.type %} {% set app_type = form.type %}
{% endif %} {% endif %}
<table id = "app-dev-create">
<tr> <div class="control-group">
<td><label for="name">{% trans 'Nom' %}</label></td> <label class="control-label" for="name"><b>{% trans 'Nom' %}</b></label>
<td>{{ _self.input("name", name, violations, 'name') }}</td> <div class="controls">
</tr> {{ _self.input("name", name, violations, 'name', 'input-xlarge') }}
<tr> </div>
<td><label for="description">{% trans 'Description' %}</label></td> </div>
<td>{{ _self.textarea("description", description, 'description', violations, 5, 17) }}</td>
</tr> <div class="control-group">
<tr> <label class="control-label" for="name"><b>{% trans 'Description' %}</b></label>
<td><label for="website">{% trans 'Site web' %}</label></td> <div class="controls">
<td class="url-td"> {{ _self.textarea("description", description, violations, 'description', 5, 30, 'input-xlarge') }}
<select name="scheme-website"> </div>
<option value="http://">http://</option> </div>
<option value="https://">https://</option>
</select> <div class="control-group">
{{ _self.input("website", website, violations, 'urlwebsite') }}</td> <label for="website" class="control-label"><b>{% trans 'Site web' %}</b></label>
</tr> <div class="controls">
<tr> <select name="scheme-website" class="input-mini">
<td><label for="type">{% trans 'Type d\'application' %}</label></td> <option value="http://">http://</option>
<td>{% trans 'Application web' %} <option value="https://">https://</option>
<input type="radio" name="type" value="web" {{ app_type == "web" ? "checked='checked'" : "" }}/> </select>
{% trans 'Application desktop' %} {{ _self.input("website", website, violations, 'urlwebsite') }}
<input type="radio" name="type" value="desktop" {{ app_type == "desktop" ? "checked='checked'" : "" }}/></td> </div>
</tr> </div>
<div class="control-group">
<label class="control-label"><b>{% trans 'Type d\'application' %}</b></label>
<div class="controls">
<label class="radio">
<input type="radio" name="type" value="web" {{ app_type == "web" ? "checked='checked'" : "" }}/>
{% trans 'Application web' %}
</label>
<label class="radio">
<input type="radio" name="type" value="desktop" {{ app_type == "desktop" ? "checked='checked'" : "" }}/>
{% trans 'Application desktop' %}
</label>
</div>
</div>
{% if app_type == "web" %} {% if app_type == "web" %}
<tr class="callback" style="height:25px;"> <div class="control-group">
<td><label for="callback">{% trans 'URL de callback' %} <br/></label></td> <label for="callback" class="control-label"><b>{% trans 'URL de callback' %}</b></label>
<td class="url-td"> <div class="controls">
<select name="scheme-callback"> <select name="scheme-callback" class="input-mini">
<option value="http://">http://</option> <option value="http://">http://</option>
<option value="https://">https://</option> <option value="https://">https://</option>
</select> </select>
{{ _self.input("callback", callback, violations, 'urlcallback') }}</td> {{ _self.input("callback", callback, violations, 'urlcallback') }}
</tr> </div>
</div>
{% endif %} {% endif %}
<tr>
<td></td> <div class="form-actions">
<td><button class="app_submit" type="button">{% trans 'boutton::valider' %}</button</td> <button class="app_submit btn btn-info" type="submit">
</tr> {% trans 'boutton::valider' %}
</table> </button>
<a class="btn btn-primary" href="/developers/applications/">
{% trans 'boutton::retour' %}
</a>
</div>
</form> </form>
<div style="text-align:left">
<a href="/developers/applications/"><button>{% trans 'boutton::retour' %}</button></a>
<div>
{% endblock %} {% endblock %}

View File

@@ -2,61 +2,63 @@
{% use "developers/header.html.twig" with header as parent_header %} {% use "developers/header.html.twig" with header as parent_header %}
{% block title %}
{% trans 'Client applications' %}
{% endblock %}
{% block head %} {% block head %}
{{ block('parent_header') }} {{ block('parent_header') }}
{% endblock %} {% endblock %}
{% set selected = "developer" %}
{% block content %} {% block content %}
<table class='app-placement'> <div class="row-fluid">
<tbody> <div class="span7">
<tr>
<td style='width:600px;'>
<div id="content-apps"> <div id="content-apps">
<h1>Phraseanet Developer Center</h1> <h1>Phraseanet Developer Center</h1>
<h3>{% trans 'Mes applications' %}</h3> <h3>{% trans 'Mes applications' %}</h3>
{% if applications|length > 0 %} {% if applications|length > 0 %}
<ul class='app-list'> <ul class='app-list unstyled'>
{% for application in applications %} {% for application in applications %}
<li id='app_{{application.get_id()}}'> <li id='app_{{application.get_id()}}'>
<div>
<button class='delete_app btn btn-danger btn-small' type='button'>
{% trans 'button::supprimer'%}
</button>
<span class='app-row'>
<strong>
<a class="link" href="/developers/application/{{application.get_id()}}/">
{{application.get_name()}}
</a>
</strong>
</span>
<span class='app-row'>{{application.get_description() }}</span>
<span class='app-row'>{{application.get_website()}}</span>
</div>
</li>
{%endfor%}
</ul>
{% else %}
<div> <div>
<button class='delete_app' type='button'>{% trans 'button::supprimer'%}</button> {% trans 'Aucune application creee.' %}
<span class='app-row'>
<strong>
<a class="link" href="/developers/application/{{application.get_id()}}/">
{{application.get_name()}}
</a>
</strong>
</span>
<span class='app-row'>{{application.get_description() }}</span>
<span class='app-row'>{{application.get_website()}}</span>
</div> </div>
</li> {% endif %}
{%endfor%}
</ul>
{% else %}
<div>
{% trans 'Aucune application creee.' %}
</div>
{% endif %}
</div> </div>
</td>
<td style="vertical-align:top;text-align:left;">
<div style="margin:10px;text-align:left;" class="side-section">
<div>
<a href="http://developer.phraseanet.com/" class="no_underline" target="_blank">
<button class="link_button">{% trans 'Demarrer avec l\'API Phraseanet' %}</button>
</a><br/>
{% trans 'Decouvrez la documentation' %}
</div>
<div>
<a class="no_underline" href="/developers/application/new/">
<button class="link_button">{% trans 'Creer une nouvelle applications' %}</button>
</a><br/>
{% trans 'Creez une application pour commencer a utiliser l\'API Phraseanet' %}
</div>
</div> </div>
</td> <div class="span5">
</tr> <div>
</tbody> <a href="http://developer.phraseanet.com/" target="_blank" class="btn btn-large">
</table> {% trans 'Demarrer avec l\'API Phraseanet' %}
</a>
<p>{% trans 'Decouvrez la documentation' %}</p>
</div>
<div>
<a href="/developers/application/new/" class="btn-info btn btn-large">
{% trans 'Creer une nouvelle applications' %}
</a>
<p>{% trans 'Creez une application pour commencer a utiliser l\'API Phraseanet' %}</p>
</div>
</div>
</div>
{% endblock %} {% endblock %}

View File

@@ -26,14 +26,6 @@
jQuery.ajax(opts); jQuery.ajax(opts);
}); });
var $url_callback_event = function(event) {
if ( event.type == "mouseover" ) {
$(this).find(".modifier_callback").show();
} else {
$(this).find(".modifier_callback").hide();
}
};
var $event = function(event){ var $event = function(event){
if ( event.type == "mouseover" ) { if ( event.type == "mouseover" ) {
$(this).find(".delete_app").show(); $(this).find(".delete_app").show();
@@ -42,8 +34,6 @@
} }
}; };
$(".url_callback").live("mouseover mouseout", $url_callback_event);
$(".app-list li").live("mouseover mouseout", $event); $(".app-list li").live("mouseover mouseout", $event);
$(".modifier_callback").live("click", function(){ $(".modifier_callback").live("click", function(){
@@ -68,8 +58,6 @@
$(".url_callback_input").empty().append(callback); $(".url_callback_input").empty().append(callback);
else else
$(".url_callback_input").empty().append(cur_value); $(".url_callback_input").empty().append(cur_value);
$this.hide();
$(".url_callback").live("mouseover mouseout", $url_callback_event);
} }
} }
$.ajax(option); $.ajax(option);

View File

View File

@@ -0,0 +1,21 @@
.geoname_city_finder div.box{
cursor:pointer;
text-align:left;
padding:3px ;
color:white;
}
.geoname_city_finder div.boxI{
background-color:#666666;
border:1px solid #666666;
}
.geoname_city_finder div.boxP{
background-color:#444444;
border:1px solid #444444;
}
.geoname_city_finder div.box.selected{
border:1px solid red;
}

View File

@@ -1,18 +0,0 @@
.geoname_city_finder div.box{
cursor:pointer;
text-align:left;
padding:3px ;
color:white;
}
.geoname_city_finder div.boxI{
background-color:#666666;
border:1px solid #666666;
}
.geoname_city_finder div.boxP{
background-color:#444444;
border:1px solid #444444;
}
.geoname_city_finder div.box.selected{
border:1px solid red;
}

View File

@@ -0,0 +1,196 @@
var ajaxGeoRunning = false;
var ajaxGeo = false;
function initialize_geoname_field(box)
{
$(box).bind('keyup', function(event) {
checkCity(event, $(this));
return false;
}).bind('keydown', function(event) {
goCity(event, $(this));
}).bind('focus', function(event) {
checkCity(event, $(this));
return false;
}) .bind('blur', function() {
var city_finder = $(this).parent().find('.geoname_city_finder');
if ($('div.box.selected', city_finder).length > 0)
{
selectCity($(this));
}
else
{
if ($('div.box', city_finder).length > 0)
{
$(this).val('');
}
$(this).parent().find('.geoname_city_finder').empty();
}
if (ajaxGeoRunning) {
ajaxGeo.abort();
}
ajaxGeoRunning = false;
return false;
});
$(box).attr('autocomplete', 'off').addClass('geoname_initialized');
var form_name = $(box).attr('name');
$(box).attr('name', form_name + '_geoname_name');
$('<div class="geoname_city_finder" style="width:200px;max-height:200px;overflow-y:auto;z-index:99999;"></div>').insertAfter($(box));
$('<input type="hidden" name="' + form_name + '" value="' + $(box).attr('geonameid') + '"/>').insertAfter($(box));
var city_finder = $(box).parent().find('.geoname_city_finder');
console.log($(box), city_finder);
}
function checkCity(event, keybox)
{
var geoname_id = $(keybox).next().val();
var city_finder = $(keybox).parent().find('.geoname_city_finder');
var badCodes = [9, 16, 17, 18, 20, 27, 33, 34, 35, 36, 37, 39, 45, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
if ($.inArray(event.keyCode, badCodes) >= 0)
return false;
if (event.keyCode == 40)
{
var el = $('div.box.selected', city_finder);
el.removeClass('selected');
if (el.next(':not(.unselectable)').length == 0)
el = $('div.box:not(.unselectable):first', city_finder);
else
el = el.next(':not(.unselectable)');
el.addClass('selected');
city_finder.scrollTop(city_finder.scrollTop() + $(el).position().top - ((city_finder.height() - $(el).outerHeight()) / 2));
return false;
}
else
{
if (event.keyCode == 38)
{
el = $('div.box.selected', city_finder);
el.removeClass('selected');
if (el.prev(':not(.unselectable)').length == 0)
el = $('div.box:not(.unselectable):last', city_finder);
else
el = el.prev(':not(.unselectable)');
el.addClass('selected');
city_finder.scrollTop(city_finder.scrollTop() + $(el).position().top - ((city_finder.height() - $(el).outerHeight()) / 2));
return false;
}
else
{
if (event.keyCode == 13)
{
event.preventDefault();
return false;
}
else
{
$('div.box.selected', city_finder).removeClass('selected');
}
}
}
if ($.trim($(keybox).val()) == '')
{
$(keybox).next().val('');
return;
}
ajaxGeo = $.ajax({
type: "POST",
url: "/include/geonames.feedback.php",
dataType: 'html',
data: {
action: "FIND",
city: $(keybox).val()
},
beforeSend: function() {
if (ajaxGeoRunning)
ajaxGeo.abort();
ajaxGeoRunning = true;
city_finder.css({
top: ($(keybox).position().top + $(keybox).outerHeight()),
left: $(keybox).position().left
})
city_finder.empty().append('<div class="box boxI unselectable" style="font-style;italic">Running</div>');
},
success: function(data) {
ajaxGeoRunning = false;
city_finder.empty().append(data);
if (geoname_id != '')
$('div:not(.unselectable):first', city_finder).addClass('selected');
else
{
var geo_el = $('#geo_' + geoname_id);
if (geo_el.length > 0)
{
geo_el.addClass('selected');
city_finder.scrollTop(city_finder.scrollTop() + geo_el.position().top - ((city_finder.height() - geo_el.outerHeight()) / 2));
}
}
$('div.box:not(.unselectable)', city_finder).bind('mouseover', function() {
$('div.selected', city_finder).removeClass('selected');
$(this).addClass('selected');
}).bind('click', function() {
selectCity(keybox);
});
return false;
}
, error: function() {
return;
}
, timeout: function() {
return;
}
});
return false;
}
function goCity(event, keybox)
{
if (event.keyCode == 13)
{
event.preventDefault();
selectCity(keybox);
return false;
}
}
function selectCity(keybox)
{
var city_finder = $(keybox).parent().find('.geoname_city_finder')
var val = '',
id = '',
el = $('div.selected div:first', city_finder);
if (el.length == 0)
el = false;
else
{
val = el.text();
id = $('div.selected', city_finder).attr('id').substr(4);
}
$(keybox).val(val);
$(keybox).next().val(id);
city_finder.empty();
// $(keybox).trigger('blur');
$(keybox).parent().find('.geoname_city_finder').empty();
}

View File

@@ -0,0 +1,2 @@
@import "variables.less";

View File

@@ -0,0 +1,421 @@
/*
* HTML5 Boilerplate
*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*/
/* ==========================================================================
Base styles: opinionated defaults
========================================================================== */
/*
* Remove text-shadow in selection highlight: h5bp.com/i
* These selection declarations have to be separate.
* Customize the background color to match your design.
*/
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
/*
* A better looking default horizontal rule
*/
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
/*
* Remove the gap between images and the bottom of their containers: h5bp.com/i/440
*/
img {
vertical-align: middle;
}
/*
* Remove default fieldset styles.
*/
fieldset {
border: 0;
margin: 0;
padding: 0;
}
/*
* Allow only vertical resizing of textareas.
*/
textarea {
resize: vertical;
}
/* ==========================================================================
Chrome Frame prompt
========================================================================== */
.chromeframe {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
/* ==========================================================================
Author's custom styles
========================================================================== */
html,
body {
background: @background;
color: @textColor;
-webkit-font-smoothing: antialiased;
text-shadow: 0 0 1px rgba(0,0,0,0.3);
cursor: default;
height: 100%;
}
/** Reset style */
ul {
margin: 0;
padding: 0;
}
/** Button style */
.btn {
@glow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 7px rgba(0, 0, 0, 1);
.glow(@glow);
.border-radius(@borderRadiusSmall);
text-shadow : 0 -1px 0 rgba(0, 0, 0, 0.5);
}
.btn-success {
.gradient (@btnSuccessBackground, 0.7);
}
.btn-info {
.gradient (@btnInfoBackground, 0.7);
}
.btn-success:hover {
.gradient (@btnSuccessBackgroundHighlight, 0.7);
}
.btn-info:hover {
.gradient (@btnInfoBackgroundHighlight, 0.7);
}
.btn-flat {
filter:progid:DXImageTransform.Microsoft.Gradient(enabled='false');
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-image:none;
border:0;
text-shadow: none;
}
/** Helpers style */
.full-height {
height: 100%;
}
.full-width {
width: 100%;
}
.text-error {
color: @colorError;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.one-line {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.no-overflow {
overflow: hidden;
}
.fixed-table {
table-layout: fixed;
width:100%;
}
.rounded {
.border-radius(@borderRadiusSmall);
}
/** Recaptcha style */
#recaptcha_widget .btn-toolbar {
width: 300px;
}
#recaptcha_widget .btn-toolbar .btn {
min-width: 20%;
}
#recaptcha_widget table tr td {
text-align: center;
}
#recaptcha_image {
width: 100% !important;
}
#recaptcha_image img {
width: 100% !important;
}
/** Alert style */
.alert {
padding: 0px;
text-shadow: 0 -1px 0 rgba(0,0,0,.5);
line-height: 16px;
@glow: 0 1px 7px rgba(0, 0, 0, 1);
.glow(@glow);
}
.alert .alert-block-close {
width:45px;
text-align: center;
font-size:36px
}
.alert table {
border-collapse: separate;
}
.alert .alert-block-logo {
width: 45px;
vertical-align: top;
text-align: center;
}
.alert .alert-block-close a:hover {
text-decoration: none;
}
.alert.alert-success .alert-block-content {
border-right: 1px solid lighten(@successBackground, 10%);
}
.alert.alert-success .alert-block-close {
border-left: 1px solid darken(@successBackground, 20%);
}
.alert.alert-error .alert-block-content {
border-right: 1px solid lighten(@errorBackground, 10%);
}
.alert.alert-error .alert-block-close {
border-left: 1px solid darken(@errorBackground, 20%);
}
.alert.alert-info .alert-block-content {
border-right: 1px solid lighten(@infoBackground, 10%);
}
.alert.alert-info .alert-block-close {
border-left: 1px solid darken(@infoBackground, 20%);
}
.alert.alert-warning .alert-block-content {
border-right: 1px solid lighten(@warningBackground, 10%);
}
.alert.alert-warning .alert-block-close {
border-left: 1px solid darken(@warningBackground, 20%);
}
.alert .close {
position: static;
}
.alert table {
table-layout: fixed;
width: 100%;
}
.alert table td {
padding: 9px 5px;
}
/** app css */
.help-block-error {
border: 1px solid @colorError;
}
.well-large {
padding: 20px;
}
.close {
color: @white;
opacity: 1;
}
#main-bar {
margin-top: 40px;
}
.brand .section-title {
color: @grayLight;
}
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"] {
min-height: 30px;
}
legend {
color: @grayLighter;
}
.footer {
padding: 20px 0px;
}
h1, h2, h3, h4 {
font-weight: 100;
}
.content{
min-height: 500px;
}
.url_callback_input input {
margin: 0;
}
/* Landscape phones and down */
@media (max-width: 480px) {
}
/* ==========================================================================
EXAMPLE Media Queries for Responsive Design.
Theses examples override the primary ('mobile first') styles.
Modify as content requires.
========================================================================== */
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
/* Style adjustments for high resolution devices */
}
/* ==========================================================================
Print styles.
Inlined to avoid required HTTP connection: h5bp.com/r
========================================================================== */
@media print {
* {
background: transparent !important;
color: #000 !important; /* Black prints faster: h5bp.com/s */
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
/*
* Don't show links for images, or javascript/internal links
*/
.ir a:after,
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group; /* h5bp.com/t */
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
@page {
margin: 0.5cm;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
}

View File

@@ -0,0 +1,60 @@
// CSS Reset
@import "../../../assets/bootstrap/less/reset.less";
// Core variables and mixins
@import "../../../assets/bootstrap/less/variables.less";
@import "variables.less";
@import "../../../assets/bootstrap/less/mixins.less";
// Grid system and page structure
@import "../../../assets/bootstrap/less/scaffolding.less";
@import "../../../assets/bootstrap/less/grid.less";
@import "../../../assets/bootstrap/less/layouts.less";
// Base CSS
@import "../../../assets/bootstrap/less/type.less";
@import "../../../assets/bootstrap/less/code.less";
@import "../../../assets/bootstrap/less/forms.less";
@import "../../../assets/bootstrap/less/tables.less";
// Components: common
@import "../../../assets/bootstrap/less/sprites.less";
@import "../../../assets/bootstrap/less/dropdowns.less";
@import "../../../assets/bootstrap/less/wells.less";
@import "../../../assets/bootstrap/less/component-animations.less";
@import "../../../assets/bootstrap/less/close.less";
// Components: Buttons & Alerts
@import "../../../assets/bootstrap/less/buttons.less";
@import "../../../assets/bootstrap/less/button-groups.less";
@import "../../../assets/bootstrap/less/alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
// Components: Nav
@import "../../../assets/bootstrap/less/navs.less";
@import "../../../assets/bootstrap/less/navbar.less";
@import "../../../assets/bootstrap/less/breadcrumbs.less";
@import "../../../assets/bootstrap/less/pagination.less";
@import "../../../assets/bootstrap/less/pager.less";
// Components: Popovers
@import "../../../assets/bootstrap/less/modals.less";
@import "../../../assets/bootstrap/less/tooltip.less";
@import "../../../assets/bootstrap/less/popovers.less";
// Components: Misc
@import "../../../assets/bootstrap/less/thumbnails.less";
@import "../../../assets/bootstrap/less/media.less";
@import "../../../assets/bootstrap/less/labels-badges.less";
@import "../../../assets/bootstrap/less/progress-bars.less";
@import "../../../assets/bootstrap/less/accordion.less";
@import "../../../assets/bootstrap/less/carousel.less";
@import "../../../assets/bootstrap/less/hero-unit.less";
// Utility classes
@import "../../../assets/bootstrap/less/utilities.less"; // Has to be last to override when necessary
// Responsive
@import "../../../assets/bootstrap/less/responsive.less";
@import "responsive.less";
@import "skin.less";

View File

@@ -0,0 +1,340 @@
// Variables
// --------------------------------------------------
.glow(@glow) {
box-shadow: @glow;
-webkit-box-shadow: @glow;
-moz-box-shadow: @glow;
}
.gradient (@colorButton, @multiplier){
@colorHsl: lightness(@colorButton) * @multiplier;
background: -moz-linear-gradient(@colorButton, hsl(hue(@colorButton), saturation(@colorButton), @colorHsl)); /* FF 3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @colorButton), color-stop(100%, hsl(hue(@colorButton), saturation(@colorButton), @colorHsl))); /*Safari 4+, Chrome 2+*/
background: -webkit-linear-gradient(@colorButton, hsl(hue(@colorButton), saturation(@colorButton), @colorHsl)); /* Safari 5.1+, Chrome 10+ */
background: -o-linear-gradient(@colorButton, hsl(hue(@colorButton), saturation(@colorButton), @colorHsl)); /* Opera 11.10 */
/* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#ffffff'); IE6 & IE7
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#ffffff')"; IE8+ */
background: linear-gradient(@colorButton, hsl(hue(@colorButton), saturation(@colorButton), @colorHsl)); /* the standard */
}
// Global values
// --------------------------------------------------
// Grays
// -------------------------
@black: #000;
@grayDarker: #222;
@grayDark: #333;
@gray: #555;
@grayLight: #999;
@grayLighter: #eee;
@white: #fff;
// Accent colors
// -------------------------
@blue: #049cdb;
@blueDark: #0064cd;
@green: #46a546;
@red: #9d261d;
@yellow: #ffc40d;
@orange: #f89406;
@pink: #c3325f;
@purple: #7a43b6;
// Own variables
// ----------------------------
@colorError: #af3030;
@colorSuccess: #108946;
@colorFacebook: #3b5a97;
@colorGooglePlus: #ba2828;
@colorViadeo: #242424;
@colorTwitter: #2fa3dc;
@colorLinkedin: #025b8e;
@colorGithub: #908c8b;
@backgroundSideBar: #1a1a1a;
@background: #141414;
@defaultFontFamily: 'tahoma', lucida grande,verdana,arial,sans-serif;
@sideBarGlow: 0 0 15px rgba(0, 0, 0, 1);
@dropDownLanguageGlow: 0 0 15px rgba(0, 0, 0, 1);
@sideBarBlockBorderColorBottom: @black;
@sideBarBlockBorderColorTop: #232222;
@identityPhraseanetBackgroundColor: #f2f2f2;
@identityPhraseanetColor: #323232;
@identityPhraseanetIconColor: #b3b3b3;
@languageCaretColor: @white;
// Scaffolding
// -------------------------
@bodyBackground: @background;
@textColor: @white;
// Links
// -------------------------
@linkColor: #08c;
@linkColorHover: darken(@linkColor, 15%);
// Typography
// -------------------------
@sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;
@serifFontFamily: Georgia, "Times New Roman", Times, serif;
@monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace;
@baseFontSize: 14px;
@baseFontFamily: @defaultFontFamily;
@baseLineHeight: 20px;
@altFontFamily: @serifFontFamily;
@headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily
@headingsFontWeight: bold; // instead of browser default, bold
@headingsColor: inherit; // empty to use BS default, @textColor
// Component sizing
// -------------------------
// Based on 14px font-size and 20px line-height
@fontSizeLarge: @baseFontSize * 1.25; // ~18px
@fontSizeSmall: @baseFontSize * 0.85; // ~12px
@fontSizeMini: @baseFontSize * 0.75; // ~11px
@paddingLarge: 11px 19px; // 44px
@paddingSmall: 2px 10px; // 26px
@paddingMini: 0 6px; // 22px
@baseBorderRadius: 4px;
@borderRadiusLarge: 6px;
@borderRadiusSmall: 3px;
// Tables
// -------------------------
@tableBackground: transparent; // overall background-color
@tableBackgroundAccent: lighten(@background, 5%); // for striping
@tableBackgroundHover: #f5f5f5; // for hover
@tableBorder: #ddd; // table and cell border
// Buttons
// -------------------------
@btnBackground: @white;
@btnBackgroundHighlight: darken(@white, 10%);
@btnBorder: #bbb;
@btnPrimaryBackground: lighten(@background, 15%);
@btnPrimaryBackgroundHighlight: darken(@background, 10%);
@btnInfoBackground: #1c607f;
@btnInfoBackgroundHighlight: darken(@btnInfoBackground, 10%);
@btnSuccessBackground: #1ea062;
@btnSuccessBackgroundHighlight: darken(@btnSuccessBackground, 10%);
@btnWarningBackground: lighten(@orange, 15%);
@btnWarningBackgroundHighlight: @orange;
@btnDangerBackground: #ee5f5b;
@btnDangerBackgroundHighlight: #bd362f;
@btnInverseBackground: #444;
@btnInverseBackgroundHighlight: @grayDarker;
// Forms
// -------------------------
@inputBackground: @white;
@inputBorder: lighten(@background, 5%);
@inputBorderRadius: @baseBorderRadius;
@inputDisabledBackground: @grayLighter;
@formActionsBackground: @background;
@inputHeight: 30px; // base line-height + 8px vertical padding + 2px top/bottom border
// Dropdowns
// -------------------------
@dropdownBackground: @backgroundSideBar;
@dropdownBorder: rgba(0,0,0,.2);
@dropdownDividerTop: #e5e5e5;
@dropdownDividerBottom: @white;
@dropdownLinkColor: @white;
@dropdownLinkColorHover: @gray;
@dropdownLinkColorActive: @white;
@dropdownLinkBackgroundActive: @linkColor;
@dropdownLinkBackgroundHover: @dropdownLinkBackgroundActive;
// COMPONENT VARIABLES
// --------------------------------------------------
// Z-index master list
// -------------------------
// Used for a bird's eye view of components dependent on the z-axis
// Try to avoid customizing these :)
@zindexDropdown: 1000;
@zindexPopover: 1010;
@zindexTooltip: 1030;
@zindexFixedNavbar: 1030;
@zindexModalBackdrop: 1040;
@zindexModal: 1050;
// Sprite icons path
// -------------------------
@iconSpritePath: "../img/glyphicons-halflings.png";
@iconWhiteSpritePath: "../img/glyphicons-halflings-white.png";
// Input placeholder text color
// -------------------------
@placeholderText: @grayLight;
// Hr border color
// -------------------------
@hrBorder: @grayLighter;
// Horizontal forms , lists
// -------------------------
@horizontalComponentOffset: 180px;
// Wells
// -------------------------
@wellBackground: #f5f5f5;
// Navbar
// -------------------------
@navbarCollapseWidth: 979px;
@navbarCollapseDesktopWidth: @navbarCollapseWidth + 1;
@navbarHeight: 40px;
@navbarBackgroundHighlight: lighten(@background, 5%);
@navbarBackground: @background;
@navbarBorder: darken(@navbarBackground, 12%);
@navbarText: @white;
@navbarLinkColor: @linkColor;
@navbarLinkColorHover: @white;
@navbarLinkColorActive: @linkColor;
@navbarLinkBackgroundHover: @background;
@navbarLinkBackgroundActive: lighten(@background, 15%);
@navbarBrandColor: @white;
// Inverted navbar
@navbarInverseBackground: #111111;
@navbarInverseBackgroundHighlight: #222222;
@navbarInverseBorder: #252525;
@navbarInverseText: @grayLight;
@navbarInverseLinkColor: @grayLight;
@navbarInverseLinkColorHover: @white;
@navbarInverseLinkColorActive: @navbarInverseLinkColorHover;
@navbarInverseLinkBackgroundHover: transparent;
@navbarInverseLinkBackgroundActive: @navbarInverseBackground;
@navbarInverseSearchBackground: lighten(@navbarInverseBackground, 25%);
@navbarInverseSearchBackgroundFocus: @white;
@navbarInverseSearchBorder: @navbarInverseBackground;
@navbarInverseSearchPlaceholderColor: #ccc;
@navbarInverseBrandColor: @navbarInverseLinkColor;
// Pagination
// -------------------------
@paginationBackground: #fff;
@paginationBorder: #ddd;
@paginationActiveBackground: #f5f5f5;
// Hero unit
// -------------------------
@heroUnitBackground: @grayLighter;
@heroUnitHeadingColor: inherit;
@heroUnitLeadColor: inherit;
// Form states and alerts
// -------------------------
@warningText: @white;
@warningBackground: @grayDark;
@warningBorder: darken(spin(@warningBackground, -10), 3%);
@errorText: @white;
@errorBackground: #c9322b;
@errorBorder: darken(spin(@errorBackground, -10), 3%);
@successText: @white;
@successBackground: #1f914f;
@successBorder: darken(spin(@successBackground, -10), 5%);
@infoText: @white;
@infoBackground: #4889af;
@infoBorder: darken(spin(@infoBackground, -10), 7%);
// Tooltips and popovers
// -------------------------
@tooltipColor: #fff;
@tooltipBackground: #000;
@tooltipArrowWidth: 5px;
@tooltipArrowColor: @tooltipBackground;
@popoverBackground: #fff;
@popoverArrowWidth: 10px;
@popoverArrowColor: #fff;
@popoverTitleBackground: darken(@popoverBackground, 3%);
// Special enhancement for popovers
@popoverArrowOuterWidth: @popoverArrowWidth + 1;
@popoverArrowOuterColor: rgba(0,0,0,.25);
// GRID
// --------------------------------------------------
// Default 940px grid
// -------------------------
@gridColumns: 12;
@gridColumnWidth: 60px;
@gridGutterWidth: 20px;
@gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
// 1200px min
@gridColumnWidth1200: 70px;
@gridGutterWidth1200: 30px;
@gridRowWidth1200: (@gridColumns * @gridColumnWidth1200) + (@gridGutterWidth1200 * (@gridColumns - 1));
// 768px-979px
@gridColumnWidth768: 42px;
@gridGutterWidth768: 20px;
@gridRowWidth768: (@gridColumns * @gridColumnWidth768) + (@gridGutterWidth768 * (@gridColumns - 1));
// Fluid grid
// -------------------------
@fluidGridColumnWidth: percentage(@gridColumnWidth/@gridRowWidth);
@fluidGridGutterWidth: percentage(@gridGutterWidth/@gridRowWidth);
// 1200px min
@fluidGridColumnWidth1200: percentage(@gridColumnWidth1200/@gridRowWidth1200);
@fluidGridGutterWidth1200: percentage(@gridGutterWidth1200/@gridRowWidth1200);
// 768px-979px
@fluidGridColumnWidth768: percentage(@gridColumnWidth768/@gridRowWidth768);
@fluidGridGutterWidth768: percentage(@gridGutterWidth768/@gridRowWidth768);