mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Use path() method to genrate url in view && clean JS code
Fix terms of use paths
This commit is contained in:
committed by
Romain Neutron
parent
10f8569dde
commit
099dfc311d
@@ -1,13 +1,13 @@
|
|||||||
{% extends 'account/base.html.twig' %}
|
{% extends "account/base.html.twig" %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans 'Granted bases' %}
|
{% trans "Granted bases" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% set selected = "access" %}
|
{% set selected = "access" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form name="updatingDemand" id="updatingDemand" action="/account/" method="post">
|
<form name="updatingDemand" id="updatingDemand" action="{{ path("submit_update_account") }}" method="post">
|
||||||
<table style="table-layout: fixed; width:100%">
|
<table style="table-layout: fixed; width:100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 180px; text-align: right"> </td>
|
<td style="width: 180px; text-align: right"> </td>
|
||||||
@@ -15,21 +15,21 @@
|
|||||||
<td style="width: 180px;"> </td>
|
<td style="width: 180px;"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
{% for sbasId, baseInsc in inscriptions %}
|
{% 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'] %}
|
{% 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>
|
<tr>
|
||||||
<td colspan="3" style="text-align: center;"><h3>{{ sbasId | sbas_names(app) }}</h3></td>
|
<td colspan="3" style="text-align: center;"><h3>{{ sbasId | sbas_names(app) }}</h3></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if baseInsc['CollsRegistered'] is not none %}
|
{% if baseInsc["CollsRegistered"] is not none %}
|
||||||
{% for base in baseInsc['CollsRegistered']%}
|
{% for base in baseInsc["CollsRegistered"]%}
|
||||||
{% for collId, isTrue in base %}
|
{% for collId, isTrue in base %}
|
||||||
{% 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) }}
|
{% trans "login::register: acces authorise sur la collection " %}{{ sbasId |sbas_names(app) }}
|
||||||
{% 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="{{ path('get_tou', {'to_display[]' : sbasId}) }}">{% trans "login::register::CGU: lire les CGU" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -41,14 +41,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if baseInsc['CollsRefuse'] %}
|
{% if baseInsc["CollsRefuse"] %}
|
||||||
{% for collId, isTrue in 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;">
|
||||||
<span style="color: red;">{% trans 'login::register: acces refuse sur la collection ' %}{{ sbasId |sbas_names(app) }}</span>
|
<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="{{ path('get_tou', {'to_display[]' : sbasId}) }}">{% trans "login::register::CGU: lire les CGU" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -59,14 +59,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if baseInsc['CollsWait'] %}
|
{% if baseInsc["CollsWait"] %}
|
||||||
{% for collId, isTrue in 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>
|
<tr>
|
||||||
<td colspan="3" style="text-align: center;">
|
<td colspan="3" style="text-align: center;">
|
||||||
<span style="color: orange;">{% trans 'login::register: en attente d\'acces sur' %} {{ sbasId |sbas_names(app) }}</span>
|
<span style="color: orange;">{% trans "login::register: en attente d\'acces sur" %} {{ 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="{{ path('get_tou', {'to_display[]' : sbasId}) }}">{% trans "login::register::CGU: lire les CGU" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -74,14 +74,14 @@
|
|||||||
<tr style="height: 5px;"><td></td></tr>
|
<tr style="height: 5px;"><td></td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if baseInsc['CollsIntime'] %}
|
{% if baseInsc["CollsIntime"] %}
|
||||||
{% for collId, isTrue in baseInsc['CollsIntime'] %}
|
{% for collId, isTrue in baseInsc["CollsIntime"] %}
|
||||||
{% 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;">
|
||||||
<span>{% trans 'login::register: acces temporaire sur' %} {{ sbasId |sbas_names(app) }}</span>
|
<span>{% trans "login::register: acces temporaire sur" %} {{ 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="{{ path('get_tou', {'to_display[]' : sbasId}) }}">{% trans "login::register::CGU: lire les CGU" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -89,14 +89,14 @@
|
|||||||
<tr style="height: 5px;"><td></td></tr>
|
<tr style="height: 5px;"><td></td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if baseInsc['CollsOuttime'] %}
|
{% if baseInsc["CollsOuttime"] %}
|
||||||
{% for collId, isTrue in baseInsc['CollsOuttime'] %}
|
{% for collId, isTrue in baseInsc["CollsOuttime"] %}
|
||||||
{% 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;">
|
||||||
<span style="color:red;">{% trans 'login::register: acces temporaire termine sur ' %}{{ sbasId |sbas_names(app) }}</span>
|
<span style="color:red;">{% trans "login::register: acces temporaire termine sur " %}{{ 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="{{ path('get_tou', {'to_display[]' : sbasId}) }}">{% trans "login::register::CGU: lire les CGU" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -104,14 +104,14 @@
|
|||||||
<tr style="height: 5px;"><td></td></tr>
|
<tr style="height: 5px;"><td></td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if baseInsc['CollsNonactif'] %}
|
{% if baseInsc["CollsNonactif"] %}
|
||||||
{% for collId, isTrue in baseInsc['CollsNonactif'] %}
|
{% for collId, isTrue in baseInsc["CollsNonactif"] %}
|
||||||
{% 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;">
|
||||||
<span style="color:red;">{% trans 'login::register: acces supendu sur' %} {{ sbasId |sbas_names(app) }}</span>
|
<span style="color:red;">{% trans "login::register: acces supendu sur" %} {{ 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="{{ path('get_tou', {'to_display[]' : sbasId}) }}">{% trans "login::register::CGU: lire les CGU" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -119,48 +119,48 @@
|
|||||||
<tr style="height: 5px;"><td></td></tr>
|
<tr style="height: 5px;"><td></td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if (baseInsc['CollsCGU'] or baseInsc['Colls']) and baseInsc['inscript'] %}
|
{% if (baseInsc["CollsCGU"] or baseInsc["Colls"]) and baseInsc["inscript"] %}
|
||||||
{% if baseInsc['Colls'] %}
|
{% if baseInsc["Colls"] %}
|
||||||
{% if baseInsc['CGU'] %}
|
{% if baseInsc["CGU"] %}
|
||||||
<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>
|
<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>
|
<tr>
|
||||||
<td colspan="3" style="text-align: center;"><div style="width: 90%; height: 120px; text-align: left; overflow: auto;">{{ baseInsc['CGU'] }}</div></td>
|
<td colspan="3" style="text-align: center;"><div style="width: 90%; height: 120px; text-align: left; overflow: auto;">{{ baseInsc["CGU"] }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for collId, collName in baseInsc['Colls'] %}
|
{% for collId, collName in baseInsc["Colls"] %}
|
||||||
{% set base_id = sbasId |base_from_coll(collId, app) %}
|
{% set base_id = sbasId |base_from_coll(collId, app) %}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: right;">{{ collName }}</td>
|
<td style="text-align: right;">{{ collName }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="TD_R" style="width: 200px;">
|
<td class="TD_R" style="width: 200px;">
|
||||||
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
|
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
|
||||||
<span>{% trans 'login::register: Faire une demande d\'acces' %}</span>
|
<span>{% trans "login::register: Faire une demande d\'acces" %}</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if baseInsc['CollsCGU'] %}
|
{% if baseInsc["CollsCGU"] %}
|
||||||
{% for collId, collDesc in baseInsc['CollsCGU'] %}
|
{% for collId, collDesc in baseInsc["CollsCGU"] %}
|
||||||
{% 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;"><hr style="width: 80%"/></td>
|
<td colspan="3" style="text-align: center;"><hr style="width: 80%"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
<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>
|
<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>
|
<div style="width: 90%; height: 120px; text-align: left; overflow: auto;">{{ collDesc["CGU"] }}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: right;">{{ collDesc['name'] }}</td>
|
<td style="text-align: right;">{{ collDesc["name"] }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="TD_R" style="width: 200px;">
|
<td class="TD_R" style="width: 200px;">
|
||||||
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
|
<input style="width: 15px;" class="checkbox" type="checkbox" name="demand[]" value="{{ base_id }}" />
|
||||||
<span>{% trans 'login::register: Faire une demande d\'acces' %}</span>
|
<span>{% trans "login::register: Faire une demande d\'acces" %}</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<input type="submit" class="btn btn-primary" value="{% trans 'boutton::valider' %}">
|
<input type="submit" class="btn btn-info" value="{% trans "boutton::valider" %}">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends 'account/base.html.twig' %}
|
{% extends "account/base.html.twig" %}
|
||||||
|
|
||||||
{% import "login/common/macros.html.twig" as auth_macro %}
|
{% import "login/common/macros.html.twig" as auth_macro %}
|
||||||
|
|
||||||
@@ -9,221 +9,224 @@
|
|||||||
<script type="text/javascript" src="/include/minify/f=/skins/geonames/geonames.js"></script>
|
<script type="text/javascript" src="/include/minify/f=/skins/geonames/geonames.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
initialize_geoname_field($('#form_geonameid'));
|
initialize_geoname_field($("#form_geonameid"));
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans 'login:: Mon compte' %}
|
{% trans "login:: Mon compte" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12" id="phr-account">
|
<div class="span12">
|
||||||
{% if notice | trim != '' %}
|
{% if notice | trim != "" %}
|
||||||
<div class="notice alert alert-error">{{ notice }}</div>
|
<div class="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">
|
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
|
<form name="account" id="account" class="form-horizontal" action="{{ path("submit_update_account") }}" method="post">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12 well well-small" id="phr-account">
|
||||||
|
<legend>{% trans "Informations personnelles" %}</legend>
|
||||||
<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"><strong>{% trans "admin::compte-utilisateur identifiant" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<p>{{ app['authentication'].getUser().get_login() }}</p>
|
<span class="control-span">{{ app["authentication"].getUser().get_login() }}</span>
|
||||||
<p class="form_alert help-block"></p>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_gender">{% trans 'admin::compte-utilisateur sexe' %}</label>
|
<label class="form_label control-label" for="form_gender"><strong>{% trans "admin::compte-utilisateur sexe" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select class="input-xlarge">
|
<select class="input-xlarge">
|
||||||
<option {% if app['authentication'].getUser().get_gender() == "0" %}selected{% endif %} value="0" >
|
<option {% if app["authentication"].getUser().get_gender() == "0" %}selected{% endif %} value="0" >
|
||||||
{% trans 'admin::compte-utilisateur:sexe: mademoiselle' %}
|
{% trans "admin::compte-utilisateur:sexe: mademoiselle" %}
|
||||||
</option>
|
</option>
|
||||||
<option {% if app['authentication'].getUser().get_gender() == "1" %}selected{% endif %} value="1" >
|
<option {% if app["authentication"].getUser().get_gender() == "1" %}selected{% endif %} value="1" >
|
||||||
{% trans 'admin::compte-utilisateur:sexe: madame' %}
|
{% trans "admin::compte-utilisateur:sexe: madame" %}
|
||||||
</option>
|
</option>
|
||||||
<option {% if app['authentication'].getUser().get_gender() == "2" %}selected{% endif %} value="2" >
|
<option {% if app["authentication"].getUser().get_gender() == "2" %}selected{% endif %} value="2" >
|
||||||
{% trans 'admin::compte-utilisateur:sexe: monsieur' %}
|
{% trans "admin::compte-utilisateur:sexe: monsieur" %}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="form_alert help-block"></p>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_lastname">{% trans 'admin::compte-utilisateur nom' %}</label>
|
<label class="form_label control-label" for="form_lastname"><strong>{% trans "admin::compte-utilisateur nom" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_lastname" id="form_lastname" value="{{ app['authentication'].getUser().get_lastname() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label>
|
<label class="form_label control-label" for="form_firstname"><strong>{% trans "admin::compte-utilisateur prenom" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_firstname" id="form_firstname" value="{{ app['authentication'].getUser().get_firstname() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur email' %}</label>
|
<label class="form_label control-label" for="form_firstname"><strong>{% trans "admin::compte-utilisateur email" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<p>{{ app['authentication'].getUser().get_email() }} <a href="/account/reset-email/" target="_self">{% trans 'login:: Changer mon adresse email' %}</a></p>
|
<span class="control-span">{{ app["authentication"].getUser().get_email() }} <a href="{{ path("account_reset_email") }}" target="_self">{% trans "login:: Changer mon adresse email" %}</a></span>
|
||||||
<p class="form_alert help-block"></p>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_address">{% trans 'admin::compte-utilisateur adresse' %}</label>
|
<label class="control-label"><strong>{% trans "Password" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_address" id="form_address" value="{{ app['authentication'].getUser().get_address() }}" />
|
<span class="control-span"><a href="{{ path("reset_password") }}" target="_self">{% trans "admin::compte-utilisateur changer mon mot de passe" %}</a></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="form_label control-label" for="form_address"><strong>{% trans "admin::compte-utilisateur adresse" %}</strong></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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_zip">{% trans 'admin::compte-utilisateur code postal' %}</label>
|
<label class="form_label control-label" for="form_zip"><strong>{% trans "admin::compte-utilisateur code postal" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_zip" id="form_zip" value="{{ app['authentication'].getUser().get_zipcode() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_city">{% trans 'admin::compte-utilisateur ville' %}</label>
|
<label class="form_label control-label" for="form_city"><strong>{% trans "admin::compte-utilisateur ville" %}</strong></label>
|
||||||
<div class="controls">
|
<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()) }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label"></label>
|
<label class="form_label control-label" for="form_function"><strong>{% trans "admin::compte-utilisateur poste" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div id="test_city" style="position: absolute; width: 200px; max-height: 200px; overflow-y: auto; z-index: 99999;"></div>
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_function">{% trans 'admin::compte-utilisateur poste' %}</label>
|
<label class="form_label control-label" for="form_company"><strong>{% trans "admin::compte-utilisateur societe" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_function" id="form_function" value="{{ app['authentication'].getUser().get_position() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_company">{% trans 'admin::compte-utilisateur societe' %}</label>
|
<label class="form_label control-label" for="form_activity"><strong>{% trans "admin::compte-utilisateur activite" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_company" id="form_company" value="{{ app['authentication'].getUser().get_company() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_activity">{% trans 'admin::compte-utilisateur activite' %}</label>
|
<label class="form_label control-label" for="form_phone"><strong>{% trans "admin::compte-utilisateur telephone" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_activity" id="form_activity" value="{{ app['authentication'].getUser().get_job() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_phone">{% trans 'admin::compte-utilisateur telephone' %}</label>
|
<label class="form_label control-label" for="form_fax"><strong>{% trans "admin::compte-utilisateur fax" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_phone" id="form_phone" value="{{ app['authentication'].getUser().get_tel() }}" />
|
<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>
|
|
||||||
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<legend>{% trans 'Notification par email' %}</legend>
|
<legend>{% trans "Notification par email" %}</legend>
|
||||||
|
|
||||||
{% for notification_group, nots in notifications%}
|
{% for notification_group, nots in notifications%}
|
||||||
<p style="font-weight: bold;">{{ notification_group }}</p>
|
|
||||||
{% for notification in nots %}
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label"></label>
|
<span class="pull-left"><strong>{{ notification_group }}</strong></span>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label class="checkbox" for="notif_{{ notification['id'] }}">
|
<ul class="unstyled well">
|
||||||
<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"/>
|
{% for notification in nots %}
|
||||||
{{ notification['description'] }}
|
<li>
|
||||||
|
<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>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<legend>{% trans "FTP" %}</legend>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<label class="form_label checkbox" for="form_activeFTP">{% trans "admin::compte-utilisateur:ftp: Activer le compte FTP" %}
|
||||||
|
<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();}" />
|
||||||
</label>
|
</label>
|
||||||
<p class="form_alert help-block"></p>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
<legend>{% trans 'FTP' %}</legend>
|
|
||||||
|
|
||||||
|
<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"><strong>{% trans "phraseanet:: adresse" %}</strong></label>
|
||||||
<div class="controls">
|
<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();}" />
|
<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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="ftpinfos" style="display: {% if app['authentication'].getUser().get_activeftp() %}block{% else %}none{% endif %}">
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="form_label control-label" for="form_addrFTP">{% trans 'phraseanet:: adresse' %}</label>
|
|
||||||
<div class="controls">
|
|
||||||
<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 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_loginFTP"><strong>{% trans "admin::compte-utilisateur identifiant" %}</strong></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 input-xlarge" type="text" name="form_loginFTP" id="form_loginFTP" value="{{ app["authentication"].getUser().get_ftp_login() }}" />
|
||||||
<p class="form_alert help-block"></p>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_pwdFTP">{% trans 'admin::compte-utilisateur mot de passe' %}</label>
|
<label class="form_label control-label" for="form_pwdFTP"><strong>{% trans "admin::compte-utilisateur mot de passe" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_pwdFTP" id="form_pwdFTP" value="{{ app['authentication'].getUser().get_ftp_password() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_destFTP">{% trans 'admin::compte-utilisateur:ftp: repertoire de destination ftp' %}</label>
|
<label class="form_label control-label" for="form_destFTP"><strong>{% trans "admin::compte-utilisateur:ftp: repertoire de destination ftp" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_destFTP" id="form_destFTP" value="{{ app['authentication'].getUser().get_ftp_dir() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<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>
|
<label class="form_label control-label" for="form_prefixFTPfolder"><strong>{% trans "admin::compte-utilisateur:ftp: prefixe des noms de dossier ftp" %}</strong></label>
|
||||||
<div class="controls">
|
<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() }}" />
|
<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>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<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">
|
<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 %} />
|
<label class="form_label checkbox" for="form_passifFTP">
|
||||||
|
{% trans "admin::compte-utilisateur:ftp: Utiliser le mode passif" %}
|
||||||
|
<input class="input_element input-xlarge" type="checkbox" name="form_passifFTP" id="form_passifFTP" {% if app["authentication"].getUser().get_ftp_passif() == "1" %}checked{% endif %} />
|
||||||
|
</label>
|
||||||
<p class="form_alert help-block"></p>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_retryFTP">{% trans 'admin::compte-utilisateur:ftp: Nombre d\'essais max' %}</label>
|
<label class="form_label control-label" for="form_retryFTP"><strong>{% trans "admin::compte-utilisateur:ftp: Nombre d\'essais max" %}</strong></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_element input-xlarge" type="text" name="form_retryFTP" id="form_retryFTP" value="5" />
|
<input class="input_element input-xlarge" type="text" name="form_retryFTP" id="form_retryFTP" value="5" />
|
||||||
<p class="form_alert help-block"></p>
|
<p class="form_alert help-block"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-actions" style="background-color: transparent;">
|
<div class="form-actions">
|
||||||
<input type="submit" class="btn btn-primary" value="{% trans 'boutton::valider' %}">
|
<input type="submit" class="btn btn-info btn-" value="{% trans "boutton::valider" %}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,102 +1,67 @@
|
|||||||
{% extends 'account/base.html.twig' %}
|
{% extends "account/base.html.twig" %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans 'Granted third party applications' %}
|
{% trans "Granted third party applications" %}
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function(){
|
|
||||||
$(".app-btn").live("click", function(){
|
|
||||||
var $this = $(this);
|
|
||||||
|
|
||||||
if (!$this.hasClass("authorize")) {
|
|
||||||
var revoke = 1;
|
|
||||||
var button_class = "authorize";
|
|
||||||
var old_class ="revoke";
|
|
||||||
var string = "{% trans 'Authoriser l\'access' %}";
|
|
||||||
} else {
|
|
||||||
var revoke = 0;
|
|
||||||
var button_class = "revoke";
|
|
||||||
var old_class ="authorize";
|
|
||||||
var string = "{% trans 'Revoquer l\'access' %}";
|
|
||||||
}
|
|
||||||
|
|
||||||
var app_id = $this.attr("value");
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type:"GET",
|
|
||||||
url : '/account/security/application/' + app_id + '/grant/',
|
|
||||||
dataType: 'json',
|
|
||||||
data : {
|
|
||||||
revoke : revoke
|
|
||||||
},
|
|
||||||
success : function(data){
|
|
||||||
if(data.success)
|
|
||||||
{
|
|
||||||
$this.removeClass(old_class).addClass(button_class);
|
|
||||||
$this.empty().append(string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% set selected = "applications" %}
|
{% set selected = "applications" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<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='unstyled 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 %}
|
<a href="{{ path("grant_app_access", {"application_id" : application.get_id()}) }}" class="revoke app-btn btn btn-small pull-right {% if account.is_revoked() is empty %}hidden{% endif %}" value="{{application.get_id()}}">{% trans "Revoquer l\'access" %}</a>
|
||||||
<button type='button' class='revoke app-btn btn btn-small' value='{{application.get_id()}}'>{% trans 'Revoquer l\'access' %}</button>
|
<a href="{{ path("grant_app_access", {"application_id" : application.get_id()}) }}" class="authorize app-btn btn btn-small pull-right {% if account.is_revoked() is not empty %}hidden{% endif %}" value="{{application.get_id()}}">{% trans "Authoriser l\'access" %}</a>
|
||||||
{% else %}
|
<p class="app-row">
|
||||||
<button type='button' class='authorize app-btn btn btn-small' value='{{application.get_id()}}'>{% trans 'Authoriser l\'access' %}</button>
|
<a href="{{ application.get_website() }}" target="_blank">
|
||||||
{% endif %}
|
<strong>{{ application.get_name() }}</strong>
|
||||||
<span class='app-row'>
|
|
||||||
<a href="{{application.get_website()}}" target="_blank">
|
|
||||||
<strong>{{application.get_name()}}</strong>
|
|
||||||
</a>
|
</a>
|
||||||
{% if application.get_creator() is not none %}
|
{% if application.get_creator() is not none %}
|
||||||
|
<small>
|
||||||
{% 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 %}
|
||||||
|
</small>
|
||||||
{% endif%}
|
{% endif%}
|
||||||
</span>
|
</p>
|
||||||
<span class='app-row'>
|
<p class="app-row">
|
||||||
<font size="1"><i>{{ app['date-formatter'].getPrettyString(application.get_created_on()) }}</i></font>
|
<span class="status text-error {% if account.is_revoked() is not empty %}hidden{% endif %}">{% trans "Not Allowed"%}</span>
|
||||||
</span>
|
<span class="status text-success {% if account.is_revoked() is empty %}hidden{% endif %}">{% trans "Allowed"%}</span>
|
||||||
<span class='app-row'>{{ application.get_description()|truncate(80, true, '...') }}</span>
|
</p>
|
||||||
|
<p class="app-row">{{ application.get_description()|truncate(120, true, "...") }}</p>
|
||||||
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<h3>{% trans 'Applications' %}</h3>
|
<div class="well well-small">
|
||||||
|
<h3>{% trans "Third-party applications" %}</h3>
|
||||||
<p>
|
<p>
|
||||||
{% trans 'Naviguez et gerez les applications que vous souhaitez autoriser a acceder a vos informations Phraseanet' %}
|
{% trans "A third-party application is a product developed apart from Phraseanet and that would access Phraseanet data." %}
|
||||||
</p>
|
|
||||||
<h3>{% trans 'Developpeurs' %}</h3>
|
|
||||||
<p>
|
|
||||||
{% trans 'Les developpeurs peuvent editer l\'enregistrement de leurs application grace a l\'onglet "developpeurs" ci-dessus' %}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div class="well well-small">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<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/build/account.css"/>
|
<link rel="stylesheet" type="text/css" href="/include/minify/f=/skins/build/account.css"/>
|
||||||
<script type="text/javascript" language="javascript" src="/include/minify/f=/assets/jquery/jquery.js,/assets/bootstrap/js/bootstrap-modal.js"></script>
|
<script type="text/javascript" language="javascript" src="/include/minify/f=/assets/jquery/jquery.js,/assets/bootstrap/js/bootstrap-modal.js,/skins/account/account.js"></script>
|
||||||
{% block head %}{% endblock %}
|
{% block head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -13,13 +13,13 @@
|
|||||||
{% block menu %}
|
{% block menu %}
|
||||||
<div id="main-bar" class="navbar">
|
<div id="main-bar" class="navbar">
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<span class="brand">{{ app['phraseanet.registry'].get('GV_homeTitle') }}<span class="section-title"> {{ block('title') }}</span></span>
|
<span class="brand">{{ app["phraseanet.registry"].get("GV_homeTitle") }}<span class="section-title"> {{ block("title") }}</span></span>
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<li {% if selected == "informations" %}class="active"{% endif %}><a href="/account/">{% trans 'Informations' %}</a></li>
|
<li {% if selected == "informations" %}class="active"{% endif %}><a href="{{ path("account") }}">{% trans "Informations" %}</a></li>
|
||||||
<li {% if selected == "access" %}class="active"{% endif %}><a href="/account/access/">{% trans 'Acces' %}</a></li>
|
<li {% if selected == "access" %}class="active"{% endif %}><a href="{{ path("account_access") }}">{% trans "Acces" %}</a></li>
|
||||||
<li {% if selected == "sessions" %}class="active"{% endif %}><a href="/account/security/sessions/">{% trans 'Sessions' %}</a></li>
|
<li {% if selected == "sessions" %}class="active"{% endif %}><a href="{{ path("account_sessions") }}">{% trans "Sessions" %}</a></li>
|
||||||
<li {% if selected == "applications" %}class="active"{% endif %}><a href="/account/security/applications/">{% trans 'Applications' %}</a></li>
|
<li {% if selected == "applications" %}class="active"{% endif %}><a href="{{ path("account_auth_apps") }}">{% trans "Applications" %}</a></li>
|
||||||
<li {% if selected == "developer" %}class="active"{% endif %}><a href="/developers/applications/">{% trans 'Developpeur' %}</a></li>
|
<li {% if selected == "developer" %}class="active"{% endif %}><a href="{{ path("developers_applications") }}">{% trans "Developpeur" %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% extends 'account/base.html.twig' %}
|
{% extends "account/base.html.twig" %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans 'Change my email address' %}
|
{% trans "Change my email address" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
@@ -20,25 +20,25 @@ $(document).ready(function() {
|
|||||||
},
|
},
|
||||||
form_email_confirm : {
|
form_email_confirm : {
|
||||||
required:true,
|
required:true,
|
||||||
equalTo:'#form_email'
|
equalTo:"#form_email"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
form_password : {
|
form_password : {
|
||||||
required : "{% trans 'forms::ce champ est requis' %}"
|
required : "{% trans "forms::ce champ est requis" %}"
|
||||||
},
|
},
|
||||||
form_email : {
|
form_email : {
|
||||||
required : "{% trans 'forms::ce champ est requis' %}",
|
required : "{% trans "forms::ce champ est requis" %}",
|
||||||
email:"{% trans 'forms::l\'email semble invalide' %}"
|
email:"{% trans "forms::l\'email semble invalide" %}"
|
||||||
},
|
},
|
||||||
form_email_confirm : {
|
form_email_confirm : {
|
||||||
required : "{% trans 'forms::ce champ est requis' %}",
|
required : "{% trans "forms::ce champ est requis" %}",
|
||||||
equalTo : "{% trans 'forms::les emails ne correspondent pas' %}"
|
equalTo : "{% trans "forms::les emails ne correspondent pas" %}"
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
errorPlacement: function(error, element) {
|
errorPlacement: function(error, element) {
|
||||||
error.appendTo(element.closest('.controls').find('.form_alert'));
|
error.appendTo(element.closest(".controls").find(".form_alert"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -52,58 +52,58 @@ $(document).ready(function() {
|
|||||||
{% 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="{{ path("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">
|
||||||
{% trans 'phraseanet::erreur : oups ! une erreur est survenue pendant l\'operation !' %}
|
{% trans "phraseanet::erreur : oups ! une erreur est survenue pendant l\'operation !" %}
|
||||||
</div>
|
</div>
|
||||||
<div class="notice" style="text-align:center;margin:20px 0">
|
<div class="notice" style="text-align:center;margin:20px 0">
|
||||||
{{ noticeMsg }}
|
{{ noticeMsg }}
|
||||||
</div>
|
</div>
|
||||||
<a href="/account/" target="_self">{% trans 'admin::compte-utilisateur retour a mon compte'%}</a>
|
<a href="{{ path("reset_password") }}" target="_self">{% trans "admin::compte-utilisateur retour a mon compte" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<form method="POST" action="/account/reset-email/" id="mainform" class="form-horizontal">
|
<form method="POST" action="{{ path("reset_email") }}" id="mainform" class="form-horizontal">
|
||||||
<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 style="line-height: 30px;">{{ 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>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_password">{% trans 'admin::compte-utilisateur mot de passe' %}</label>
|
<label class="form_label control-label" for="form_password">{% trans "admin::compte-utilisateur mot de passe" %}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="password" id="form_password" name="form_password" autocomplete="off" />
|
<input type="password" id="form_password" name="form_password" autocomplete="off" />
|
||||||
{#<p class="form_alert help-block"><?php echo isset($needed['form_password']) ? $needed['form_password'] : '' ?></p>#}
|
{#<p class="form_alert help-block"><?php echo isset($needed["form_password"]) ? $needed["form_password"] : "" ?></p>#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_email">{% trans 'admin::compte-utilisateur nouvelle adresse email' %}</label>
|
<label class="form_label control-label" for="form_email">{% trans "admin::compte-utilisateur nouvelle adresse email" %}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="form_email" name="form_email" />
|
<input type="text" id="form_email" name="form_email" />
|
||||||
{#<p class="form_alert help-block"><?php echo isset($needed['form_email']) ? $needed['form_email'] : '' ?></p>#}
|
{#<p class="form_alert help-block"><?php echo isset($needed["form_email"]) ? $needed["form_email"] : "" ?></p>#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="form_label control-label" for="form_email_confirm">{% trans 'admin::compte-utilisateur confirmer la nouvelle adresse email' %}</label>
|
<label class="form_label control-label" for="form_email_confirm">{% trans "admin::compte-utilisateur confirmer la nouvelle adresse email" %}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="form_email_confirm" name="form_email_confirm" autocomplete="off" />
|
<input type="text" id="form_email_confirm" name="form_email_confirm" autocomplete="off" />
|
||||||
{#<p class="form_alert help-block"><?php echo isset($needed['form_email_confirm']) ? $needed['form_email_confirm'] : '' ?></p>#}
|
{#<p class="form_alert help-block"><?php echo isset($needed["form_email_confirm"]) ? $needed["form_email_confirm"] : "" ?></p>#}
|
||||||
</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 btn-success" 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>
|
||||||
<div class="well well-small alert-info">
|
<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."%}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
{% set selected = "sessions" %}
|
{% set selected = "sessions" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -77,5 +77,5 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
{% extends 'account/base.html.twig' %}
|
{% extends "account/base.html.twig" %}
|
||||||
|
|
||||||
{% use "developers/header.html.twig" with header as parent_header %}
|
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans 'Client application' %}
|
{% trans "Client application" %}
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
{{ block('parent_header') }}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% set selected = "" %}
|
{% set selected = "" %}
|
||||||
@@ -15,84 +9,91 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<h1>{% trans 'Application' %}</h1>
|
<h1>{% trans "Application" %}</h1>
|
||||||
<input type="hidden" value="{{application.get_id}}" name="app_id"/>
|
<input type="hidden" value="{{ application.get_id() }}" name="app_id"/>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div><strong><a class="link" href="/developers/application/{{application.get_id}}/">{{application.get_name}}</a></strong></div>
|
<div><strong><a class="link" href="{{ path("developers_application", {"id" : application.get_id()}) }}">{{ application.get_name() }}</a></strong></div>
|
||||||
<div>{{application.get_description }}</div>
|
<div>{{ application.get_description() }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1 >{% trans 'settings OAuth' %}</h1>
|
<h1>{% trans "settings OAuth" %}</h1>
|
||||||
<p >{% trans 'Les parametres oauth de votre application.' %}</p>
|
<p>{% trans "Les parametres oauth de votre application." %}</p>
|
||||||
|
|
||||||
<table id="app-oauth-setting" class="table table-condensed table-bordered">
|
<table id="app-oauth-setting" class="table table-condensed table-bordered">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Client ID</td>
|
<td>Client ID</td>
|
||||||
<td>{{application.get_client_id()}}</td>
|
<td>{{ application.get_client_id() }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Client Secret</td>
|
<td>Client Secret</td>
|
||||||
<td>{{application.get_client_secret}}</td>
|
<td>{{ application.get_client_secret() }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans 'URL de callback' %}</td>
|
<td>{% trans "URL de callback" %}</td>
|
||||||
{% if application.get_type == constant('API_OAuth2_Application::DESKTOP_TYPE') %}
|
{% if application.get_type() == constant("API_OAuth2_Application::DESKTOP_TYPE") %}
|
||||||
<td>
|
<td>
|
||||||
<span>{{application.get_redirect_uri}}</span>
|
<span>{{ application.get_redirect_uri() }}</span>
|
||||||
</td>
|
</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td class="url_callback">
|
<td class="url_callback">
|
||||||
<span class="url_callback_input">{{application.get_redirect_uri}}</span>
|
<span class="url_callback_input">{{ application.get_redirect_uri() }}</span>
|
||||||
<button type="button" class="save_callback btn btn-small btn-info" style="display:none;">
|
<a href="{{ path("submit_application_callback", {"id" : application.get_id()}) }}" class="save_callback btn btn-small btn-info" style="display:none;">
|
||||||
save
|
{% trans "Save" %}
|
||||||
</button>
|
</a>
|
||||||
<button type="button" class="modifier_callback btn btn-small">
|
<button type="button" class="modifier_callback btn btn-small">
|
||||||
modifier
|
{% trans "Modify" %}
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
{%endif%}
|
{%endif%}
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Authorize endpoint</td>
|
<td>Authorize endpoint</td>
|
||||||
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/authorize</td>
|
<td>{{ app["phraseanet.registry"].get("GV_ServerName") }}api/oauthv2/authorize</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Access endpoint</td>
|
<td>Access endpoint</td>
|
||||||
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/token</td>
|
<td>{{ app["phraseanet.registry"].get("GV_ServerName") }}api/oauthv2/token</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans 'Activer le grant_type de type password pour votre application' %}</td>
|
<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>
|
<td>
|
||||||
|
<input class="grant-type"
|
||||||
|
type="checkbox"
|
||||||
|
{{ application.is_password_granted() ? "checked='checked'" : "" }}
|
||||||
|
name="grant"
|
||||||
|
value="{{ path("submit_developers_application_authorize_grant_password", {"id" : application.get_id()}) }}"
|
||||||
|
>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h1>{% trans 'Votre token d\'access' %}</h1>
|
<h1>{% trans "Votre token d\'access" %}</h1>
|
||||||
<p> {% trans 'Les paramétres oauth de votre application.' %}</p>
|
<p> {% trans "Les paramétres oauth de votre application." %}</p>
|
||||||
|
|
||||||
<table id="app-access-token-setting table" class="table table-condensed table-bordered">
|
<table id="app-access-token-setting table" class="table table-condensed table-bordered">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{% trans 'Token' %}
|
{% trans "Token" %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span id="my_access_token">
|
<span id="my_access_token">
|
||||||
{% if not token is none %}
|
{% if not token is none %}
|
||||||
{{token|default('')}}
|
{{ token|default("") }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% trans 'Le token n\'a pas encore ete genere' %}
|
{% trans "Le token n\'a pas encore ete genere" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
<button id="generate_access" class="btn btn-small btn-info" type="button" value="{{application.get_id}}">{% trans 'boutton::generer' %}</button>
|
<a id="generate_access" href="{{ path("submit_developers_application_token",{ "id" : application.get_id()}) }}" class="btn btn-small btn-info">{% trans "boutton::generer" %}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-primary" href="/developers/applications/">{% trans 'boutton::retour' %}</a>
|
<a class="btn btn-primary" href="{{ path("developers_applications") }}">{% trans "boutton::retour" %}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,38 +1,32 @@
|
|||||||
{% extends 'account/base.html.twig' %}
|
{% extends "account/base.html.twig" %}
|
||||||
|
|
||||||
{% use "developers/header.html.twig" with header as parent_header %}
|
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans 'new client application' %}
|
{% trans "new client application" %}
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
{{ block('parent_header') }}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% set selected = "" %}
|
{% set selected = "" %}
|
||||||
|
|
||||||
{# form input macro #}
|
{# form input macro #}
|
||||||
{% macro input(name, value, violations, property, class='', 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) }}" {% if class is not empty %}class="{{ class }}"{% endif %}/>
|
<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) }}" {% if class is not empty %}class="{{ class }}"{% endif %}/>
|
<input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value }}" size="{{ size|default(20) }}" {% if class is not empty %}class="{{ class }}"{% endif %}/>
|
||||||
<span class="help-block" style="color:red"> {{ violation.getInvalidValue }} - {{violation.getMessage}} </span>
|
<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) }}" {% if class is not empty %}class="{{ class }}"{% endif %}/>
|
<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, class='') %}
|
{% 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)}}" {% if class is not empty %}class="{{ class }}"{% endif %}>{{ 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 %}
|
||||||
@@ -45,16 +39,16 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if hasError == "false" %}
|
{% if hasError == "false" %}
|
||||||
<textarea name="{{ name }}" rows="{{ rows|default(4)}}" cols="{{cols|default(20)}}" {% if class is not empty %}class="{{ class }}"{% endif %}>{{ value|default('')|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" class="form-horizontal">
|
<form id="form_create" action="{{ path("developers_application_new") }}" 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"%}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set name = form.name %}
|
{% set name = form.name %}
|
||||||
{% set description = form.description %}
|
{% set description = form.description %}
|
||||||
@@ -64,65 +58,65 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="name"><b>{% trans 'Nom' %}</b></label>
|
<label class="control-label" for="name"><b>{% trans "Nom" %}</b></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{ _self.input("name", name, violations, 'name', 'input-xlarge') }}
|
{{ _self.input("name", name, violations, "name", "input-xlarge") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="name"><b>{% trans 'Description' %}</b></label>
|
<label class="control-label" for="name"><b>{% trans "Description" %}</b></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{ _self.textarea("description", description, violations, 'description', 5, 30, 'input-xlarge') }}
|
{{ _self.textarea("description", description, violations, "description", 5, 30, "input-xlarge") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="website" class="control-label"><b>{% trans 'Site web' %}</b></label>
|
<label for="website" class="control-label"><b>{% trans "Site web" %}</b></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select name="scheme-website" class="input-mini">
|
<select name="scheme-website" 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("website", website, violations, 'urlwebsite') }}
|
{{ _self.input("website", website, violations, "urlwebsite") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label"><b>{% trans 'Type d\'application' %}</b></label>
|
<label class="control-label"><b>{% trans "Type d\'application" %}</b></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label class="radio">
|
<label class="radio">
|
||||||
<input type="radio" name="type" value="web" {{ app_type == "web" ? "checked='checked'" : "" }}/>
|
<input type="radio" name="type" value="web" {{ app_type == "web" ? "checked='checked'" : "" }}/>
|
||||||
{% trans 'Application web' %}
|
{% trans "Application web" %}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="radio">
|
<label class="radio">
|
||||||
<input type="radio" name="type" value="desktop" {{ app_type == "desktop" ? "checked='checked'" : "" }}/>
|
<input type="radio" name="type" value="desktop" {{ app_type == "desktop" ? "checked='checked'" : "" }}/>
|
||||||
{% trans 'Application desktop' %}
|
{% trans "Application desktop" %}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if app_type == "web" %}
|
{% if app_type == "web" %}
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="callback" class="control-label"><b>{% trans 'URL de callback' %}</b></label>
|
<label for="callback" class="control-label"><b>{% trans "URL de callback" %}</b></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select name="scheme-callback" class="input-mini">
|
<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') }}
|
{{ _self.input("callback", callback, violations, "urlcallback") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button class="app_submit btn btn-info" type="submit">
|
<button class="btn btn-info" type="submit">
|
||||||
{% trans 'boutton::valider' %}
|
{% trans "boutton::valider" %}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<a class="btn btn-primary" href="/developers/applications/">
|
<a class="btn" href="{{ path("developers_applications") }}">
|
||||||
{% trans 'boutton::retour' %}
|
{% trans "boutton::retour" %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
{% extends 'account/base.html.twig' %}
|
{% extends "account/base.html.twig" %}
|
||||||
|
|
||||||
{% use "developers/header.html.twig" with header as parent_header %}
|
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% trans 'Client applications' %}
|
{% trans "Client applications" %}
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
{{ block('parent_header') }}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% set selected = "developer" %}
|
{% set selected = "developer" %}
|
||||||
@@ -17,61 +11,58 @@
|
|||||||
<div class="span7">
|
<div class="span7">
|
||||||
<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 unstyled'>
|
<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>
|
<a href="#appModal-{{ loop.index }}" role="button" data-toggle="modal" class="pull-right btn btn-danger btn-small" type="button">
|
||||||
<a href="#appModal-{{ loop.index }}" role="button" data-toggle="modal" class='btn btn-danger btn-small' type='button'>
|
{% trans "button::supprimer" %}
|
||||||
{% trans 'button::supprimer'%}
|
|
||||||
</a>
|
</a>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div id="appModal-{{ loop.index }}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<div id="appModal-{{ loop.index }}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
<h3 id="myModalLabel">{{application.get_name()}}</h3>
|
<h3 id="myModalLabel">{{ application.get_name() }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>{% trans "Are you sure you want to delete this application?" %} </p>
|
<p>{% trans "Are you sure you want to delete this application?" %} </p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "No" %}</button>
|
<button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "No" %}</button>
|
||||||
<button class="delete-app btn btn-primary">{% trans "Yes" %}</button>
|
<a href="{{ path("delete_developers_application", {"id" : application.get_id()}) }}" class="delete-app btn btn-info">{% trans "Yes" %}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class='app-row'>
|
<p class="app-row">
|
||||||
<strong>
|
<strong>
|
||||||
<a class="link" href="/developers/application/{{application.get_id()}}/">
|
<a class="link" href="{{ path("developers_application", {"id" : application.get_id}) }}">
|
||||||
{{application.get_name()|title}}
|
{{ application.get_name() }}
|
||||||
</a>
|
</a>
|
||||||
</strong>
|
</strong>
|
||||||
</span>
|
</p>
|
||||||
<span class='app-row'>{{application.get_description() }}</span>
|
<p class="app-row">{{ application.get_description()|truncate(120, true, "...") }}</p>
|
||||||
<span class='app-row'>{{application.get_website()}}</span>
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
{%endfor%}
|
{%endfor%}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div>
|
<div>
|
||||||
{% trans 'Aucune application creee.' %}
|
{% trans "Aucune application creee." %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span5">
|
<div class="span5">
|
||||||
<div>
|
<div class="well well-small">
|
||||||
<a href="http://developer.phraseanet.com/" target="_blank" class="btn btn-large">
|
<p>{% trans "Decouvrez la documentation" %}</p>
|
||||||
{% trans 'Demarrer avec l\'API Phraseanet' %}
|
<a href="http://developer.phraseanet.com/" target="_blank" class="btn btn-large text-center input-block-level">
|
||||||
|
{% trans "Demarrer avec l\'API Phraseanet" %}
|
||||||
</a>
|
</a>
|
||||||
<p>{% trans 'Decouvrez la documentation' %}</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="well well-small">
|
||||||
<a href="/developers/application/new/" class="btn-info btn btn-large">
|
<p>{% trans "Creez une application pour commencer a utiliser l\'API Phraseanet" %}</p>
|
||||||
{% trans 'Creer une nouvelle applications' %}
|
<a href="{{ path("developers_application_new") }}" class="btn-info btn btn-large text-center input-block-level">
|
||||||
|
{% trans "Creer une nouvelle applications" %}
|
||||||
</a>
|
</a>
|
||||||
<p>{% trans 'Creez une application pour commencer a utiliser l\'API Phraseanet' %}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,128 +0,0 @@
|
|||||||
{% block header %}
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function(){
|
|
||||||
var trans = {
|
|
||||||
'confirm_delete' : "{% trans 'etes vous sur de vouloir supprimer cette application' %}"
|
|
||||||
,'yes' : "{% trans 'oui' %}"
|
|
||||||
,'no' : "{% trans 'non' %}"
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#generate_access").live("click", function(){
|
|
||||||
var app_id = $(this).attr("value");
|
|
||||||
var usr_id = $(this).closest("div").attr("id");
|
|
||||||
var opts = {
|
|
||||||
type:"POST",
|
|
||||||
url : '/developers/application/'+ app_id +'/access_token/',
|
|
||||||
dataType: 'json',
|
|
||||||
data : {
|
|
||||||
usr_id : usr_id
|
|
||||||
},
|
|
||||||
success : function(data){
|
|
||||||
if(data.success) {
|
|
||||||
$("#my_access_token").empty().append(data.token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
jQuery.ajax(opts);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".modifier_callback").live("click", function(){
|
|
||||||
$(this).hide();
|
|
||||||
$(".save_callback").show();
|
|
||||||
var cur_value = $(".url_callback_input").html();
|
|
||||||
$(".url_callback_input")
|
|
||||||
.empty()
|
|
||||||
.wrapInner('<input value = "'+cur_value+'" name="oauth_callback" size="50" type="text"/>');
|
|
||||||
$(".url_callback").die();
|
|
||||||
$(".save_callback").live("click", function(){
|
|
||||||
var callback = $("input[name=oauth_callback]").val();
|
|
||||||
var app_id = $("input[name=app_id]").val();
|
|
||||||
var $this = $(this);
|
|
||||||
var option = {
|
|
||||||
type:"POST",
|
|
||||||
url : "/developers/application/" + app_id + "callback/",
|
|
||||||
dataType: 'json',
|
|
||||||
data :{callback : callback},
|
|
||||||
success : function(data){
|
|
||||||
if(data.success == true)
|
|
||||||
$(".url_callback_input").empty().append(callback);
|
|
||||||
else
|
|
||||||
$(".url_callback_input").empty().append(cur_value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$.ajax(option);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".app_submit").live("click", function(){
|
|
||||||
var form = $(this).closest("form");
|
|
||||||
var action = form.attr("action");
|
|
||||||
var option = {
|
|
||||||
type:"POST",
|
|
||||||
url : action,
|
|
||||||
dataType: 'html',
|
|
||||||
data : form.serializeArray(),
|
|
||||||
success : function(data){
|
|
||||||
$(".ui-tabs-panel:visible").empty().append(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$.ajax(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#form_create input[name=type]").live("click", function(){
|
|
||||||
if($(this).val() == "desktop")
|
|
||||||
$("#form_create .callback td").hide().find("input").val('');
|
|
||||||
else
|
|
||||||
$("#form_create .callback td").show();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.grant-type').live('click', function(){
|
|
||||||
var appId = $(this).val();
|
|
||||||
var grant = $(this).is(":checked") ? "1": "0";
|
|
||||||
var opts = {
|
|
||||||
type:"POST",
|
|
||||||
url : '/developers/application/' + appId + '/authorize_grant_password/',
|
|
||||||
dataType: 'json',
|
|
||||||
data : {grant : grant},
|
|
||||||
success : function(data){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$.ajax(opts);
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#app_dev, #app_dev_new, #app_dev_create, a.dev_back").live("click", function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
var target = $(this).attr("href");
|
|
||||||
var opts = {
|
|
||||||
type:"GET",
|
|
||||||
url : target,
|
|
||||||
dataType: 'html',
|
|
||||||
success : function(data){
|
|
||||||
$(".ui-tabs-panel:visible").empty().append(data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
$.ajax(opts);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".delete-app").bind("click", function(){
|
|
||||||
var li = $(this).closest("li");
|
|
||||||
var app_id = li.attr('id').split("_").pop();
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type:"DELETE",
|
|
||||||
url : '/developers/application/'+ app_id +'/',
|
|
||||||
dataType: 'json',
|
|
||||||
data : {},
|
|
||||||
success : function(data){
|
|
||||||
if(data.success) {
|
|
||||||
li.find('.modal').modal('hide');
|
|
||||||
li.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
|
||||||
125
www/skins/account/account.js
Normal file
125
www/skins/account/account.js
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
// revoke third party application access
|
||||||
|
$("a.app-btn").bind("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var $this = $(this);
|
||||||
|
$.ajax({
|
||||||
|
type:"GET",
|
||||||
|
url : $this.attr("href"),
|
||||||
|
dataType: 'json',
|
||||||
|
data : {revoke : $this.hasClass("authorize") ? 1 : 0},
|
||||||
|
success : function(data) {
|
||||||
|
if(data.success) {
|
||||||
|
var li = $this.closest('li');
|
||||||
|
|
||||||
|
var hidden = $('.app-btn.hidden , .status.hidden', li);
|
||||||
|
var notHidden = $('.app-btn:not(.hidden), .status:not(.hidden)', li);
|
||||||
|
|
||||||
|
hidden.removeClass('hidden');
|
||||||
|
notHidden.addClass('hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// generate new access token
|
||||||
|
$("a#generate_access").bind("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var $this = $(this);
|
||||||
|
$.ajax({
|
||||||
|
type:"POST",
|
||||||
|
url : $this.attr("href"),
|
||||||
|
dataType: 'json',
|
||||||
|
data : {
|
||||||
|
usr_id : $this.closest("div").attr("id")
|
||||||
|
},
|
||||||
|
success : function(data){
|
||||||
|
if(data.success) {
|
||||||
|
$("#my_access_token").empty().append(data.token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//modify application callback url
|
||||||
|
$(".modifier_callback").bind("click", function() {
|
||||||
|
var modifierBtn = $(this);
|
||||||
|
var saveBtn = $("a.save_callback");
|
||||||
|
var input = $(".url_callback_input");
|
||||||
|
var inputVal = input.html();
|
||||||
|
|
||||||
|
modifierBtn.hide();
|
||||||
|
saveBtn.show();
|
||||||
|
// wrapp current calback in an input
|
||||||
|
input
|
||||||
|
.empty()
|
||||||
|
.wrapInner(''
|
||||||
|
+ '<input value = "'+inputVal+'"'
|
||||||
|
+ ' name="oauth_callback" size="50" type="text"/>'
|
||||||
|
);
|
||||||
|
|
||||||
|
$(".url_callback").die();
|
||||||
|
|
||||||
|
// save new callback
|
||||||
|
saveBtn.bind("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var callback = $("input[name=oauth_callback]").val();
|
||||||
|
$.ajax({
|
||||||
|
type:"POST",
|
||||||
|
url : saveBtn.attr("href"),
|
||||||
|
dataType: 'json',
|
||||||
|
data :{callback : callback},
|
||||||
|
success : function(data) {
|
||||||
|
if(data.success) {
|
||||||
|
input.empty().append(callback);
|
||||||
|
} else {
|
||||||
|
input.empty().append(inputVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// hide or show callback url input whether user choose a web or dektop application
|
||||||
|
$("#form_create input[name=type]").bind("click", function() {
|
||||||
|
if($(this).val() === "desktop") {
|
||||||
|
$("#form_create .callback td").hide().find("input").val('');
|
||||||
|
} else {
|
||||||
|
$("#form_create .callback td").show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// authorize password grant type or not
|
||||||
|
$('.grant-type').bind('click', function(){
|
||||||
|
var $this = $(this);
|
||||||
|
$.ajax({
|
||||||
|
type:"POST",
|
||||||
|
url : $this.attr("value") ,
|
||||||
|
dataType: 'json',
|
||||||
|
data : {grant : $this.is(":checked") ? "1": "0"},
|
||||||
|
success : function(data){}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// delete an application
|
||||||
|
$("a.delete-app").bind("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var $this = $(this);
|
||||||
|
var li = $this.closest("li");
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type:"DELETE",
|
||||||
|
url : $this.attr('href'),
|
||||||
|
dataType: 'json',
|
||||||
|
data : {},
|
||||||
|
success : function(data){
|
||||||
|
if(data.success) {
|
||||||
|
li.find('.modal').modal('hide');
|
||||||
|
li.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -334,18 +334,43 @@ h1, h2, h3, h4 {
|
|||||||
color: @black;
|
color: @black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-list {
|
||||||
|
border: 1px solid @grayDark;
|
||||||
|
background: lighten(@background, 2%);
|
||||||
|
.border-radius(@baseBorderRadius);
|
||||||
|
}
|
||||||
|
|
||||||
.app-list li {
|
.app-list li {
|
||||||
padding: 10px 0;
|
padding: 10px;
|
||||||
|
border-top: 1px solid @grayDark;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-list li:first-child {
|
||||||
|
border-top:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-list li .app-row {
|
.app-list li .app-row {
|
||||||
line-height: @fontSizeLarge * 1.25;
|
line-height: @fontSizeLarge * 1.25;
|
||||||
|
padding-bottm: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-list li .app-row a {
|
.app-list li .app-row a {
|
||||||
font-size: @fontSizeLarge * 1.25;
|
font-size: @fontSizeLarge * 1.25;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-success {
|
||||||
|
color: @green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-error {
|
||||||
|
color: @red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.control-span {
|
||||||
|
padding-top: 5px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Landscape phones and down */
|
/* Landscape phones and down */
|
||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@
|
|||||||
|
|
||||||
// Wells
|
// Wells
|
||||||
// -------------------------
|
// -------------------------
|
||||||
@wellBackground: #f5f5f5;
|
@wellBackground: @grayDarker;
|
||||||
|
|
||||||
|
|
||||||
// Navbar
|
// Navbar
|
||||||
|
|||||||
Reference in New Issue
Block a user