diff --git a/templates/web/account/access.html.twig b/templates/web/account/access.html.twig index ff53f08f55..17a0e591ef 100644 --- a/templates/web/account/access.html.twig +++ b/templates/web/account/access.html.twig @@ -1,13 +1,13 @@ -{% extends 'account/base.html.twig' %} +{% extends "account/base.html.twig" %} {% block title %} - {% trans 'Granted bases' %} + {% trans "Granted bases" %} {% endblock %} {% set selected = "access" %} {% block content %} -
+ @@ -15,21 +15,21 @@ {% 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"] %} {% endif %} - {% if baseInsc['CollsRegistered'] is not none %} - {% for base in baseInsc['CollsRegistered']%} + {% 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) %} @@ -41,14 +41,14 @@ {% endif %} - {% if baseInsc['CollsRefuse'] %} - {% for collId, isTrue in baseInsc['CollsRefuse'] %} + {% if baseInsc["CollsRefuse"] %} + {% for collId, isTrue in baseInsc["CollsRefuse"] %} {% set base_id = sbasId |base_from_coll(collId, app) %} @@ -59,14 +59,14 @@ {% endif %} - {% if baseInsc['CollsWait'] %} - {% for collId, isTrue in baseInsc['CollsWait'] %} + {% if baseInsc["CollsWait"] %} + {% for collId, isTrue in baseInsc["CollsWait"] %} {% set base_id = sbasId |base_from_coll(collId, app) %} @@ -74,14 +74,14 @@ {% endif %} - {% if baseInsc['CollsIntime'] %} - {% for collId, isTrue in baseInsc['CollsIntime'] %} + {% if baseInsc["CollsIntime"] %} + {% for collId, isTrue in baseInsc["CollsIntime"] %} {% set base_id = sbasId |base_from_coll(collId, app) %} @@ -89,14 +89,14 @@ {% endif %} - {% if baseInsc['CollsOuttime'] %} - {% for collId, isTrue in baseInsc['CollsOuttime'] %} + {% if baseInsc["CollsOuttime"] %} + {% for collId, isTrue in baseInsc["CollsOuttime"] %} {% set base_id = sbasId |base_from_coll(collId, app) %} @@ -104,14 +104,14 @@ {% endif %} - {% if baseInsc['CollsNonactif'] %} - {% for collId, isTrue in baseInsc['CollsNonactif'] %} + {% if baseInsc["CollsNonactif"] %} + {% for collId, isTrue in baseInsc["CollsNonactif"] %} {% set base_id = sbasId |base_from_coll(collId, app) %} @@ -119,48 +119,48 @@ {% endif %} - {% if (baseInsc['CollsCGU'] or baseInsc['Colls']) and baseInsc['inscript'] %} - {% if baseInsc['Colls'] %} - {% if baseInsc['CGU'] %} + {% if (baseInsc["CollsCGU"] or baseInsc["Colls"]) and baseInsc["inscript"] %} + {% if baseInsc["Colls"] %} + {% if baseInsc["CGU"] %} - + - + {% endif %} - {% for collId, collName in baseInsc['Colls'] %} + {% for collId, collName in baseInsc["Colls"] %} {% set base_id = sbasId |base_from_coll(collId, app) %} {% endfor %} {% endif %} - {% if baseInsc['CollsCGU'] %} - {% for collId, collDesc in baseInsc['CollsCGU'] %} + {% if baseInsc["CollsCGU"] %} + {% for collId, collDesc in baseInsc["CollsCGU"] %} {% set base_id = sbasId |base_from_coll(collId, app) %} - + - + {% endfor %} @@ -169,7 +169,7 @@ {% endfor %}
  

{{ sbasId | sbas_names(app) }}

- {% trans 'login::register: acces authorise sur la collection ' %}{{ sbasId |sbas_names(app) }} - {% if isTrue | trim != '' %} - {% trans 'login::register::CGU: lire les CGU' %} + {% trans "login::register: acces authorise sur la collection " %}{{ sbasId |sbas_names(app) }} + {% if isTrue | trim != "" %} + {% trans "login::register::CGU: lire les CGU" %} {% endif %}
- {% trans 'login::register: acces refuse sur la collection ' %}{{ sbasId |sbas_names(app) }} - {% if isTrue | trim != '' %} - {% trans 'login::register::CGU: lire les CGU' %} + {% trans "login::register: acces refuse sur la collection " %}{{ sbasId |sbas_names(app) }} + {% if isTrue | trim != "" %} + {% trans "login::register::CGU: lire les CGU" %} {% endif %}
- {% trans 'login::register: en attente d\'acces sur' %} {{ sbasId |sbas_names(app) }} - {% if isTrue | trim != '' %} - {% trans 'login::register::CGU: lire les CGU' %} + {% trans "login::register: en attente d\'acces sur" %} {{ sbasId |sbas_names(app) }} + {% if isTrue | trim != "" %} + {% trans "login::register::CGU: lire les CGU" %} {% endif %}
- {% trans 'login::register: acces temporaire sur' %} {{ sbasId |sbas_names(app) }} - {% if isTrue |trim != '' %} - {% trans 'login::register::CGU: lire les CGU' %} + {% trans "login::register: acces temporaire sur" %} {{ sbasId |sbas_names(app) }} + {% if isTrue |trim != "" %} + {% trans "login::register::CGU: lire les CGU" %} {% endif %}
- {% trans 'login::register: acces temporaire termine sur ' %}{{ sbasId |sbas_names(app) }} - {% if isTrue |trim != '' %} - {% trans 'login::register::CGU: lire les CGU' %} + {% trans "login::register: acces temporaire termine sur " %}{{ sbasId |sbas_names(app) }} + {% if isTrue |trim != "" %} + {% trans "login::register::CGU: lire les CGU" %} {% endif %}
- {% trans 'login::register: acces supendu sur' %} {{ sbasId |sbas_names(app) }} - {% if isTrue |trim != '' %} - {% trans 'login::register::CGU: lire les CGU' %} + {% trans "login::register: acces supendu sur" %} {{ sbasId |sbas_names(app) }} + {% if isTrue |trim != "" %} + {% trans "login::register::CGU: lire les CGU" %} {% endif %}
{% trans 'login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes' %}{% trans "login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes" %}
{{ baseInsc['CGU'] }}
{{ baseInsc["CGU"] }}
{{ collName }} - {% trans 'login::register: Faire une demande d\'acces' %} + {% trans "login::register: Faire une demande d\'acces" %}

{% trans 'login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes' %}{% trans "login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes" %}
-
{{ collDesc['CGU'] }}
+
{{ collDesc["CGU"] }}
{{ collDesc['name'] }}{{ collDesc["name"] }} - {% trans 'login::register: Faire une demande d\'acces' %} + {% trans "login::register: Faire une demande d\'acces" %}
- +
{% endblock %} diff --git a/templates/web/account/account.html.twig b/templates/web/account/account.html.twig index 9674022c40..3bbe4a19f8 100644 --- a/templates/web/account/account.html.twig +++ b/templates/web/account/account.html.twig @@ -1,4 +1,4 @@ -{% extends 'account/base.html.twig' %} +{% extends "account/base.html.twig" %} {% import "login/common/macros.html.twig" as auth_macro %} @@ -9,221 +9,224 @@ {% endblock %} {% block title %} - {% trans 'login:: Mon compte' %} + {% trans "login:: Mon compte" %} {% endblock %} {% block content %}
-
- {% if notice | trim != '' %} -
{{ notice }}
+
+ {% if notice | trim != "" %} +
{{ notice }}
{% endif %} {{ auth_macro.flashes() }} -
- {% trans 'Informations personnelles' %} - - -
- -
-

{{ app['authentication'].getUser().get_login() }}

-

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
-

{{ app['authentication'].getUser().get_email() }} {% trans 'login:: Changer mon adresse email' %}

-

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
-
-

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
- - {% trans 'Notification par email' %} - - {% for notification_group, nots in notifications%} -

{{ notification_group }}

- {% for notification in nots %} + +
+
+ {% trans "Informations personnelles" %}
- +
-
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ {{ app["authentication"].getUser().get_email() }} {% trans "login:: Changer mon adresse email" %} +

+
+
+ +
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+ + {% trans "Notification par email" %} + + {% for notification_group, nots in notifications%} +
+ {{ notification_group }} +
+
    + {% for notification in nots %} +
  • + +

    +
  • + {% endfor %} +
+
+
+ {% endfor %} + + {% trans "FTP" %} + +
+
+

- {% endfor %} - {% endfor %} - {% trans 'FTP' %} - -
- -
- -

-
-
-
-
- -
- -

+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+ +
+ +

+
+
+
+
+ +

+
+
+
+ +
+ +

+
+
-
- -
- -

-
+
+
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
- -

-
-
-
- -
-
diff --git a/templates/web/account/authorized_apps.html.twig b/templates/web/account/authorized_apps.html.twig index db835740eb..5d7a65ccea 100644 --- a/templates/web/account/authorized_apps.html.twig +++ b/templates/web/account/authorized_apps.html.twig @@ -1,102 +1,67 @@ -{% extends 'account/base.html.twig' %} +{% extends "account/base.html.twig" %} {% block title %} - {% trans 'Granted third party applications' %} -{% endblock %} - -{% block head %} - + {% trans "Granted third party applications" %} {% endblock %} {% set selected = "applications" %} {% block content %} -
-
-
-

{% trans 'Vous avez autorise ces applications a acceder a votre compte' %}

- {% if applications|length > 0 %} -
    - {% for application in applications %} -
  • -
    - {% set account = application.get_user_account(app['authentication'].getUser()) %} - {% if account.is_revoked() is empty %} - - {% else %} - - {% endif %} - - - {{application.get_name()}} - - {% if application.get_creator() is not none %} - {% set user_name = application.get_creator().get_display_name() %} - {% trans %} - par {{user_name}} - {% endtrans %} - {% endif%} - - - {{ app['date-formatter'].getPrettyString(application.get_created_on()) }} - - {{ application.get_description()|truncate(80, true, '...') }} -
    -
  • - {%endfor%} -
- {% else %} -
- {% trans 'Aucune application n\'a accés à vos données.' %} -
- {% endif %} +
+
+
+

{% trans "Vous avez autorise ces applications a acceder a votre compte" %}

+ {% if applications|length > 0 %} +
    + {% for application in applications %} +
  • +
    + {% set account = application.get_user_account(app["authentication"].getUser()) %} + {% trans "Revoquer l\'access" %} + {% trans "Authoriser l\'access" %} +

    + + {{ application.get_name() }} + + {% if application.get_creator() is not none %} + + {% set user_name = application.get_creator().get_display_name() %} + {% trans %} + par {{ user_name }} + {% endtrans %} + + {% endif%} +

    +

    + {% trans "Not Allowed"%} + {% trans "Allowed"%} +

    +

    {{ application.get_description()|truncate(120, true, "...") }}

    +
    +
  • + {%endfor%} +
+ {% else %} +
+ {% trans "Aucune application n\'a accés à vos données." %} +
+ {% endif %} +
+
+
+
+

{% trans "Third-party applications" %}

+

+ {% trans "A third-party application is a product developed apart from Phraseanet and that would access Phraseanet data." %} +

+
+ +
+

{% trans "Developpeurs" %}

+

+ {% trans "Les developpeurs peuvent editer l\'enregistrement de leurs application grace a l\'onglet 'developpeurs' ci-dessus" %} +

+
-
-

{% trans 'Applications' %}

-

- {% trans 'Naviguez et gerez les applications que vous souhaitez autoriser a acceder a vos informations Phraseanet' %} -

-

{% trans 'Developpeurs' %}

-

- {% trans 'Les developpeurs peuvent editer l\'enregistrement de leurs application grace a l\'onglet "developpeurs" ci-dessus' %} -

-
-
{% endblock %} diff --git a/templates/web/account/base.html.twig b/templates/web/account/base.html.twig index 1ac6745de8..a2ab883e41 100644 --- a/templates/web/account/base.html.twig +++ b/templates/web/account/base.html.twig @@ -1,8 +1,8 @@ - + - {{ app['phraseanet.registry'].get('GV_homeTitle') }} {% block title %}{% endblock %} + {{ app["phraseanet.registry"].get("GV_homeTitle") }} {% block title %}{% endblock %} - + {% block head %}{% endblock %} @@ -13,13 +13,13 @@ {% block menu %} diff --git a/templates/web/account/reset-email.html.twig b/templates/web/account/reset-email.html.twig index a210b688ae..2c34e3dc13 100644 --- a/templates/web/account/reset-email.html.twig +++ b/templates/web/account/reset-email.html.twig @@ -1,7 +1,7 @@ -{% extends 'account/base.html.twig' %} +{% extends "account/base.html.twig" %} {% block title %} - {% trans 'Change my email address' %} + {% trans "Change my email address" %} {% endblock %} {% block head %} @@ -20,25 +20,25 @@ $(document).ready(function() { }, form_email_confirm : { required:true, - equalTo:'#form_email' + equalTo:"#form_email" } }, messages: { form_password : { - required : "{% trans 'forms::ce champ est requis' %}" + required : "{% trans "forms::ce champ est requis" %}" }, form_email : { - required : "{% trans 'forms::ce champ est requis' %}", - email:"{% trans 'forms::l\'email semble invalide' %}" + required : "{% trans "forms::ce champ est requis" %}", + email:"{% trans "forms::l\'email semble invalide" %}" }, form_email_confirm : { - required : "{% trans 'forms::ce champ est requis' %}", - equalTo : "{% trans 'forms::les emails ne correspondent pas' %}" + required : "{% trans "forms::ce champ est requis" %}", + equalTo : "{% trans "forms::les emails ne correspondent pas" %}" } }, 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 %} {% else %} {% if noticeMsg is not none %}
- {% trans 'phraseanet::erreur : oups ! une erreur est survenue pendant l\'operation !' %} + {% trans "phraseanet::erreur : oups ! une erreur est survenue pendant l\'operation !" %}
{{ noticeMsg }}
- {% trans 'admin::compte-utilisateur retour a mon compte'%} + {% trans "admin::compte-utilisateur retour a mon compte" %} {% endif %} -
+
- +
-

{{ app['authentication'].getUser().get_login() }}

+

{{ app["authentication"].getUser().get_login() }}

- +
- {#

#} + {#

#}
- +
- {#

#} + {#

#}
- +
- {#

#} + {#

#}
- - + +
- {% 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 ?"%}
- {% 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."%}
{% endif %} {% endblock %} diff --git a/templates/web/account/sessions.html.twig b/templates/web/account/sessions.html.twig index ed38285ab7..369d28326a 100644 --- a/templates/web/account/sessions.html.twig +++ b/templates/web/account/sessions.html.twig @@ -7,75 +7,75 @@ {% set selected = "sessions" %} {% block content %} -
-
- - - - - - - - - - - - - - {% for row in sessions %} - - - - - - - - +
+
+
- {% trans 'Date de connexion' %} - - {% trans 'Dernier access' %} - - {% trans 'IP' %} - - {% trans 'Browser' %} - - {% trans 'ecran' %} - - {% trans 'Session persistante' %} -
- {% if app['session'].get('phrasea_session_id') != row.Id() %} - - {% endif %} - - {{ app['date-formatter'].getDate(row.getCreated()) }} - - {{ app['date-formatter'].getDate(row.getUpdated()) }} - - {% 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 }} - - {{ row.getBrowserName() }} {{ row.getBrowserVersion() }} - - {{ row.getScreenWidth() }} x {{ row.getScreenHeight() }} - - {% if row.getToken %}{{ yes }}{% endif %} -
+ + + + + + + + + - {% endfor %} - -
+ {% trans 'Date de connexion' %} + + {% trans 'Dernier access' %} + + {% trans 'IP' %} + + {% trans 'Browser' %} + + {% trans 'ecran' %} + + {% trans 'Session persistante' %} +
+ + + {% for row in sessions %} + + + {% if app['session'].get('phrasea_session_id') != row.Id() %} + + {% endif %} + + + {{ app['date-formatter'].getDate(row.getCreated()) }} + + + {{ app['date-formatter'].getDate(row.getUpdated()) }} + + + {% 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 }} + + + {{ row.getBrowserName() }} {{ row.getBrowserVersion() }} + + + {{ row.getScreenWidth() }} x {{ row.getScreenHeight() }} + + + {% if row.getToken %}{{ yes }}{% endif %} + + + {% endfor %} + + +
-
{% endblock %} diff --git a/templates/web/developers/application.html.twig b/templates/web/developers/application.html.twig index 66b29e6b11..69be12dc5c 100644 --- a/templates/web/developers/application.html.twig +++ b/templates/web/developers/application.html.twig @@ -1,13 +1,7 @@ -{% extends 'account/base.html.twig' %} - -{% use "developers/header.html.twig" with header as parent_header %} +{% extends "account/base.html.twig" %} {% block title %} - {% trans 'Client application' %} -{% endblock %} - -{% block head %} - {{ block('parent_header') }} + {% trans "Client application" %} {% endblock %} {% set selected = "" %} @@ -15,84 +9,91 @@ {% block content %}
-

{% trans 'Application' %}

- +

{% trans "Application" %}

+
- -
{{application.get_description }}
+ +
{{ application.get_description() }}
-

{% trans 'settings OAuth' %}

-

{% trans 'Les parametres oauth de votre application.' %}

+

{% trans "settings OAuth" %}

+

{% trans "Les parametres oauth de votre application." %}

- + - + - - {% if application.get_type == constant('API_OAuth2_Application::DESKTOP_TYPE') %} + + {% if application.get_type() == constant("API_OAuth2_Application::DESKTOP_TYPE") %} {% else %} {%endif%} - + - + - - + +
Client ID{{application.get_client_id()}}{{ application.get_client_id() }}
Client Secret{{application.get_client_secret}}{{ application.get_client_secret() }}
{% trans 'URL de callback' %}{% trans "URL de callback" %} - {{application.get_redirect_uri}} + {{ application.get_redirect_uri() }} - {{application.get_redirect_uri}} - + {{ application.get_redirect_uri() }} +
Authorize endpoint{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/authorize{{ app["phraseanet.registry"].get("GV_ServerName") }}api/oauthv2/authorize
Access endpoint{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/token{{ app["phraseanet.registry"].get("GV_ServerName") }}api/oauthv2/token
{% trans 'Activer le grant_type de type password pour votre application' %}{% trans "Activer le grant_type de type password pour votre application" %} + +
-

{% trans 'Votre token d\'access' %}

-

{% trans 'Les paramétres oauth de votre application.' %}

+

{% trans "Votre token d\'access" %}

+

{% trans "Les paramétres oauth de votre application." %}

- {% trans 'Token' %} + {% trans "Token" %} {% if not token is none %} - {{token|default('')}} + {{ token|default("") }} {% else %} - {% trans 'Le token n\'a pas encore ete genere' %} + {% trans "Le token n\'a pas encore ete genere" %} {% endif %} - + {% trans "boutton::generer" %}
diff --git a/templates/web/developers/application_form.html.twig b/templates/web/developers/application_form.html.twig index 3a2db272d2..8dd2a8c9d1 100644 --- a/templates/web/developers/application_form.html.twig +++ b/templates/web/developers/application_form.html.twig @@ -1,38 +1,32 @@ -{% extends 'account/base.html.twig' %} - -{% use "developers/header.html.twig" with header as parent_header %} +{% extends "account/base.html.twig" %} {% block title %} - {% trans 'new client application' %} -{% endblock %} - -{% block head %} - {{ block('parent_header') }} + {% trans "new client application" %} {% endblock %} {% set selected = "" %} {# 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 %} - + {% else %} {% set hasError = "false" %} {% for violation in violations %} {% if violation.getPropertyPath == property and hasError == "false" %} {% set hasError = "true" %} - + {{ violation.getInvalidValue }} - {{violation.getMessage}} {% endif %} {% endfor %} {% if hasError == "false" %} - + {% endif %} {% endif %} {% endmacro %} {# 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 %} {% else %} @@ -45,16 +39,16 @@ {% endif %} {% endfor %} {% if hasError == "false" %} - + {% endif %} {% endif %} {% endmacro %} {% block content %} -
+ {% if form is none %} - {% set name, description, website, callback = '', '', '', ''%} - {% set app_type = 'web'%} + {% set name, description, website, callback = "", "", "", ""%} + {% set app_type = "web"%} {% else %} {% set name = form.name %} {% set description = form.description %} @@ -64,65 +58,65 @@ {% endif %}
- +
- {{ _self.input("name", name, violations, 'name', 'input-xlarge') }} + {{ _self.input("name", name, violations, "name", "input-xlarge") }}
- +
- {{ _self.textarea("description", description, violations, 'description', 5, 30, 'input-xlarge') }} + {{ _self.textarea("description", description, violations, "description", 5, 30, "input-xlarge") }}
- +
- {{ _self.input("website", website, violations, 'urlwebsite') }} + {{ _self.input("website", website, violations, "urlwebsite") }}
- +
{% if app_type == "web" %}
- +
- {{ _self.input("callback", callback, violations, 'urlcallback') }} + {{ _self.input("callback", callback, violations, "urlcallback") }}
{% endif %}
- - - {% trans 'boutton::retour' %} + + {% trans "boutton::retour" %}
diff --git a/templates/web/developers/applications.html.twig b/templates/web/developers/applications.html.twig index bdf86b0e75..740cd30e11 100644 --- a/templates/web/developers/applications.html.twig +++ b/templates/web/developers/applications.html.twig @@ -1,13 +1,7 @@ -{% extends 'account/base.html.twig' %} - -{% use "developers/header.html.twig" with header as parent_header %} +{% extends "account/base.html.twig" %} {% block title %} - {% trans 'Client applications' %} -{% endblock %} - -{% block head %} - {{ block('parent_header') }} + {% trans "Client applications" %} {% endblock %} {% set selected = "developer" %} @@ -17,61 +11,58 @@

Phraseanet Developer Center

-

{% trans 'Mes applications' %}

+

{% trans "Mes applications" %}

{% if applications|length > 0 %} -
- diff --git a/templates/web/developers/header.html.twig b/templates/web/developers/header.html.twig deleted file mode 100644 index bab80a9de3..0000000000 --- a/templates/web/developers/header.html.twig +++ /dev/null @@ -1,128 +0,0 @@ -{% block header %} - -{% endblock %} \ No newline at end of file diff --git a/www/skins/account/account.js b/www/skins/account/account.js new file mode 100644 index 0000000000..7a56e9f3c1 --- /dev/null +++ b/www/skins/account/account.js @@ -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('' + + '' + ); + + $(".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(); + } + } + }); + }); +}); + + diff --git a/www/skins/account/skin.less b/www/skins/account/skin.less index 7ae9a1a8e5..5e42085d4e 100644 --- a/www/skins/account/skin.less +++ b/www/skins/account/skin.less @@ -334,18 +334,43 @@ h1, h2, h3, h4 { color: @black; } +.app-list { + border: 1px solid @grayDark; + background: lighten(@background, 2%); + .border-radius(@baseBorderRadius); +} + .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 { line-height: @fontSizeLarge * 1.25; + padding-bottm: 5px; } .app-list li .app-row a { 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 */ @media (max-width: 480px) { diff --git a/www/skins/account/variables.less b/www/skins/account/variables.less index 12025b894d..976e2cadd5 100644 --- a/www/skins/account/variables.less +++ b/www/skins/account/variables.less @@ -211,7 +211,7 @@ // Wells // ------------------------- -@wellBackground: #f5f5f5; +@wellBackground: @grayDarker; // Navbar