From 705f04f0ef1ab7e328242f3177ba625d46322654 Mon Sep 17 00:00:00 2001 From: Ysolyne Gresille Date: Mon, 25 Jun 2012 18:29:54 +0200 Subject: [PATCH 01/17] LESS + bootstrap integration for Admin: first steps --- templates/web/admin/index.html.twig | 5 +- templates/web/admin/users.html | 481 +++++++++++++--------------- www/admin/demand.php | 23 +- www/skins/admin/admincolor.css | 155 --------- www/skins/admin/css/Main.css | 158 +++++++++ www/skins/admin/css/Tables.css | 64 ++++ www/skins/admin/csscompiler.sh | 7 + www/skins/admin/less/Main.less | 197 ++++++++++++ www/skins/admin/less/Tables.less | 108 +++++++ 9 files changed, 762 insertions(+), 436 deletions(-) create mode 100644 www/skins/admin/css/Main.css create mode 100644 www/skins/admin/css/Tables.css create mode 100755 www/skins/admin/csscompiler.sh create mode 100644 www/skins/admin/less/Main.less create mode 100644 www/skins/admin/less/Tables.less diff --git a/templates/web/admin/index.html.twig b/templates/web/admin/index.html.twig index c5edb9b669..c7ef5b2861 100644 --- a/templates/web/admin/index.html.twig +++ b/templates/web/admin/index.html.twig @@ -8,7 +8,8 @@ {% endblock %} {% block stylesheet %} - + + @@ -336,7 +337,7 @@ $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->closeCursor(); -$out .= "
"; +$out .= "
"; $out .= "

" . _('admin:: demandes en cours') . "

"; $out .= "
"; @@ -496,7 +497,7 @@ $out .= "
"; $out .= "
"; $out .= "
"; -$out .= " "; +$out .= " "; $out .= "
"; $out .= "
"; $out .= " "; diff --git a/www/skins/admin/admincolor.css b/www/skins/admin/admincolor.css index 4733139710..925483e2dd 100644 --- a/www/skins/admin/admincolor.css +++ b/www/skins/admin/admincolor.css @@ -1,161 +1,6 @@ -body{ - background-color:white; - color:#000000; - overflow-y:auto; -} -a{ - color:#000000; - text-decoration:underline; - cursor:pointer; -} -a:hover{ - color:#000000; - text-decoration:underline; - cursor:pointer; -} -div.finder div.content div.title -{ - left:0; - margin-top:-2px; - overflow:hidden; - position:relative; - top:0; - white-space:nowrap; -} - -#mainMenu{ - background-color:#fceb3f; -} - -#mainMenu a, #mainMenu b, -#mainMenu .title{ - color:#000000; -} - -.treeview ul{ - background-color:transparent; -} - -img{ - vertical-align:middle - } /** FFFA00 9E9C3C 777400 FFFC65 FFFEB5 **/ - -#left{ - background-color:#fffbcd; - overflow:auto; -} -#FNDR{ - overflow:auto; -} - - -#mainMenu span{ - color:black; -} -#mainMenu span.selected { - border-top: 3px solid black; -} - -#mainMenu a:hover span{ - background-color:#FFFBCD; -} - -h1{ - font-weight: bold; - font-size:24px; - text-align:left; - margin:10px 0; -} - -h2{ - font-weight: bold; - font-size:18px; - text-align:left; - margin:7px 0; -} -h3{ - font-weight: bold; - font-size:14px; - text-align:left; - margin:4px 0; -} -h4{ - font-weight: bold; - font-size:12px; - text-align:left; - margin:2px 0; -} - -.admin_head_opts{ - margin:5px 0; -} - -.admin_head_opts span{ - margin:0px 10px; -} - -table.admintable{ - width:100%; - border:none; - margin:10px 0; -} -table.admintable thead{ - background-color:#e5d4a0; -} -table.admintable thead th{ - text-align:left; - font-weight:bold; -} -table.admintable tr{ - height:28px; - vertical-align: middle; -} -table.admintable tbody tr.even{ - background-color:#fffbcd; -} -table.admintable tbody tr.selected{ - background-color: #f0ad30; -} -table.admintable tbody .dropdown{ - cursor:pointer; -} - -#users_check_uncheck{ -} -#users_check_uncheck div{ - padding:5px 10px; - background-color:#CCCCCC; - color:black; - cursor:pointer -} -#users_check_uncheck div.hovered{ - padding:5px 10px; - background-color:#555555; - color:white; -} -.users_col.options{ - cursor:pointer; - color:#AFAFAF; -} -#users th.sortable span{ - margin:0 5px; -} -#users th.sortable{ - cursor:pointer; -} -#users th.sortable.hover, -#users th.sortable.sorted{ - background-color:#F0AD30; -} -#users th.sortable span.ord_notifier{ - display:none; -} -#users th.sortable.sorted span.ord_notifier{ - display:inline; -} \ No newline at end of file diff --git a/www/skins/admin/css/Main.css b/www/skins/admin/css/Main.css new file mode 100644 index 0000000000..3203a09d25 --- /dev/null +++ b/www/skins/admin/css/Main.css @@ -0,0 +1,158 @@ +/******* GLOBAL CSS for ADMIN *************************************************/ +body { + margin: 0; + padding: 0; + background-color: #ffffff; + color: #333333; + overflow-y: auto; +} +h1 { + font-weight: bold; + font-size: 24px; + text-align: left; + margin: 10px 0; +} +h2 { + font-weight: bold; + font-size: 18px; + text-align: left; + margin: 7px 0; +} +h3 { + font-weight: bold; + font-size: 14px; + text-align: left; + margin: 4px 0; +} +h4 { + font-weight: bold; + font-size: 12px; + text-align: left; + margin: 2px 0; +} +a { + color: #333333; + text-decoration: underline; + cursor: pointer; +} +a:hover { + color: #005580; + text-decoration: underline; + cursor: pointer; +} +img { + vertical-align: middle; +} +input, +textarea, +select, +.uneditable-input { + margin: 0; + padding: 4px; +} +.treeview ul { + background-color: transparent; +} +div.finder div.content div.title { + margin-top: -2px; + position: relative; + top: 0; + left: 0; + white-space: nowrap; + overflow: hidden; +} +/******* MAIN MENU ************************************************************/ +#mainMenu { + background-color: #fceb3f; +} +#mainMenu a, +#mainMenu b, +#mainMenu .title, +#mainMenu span { + color: #000000; +} +#mainMenu a:hover span { + background-color: #fffbcd; +} +#mainMenu span.selected { + border-top: 3px solid #000000; +} +/******* LEFT SIDE ************************************************************/ +#left { + background-color: #fffbcd; + overflow: auto; +} +#FNDR { + overflow: auto; +} +/******* USERS ****************************************************************/ +.admin_head_opts { + margin: 5px 0 10px 0; +} +.admin_head_opts span { + margin: 0 10px; +} +.admin_head_opts a { + margin: 0 5px; +} +#users_page_form p { + margin: 5px 5px 10px; +} +#users_page_form .input-mini { + width: 30px; +} +#users_check_uncheck div { + padding: 5px 10px; + background-color: #cccccc; + color: #000000; + cursor: pointer; +} +#users_check_uncheck div.hovered { + padding: 5px 10px; + background-color: #4d4d4d; + color: #ffffff; +} +/******* EDIT USERS ***********************************************************/ +div.no_switch { + width: 12px; + height: 12px; + margin: 0 auto; + background-image: url('/skins/icons/ccoch5.gif'); + background-repeat: no-repeat; + background-position: center center; +} +div.switch_quota, +div.switch_masks, +div.switch_time, +div.switch_right { + width: 12px; + height: 12px; + margin: 0 auto; +} +div.switch_quota.mixed, +div.switch_masks.mixed, +div.switch_time.mixed, +div.switch_right.mixed { + background-image: url('/skins/icons/ccoch2.gif'); + background-repeat: no-repeat; + background-position: center center; +} +div.switch_quota.checked, +div.switch_masks.checked, +div.switch_time.checked, +div.switch_right.checked { + background-image: url('/skins/icons/ccoch1.gif'); + background-repeat: no-repeat; + background-position: center center; +} +div.switch_quota.unchecked, +div.switch_masks.unchecked, +div.switch_time.unchecked, +div.switch_right.unchecked { + background-image: url('/skins/icons/ccoch0.gif'); + background-repeat: no-repeat; + background-position: center center; +} +.ui-datepicker { + z-index: 1500; +} diff --git a/www/skins/admin/css/Tables.css b/www/skins/admin/css/Tables.css new file mode 100644 index 0000000000..b5b5359c16 --- /dev/null +++ b/www/skins/admin/css/Tables.css @@ -0,0 +1,64 @@ +/******* TABLES ***************************************************************/ +table.admintable { + width: 100%; + margin: 10px 0; + border: none; +} +table.admintable tr { + height: 28px; + vertical-align: middle; +} +table.admintable thead { + background-color: #e5d4a0; +} +table.admintable thead th { + padding: 3px; + text-align: left; + font-weight: bold; +} +table.admintable tbody tr.even { + background-color: #fffbcd; +} +table.admintable tbody tr.selected { + background-color: #f0ad30; +} +table.admintable tbody tr:hover { + background-color: #e5d4a0; + cursor: pointer; +} +table.admintable tbody td { + padding: 3px; +} +table.admintable tbody.dropdown { + cursor: pointer; +} +/******* USERS TABLE **********************************************************/ +#users th.sortable { + cursor: pointer; +} +#users th.sortable span { + margin: 0 5px; +} +#users th.sortable span.ord_notifier { + display: none; +} +#users th.sortable.hover { + background-color: #f0ad30; +} +#users th.sortable.sorted { + background-color: #f0ad30; +} +#users th.sortable.sorted span.ord_notifier { + display: inline; +} +/******* EDIT-USERS TABLE *****************************************************/ +td.users_col { + width: 23px; + border: 0px solid transparent; + vertical-align: middle; + text-align: center; +} +td.users_col.options { + color: #afafaf; + cursor: pointer; +} diff --git a/www/skins/admin/csscompiler.sh b/www/skins/admin/csscompiler.sh new file mode 100755 index 0000000000..663dc68c1b --- /dev/null +++ b/www/skins/admin/csscompiler.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +for i in $( ls less ); do + lessc $DIR/less/$i $DIR/css/`echo $i | sed -e 's/less/css/g'` +done diff --git a/www/skins/admin/less/Main.less b/www/skins/admin/less/Main.less new file mode 100644 index 0000000000..14e65b5bda --- /dev/null +++ b/www/skins/admin/less/Main.less @@ -0,0 +1,197 @@ +//****** LESS SETTINGS ********************************************************/ + +// Colors & bg settings +@white: #FFF; +@black: #000; +@dark: #333; +@grey: #CCC; +@blue: #005580; +@orange: #F0AD30; +@lemon: #FCEB3F; +@sand: #FFFBCD; +@dk-sand: #E5D4A0; +.bg(@c: @white) { + background-color: @c; +} +.bgi(@url: '') { + background-image: url(@url); + background-repeat: no-repeat; + background-position: center center; +} + +// Spaces settings +.no-space() { + margin: 0; + padding: 0; +} + +// Text settings +@size: 12px; +.title(@size, @m1, @m2) { + font-weight: bold; + font-size: @size; + text-align: left; + margin: @m1 @m2; +} +.color(@c: @dark) { + color: @c; +} + +// Misc. +.cursor(@type: pointer) { + cursor: @type; +} + +/******* GLOBAL CSS for ADMIN *************************************************/ + +body { + .no-space; + .bg; + .color; + overflow-y: auto; +} + +h1 { + .title(@size * 2,10px,0); +} + +h2 { + .title(@size + 6,7px,0); +} + +h3 { + .title(@size + 2,4px,0); +} + +h4 { + .title(@size,2px,0); +} + +a { + .color; + text-decoration: underline; + .cursor; + &:hover { + .color(@blue); + text-decoration: underline; + .cursor; + } +} + +img { + vertical-align: middle; +} + +input, textarea, select, .uneditable-input { + margin: 0; + padding: 4px; +} + +.treeview ul { + .bg(transparent); +} + +div.finder div.content div.title { + margin-top: -2px; + position: relative; + top: 0; + left: 0; + white-space: nowrap; + overflow: hidden; +} + +/******* MAIN MENU ************************************************************/ + +#mainMenu { + .bg(@lemon); + a, b, .title, span { + .color(@black); + } + a { + &:hover { + span { + .bg(@sand); + } + } + } + span { + &.selected { + border-top: 3px solid @black; + } + } +} + +/******* LEFT SIDE ************************************************************/ + +#left { + .bg(@sand); + overflow: auto; +} + +#FNDR { + overflow: auto; +} + +/******* USERS ****************************************************************/ + +.admin_head_opts { + margin: 5px 0 10px 0; + span { + margin: 0 10px; + } + a { + margin: 0 5px; + } +} + +#users_page_form { + p { + margin: 5px 5px 10px; + } + .input-mini { + width: 30px; + } +} + +#users_check_uncheck div { + padding: 5px 10px; + .bg(@grey); + .color(@black); + .cursor; + &.hovered { + padding: 5px 10px; + .bg(darken(@grey, 50%)); + .color(@white); + } +} + +/******* EDIT USERS ***********************************************************/ + +div.no_switch { + width: 12px; + height: 12px; + margin: 0 auto; + .bgi('/skins/icons/ccoch5.gif'); +} + +div.switch_quota, +div.switch_masks, +div.switch_time, +div.switch_right { + width: 12px; + height: 12px; + margin: 0 auto; + &.mixed { + .bgi('/skins/icons/ccoch2.gif'); + } + &.checked { + .bgi('/skins/icons/ccoch1.gif'); + } + &.unchecked { + .bgi('/skins/icons/ccoch0.gif'); + } +} + +.ui-datepicker { + z-index:1500; +} diff --git a/www/skins/admin/less/Tables.less b/www/skins/admin/less/Tables.less new file mode 100644 index 0000000000..216498e00e --- /dev/null +++ b/www/skins/admin/less/Tables.less @@ -0,0 +1,108 @@ +//****** LESS SETTINGS ********************************************************/ + +// Colors & bg settings +@white: #FFF; +@black: #000; +@dark: #333; +@grey: #CCC; +@blue: #005580; +@orange: #F0AD30; +@lemon: #FCEB3F; +@sand: #FFFBCD; +@dk-sand: #E5D4A0; +.bg(@c: @white) { + background-color: @c; +} + +// Spaces settings +.no-space() { + margin: 0; + padding: 0; +} + +// Text settings +.color(@c: @dark) { + color: @c; +} + +// Misc. +.cursor(@type: pointer) { + cursor: @type; +} + +/******* TABLES ***************************************************************/ + +table.admintable { + width: 100%; + margin: 10px 0; + border: none; + tr { + height: 28px; + vertical-align: middle; + } + thead { + .bg(@dk-sand); + th { + padding: 3px; + text-align: left; + font-weight: bold; + } + } + tbody { + tr { + &.even { + .bg(@sand); + } + &.selected { + .bg(@orange); + } + &:hover { + .bg(@dk-sand); + .cursor; + } + } + td { + padding: 3px; + } + &.dropdown { + .cursor; + } + } +} + +/******* USERS TABLE **********************************************************/ + +#users th.sortable { + .cursor; + span { + margin: 0 5px; + &.ord_notifier { + display: none; + } + } + &.hover { + .bg(@orange); + } + &.sorted { + .bg(@orange); + span { + &.ord_notifier { + display: inline; + } + } + } +} + +/******* EDIT-USERS TABLE *****************************************************/ + +td.users_col { + width: 23px; + border: 0px solid transparent; + vertical-align: middle; + text-align: center; + &.options { + .color(#AFAFAF); + .cursor; + } +} + From 763fd2d5098002bf221ab585b5997c73d3ea594c Mon Sep 17 00:00:00 2001 From: Ysolyne Gresille Date: Tue, 26 Jun 2012 14:51:40 +0200 Subject: [PATCH 02/17] left menu update --- templates/web/admin/tree.html.twig | 42 +++++++++++++++--------------- www/skins/admin/css/Main.css | 16 ++++++++++++ www/skins/admin/less/Main.less | 16 ++++++++++++ 3 files changed, 53 insertions(+), 21 deletions(-) diff --git a/templates/web/admin/tree.html.twig b/templates/web/admin/tree.html.twig index b1a25402cc..7bda2d8964 100644 --- a/templates/web/admin/tree.html.twig +++ b/templates/web/admin/tree.html.twig @@ -6,12 +6,12 @@
  • - {% trans 'Tableau de bord' %} + {% trans 'Tableau de bord' %}
  • {% else %}
  • - {{ registry.get('GV_ServerName') }} + {{ registry.get('GV_ServerName') }}
  • {% endif %} @@ -19,13 +19,13 @@
  • - Setup + Setup
  • {% if registry.get('GV_sphinx') %}
  • - Sphinx Conf + Sphinx Conf
  • {% endif %} @@ -34,7 +34,7 @@
  • - {% trans 'admin::utilisateurs: utilisateurs connectes' %} + {% trans 'admin::utilisateurs: utilisateurs connectes' %}
  • @@ -42,13 +42,13 @@
  • - {% trans 'admin::utilisateurs: utilisateurs' %} + {% trans 'admin::utilisateurs: utilisateurs' %}
  • - {% trans 'admin::utilisateurs: demandes en cours' %} + {% trans 'admin::utilisateurs: demandes en cours' %}
  • {% endif %} @@ -57,7 +57,7 @@
  • - {% trans 'Publications' %} + {% trans 'Publications' %}
  • {% endif %} @@ -66,7 +66,7 @@
  • - {% trans 'admin::utilisateurs: gestionnaire de taches' %} + {% trans 'admin::utilisateurs: gestionnaire de taches' %}
  • {% endif %} @@ -75,7 +75,7 @@
      @@ -100,7 +100,7 @@
        @@ -109,36 +109,36 @@
      • - {% trans 'admin::structure: reglage de la structure' %} + {% trans 'admin::structure: reglage de la structure' %}
      • - {% trans 'CHAMPS' %} + {% trans 'CHAMPS' %}
      • - {% trans 'SUBDEFS' %} + {% trans 'SUBDEFS' %}
      • - {% trans 'admin::status: reglage des status' %} + {% trans 'admin::status: reglage des status' %}
      • - {% trans 'admin:: CGUs' %} + {% trans 'admin:: CGUs' %}
      • - {% trans 'admin::collection: ordre des collections' %} + {% trans 'admin::collection: ordre des collections' %}
      • {% endif %} @@ -155,7 +155,7 @@
      • - {% trans 'admin::utilisateurs: utilisateurs' %} + {% trans 'admin::utilisateurs: utilisateurs' %}
      • {% endif %} @@ -168,7 +168,7 @@
        • @@ -177,7 +177,7 @@
        • - {% trans 'admin::base: preferences de collection' %} + {% trans 'admin::base: preferences de collection' %}
        • {% endif %} @@ -189,7 +189,7 @@
        • - {% trans 'admin::utilisateurs: utilisateurs' %} + {% trans 'admin::utilisateurs: utilisateurs' %}
        • {% endif %} diff --git a/www/skins/admin/css/Main.css b/www/skins/admin/css/Main.css index 3203a09d25..0f914c49ba 100644 --- a/www/skins/admin/css/Main.css +++ b/www/skins/admin/css/Main.css @@ -85,6 +85,22 @@ div.finder div.content div.title { #FNDR { overflow: auto; } +#FNDR li.selected { + background-color: #f0ad30; + color: #ffffff; +} +#FNDR a { + text-decoration: none; +} +#FNDR a:hover { + text-decoration: none; +} +#FNDR a span { + text-decoration: underline; +} +#FNDR a span:hover { + text-decoration: underline; +} /******* USERS ****************************************************************/ .admin_head_opts { margin: 5px 0 10px 0; diff --git a/www/skins/admin/less/Main.less b/www/skins/admin/less/Main.less index 14e65b5bda..88f0a3a7e2 100644 --- a/www/skins/admin/less/Main.less +++ b/www/skins/admin/less/Main.less @@ -130,6 +130,22 @@ div.finder div.content div.title { #FNDR { overflow: auto; + li.selected { + .bg(@orange); + .color(@white); + } + a { + text-decoration: none; + &:hover { + text-decoration: none; + } + span { + text-decoration: underline; + &:hover { + text-decoration: underline; + } + } + } } /******* USERS ****************************************************************/ From d4b0cb6c827a7a9b82c42045a811fc5ff2aed28b Mon Sep 17 00:00:00 2001 From: Ysolyne Gresille Date: Tue, 26 Jun 2012 18:49:07 +0200 Subject: [PATCH 03/17] connected users tables updated --- www/admin/sessionwhois.php | 83 +++++++++----------------------- www/skins/admin/css/Tables.css | 37 ++++++++++++++ www/skins/admin/less/Tables.less | 44 +++++++++++++++++ 3 files changed, 105 insertions(+), 59 deletions(-) diff --git a/www/admin/sessionwhois.php b/www/admin/sessionwhois.php index a58e9db51d..cd43b9e79e 100644 --- a/www/admin/sessionwhois.php +++ b/www/admin/sessionwhois.php @@ -20,7 +20,7 @@ $session = $appbox->get_session(); ?> -
          -
          -
          -
          + +
          -
          \n"; +$out.="
          \n"; $out.="\n"; $out.=" \n"; @@ -162,88 +161,54 @@ foreach (Session_Handler::get_active_sessions() as $row) { $out.="
          \n"; -echo "
          "; +echo "
          "; -echo ""; +echo "
          "; echo ""; -echo " "; -echo " "; -echo ""; -echo ""; -echo " "; +echo " "; echo ""; echo ""; -echo " "; -echo " "; +echo " "; +echo " "; echo ""; echo ""; -echo " "; +echo " "; echo ""; echo ""; -echo " "; -echo " "; +echo " "; +echo " "; echo ""; echo ""; -echo " "; +echo " "; echo ""; echo ""; -echo " "; -echo " "; +echo " "; +echo " "; echo ""; echo ""; -echo " "; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; +echo " "; echo ""; if ($appLaunched[0] > 0) { - echo ""; - echo ""; - - echo ""; - echo ""; + echo ""; echo ""; } - echo "
          " . _('admin::monitor: module production') . "" . $appLaunched[1] . "
          "; +echo " " . _('admin::monitor: module production') . "" . $appLaunched[1] . "
          " . _('admin::monitor: module client') . "" . $appLaunched[2] . "" . _('admin::monitor: module client') . "" . $appLaunched[2] . "
          "; +echo " " . _('admin::monitor: module admin') . "" . $appLaunched[3] . "
          " . _('admin::monitor: module admin') . "" . $appLaunched[3] . "" . _('admin::monitor: module report') . "" . $appLaunched[4] . "
          "; +echo " " . _('admin::monitor: module thesaurus') . "" . $appLaunched[5] . "
          " . _('admin::monitor: module report') . "" . $appLaunched[4] . "" . _('admin::monitor: module comparateur') . "" . $appLaunched[6] . "
          "; -echo "
          " . _('admin::monitor: module thesaurus') . "" . $appLaunched[5] . "
          "; -echo "
          " . _('admin::monitor: module comparateur') . "" . $appLaunched[6] . "
          "; -echo "
          " . _('admin::monitor: module validation') . "" . $appLaunched[7] . "
          "; +echo " " . _('admin::monitor: module validation') . "" . $appLaunched[7] . "
          "; - echo "
          " . _('admin::monitor: total des utilisateurs uniques : '); - echo " " . $appLaunched[0] . "" . _('admin::monitor: total des utilisateurs uniques : '); + echo " " . $appLaunched[0] . "
          "; -echo "
          "; +echo "
          "; - -echo "




          "; +echo "
          "; echo $out; diff --git a/www/skins/admin/css/Tables.css b/www/skins/admin/css/Tables.css index b5b5359c16..5d72b42c5b 100644 --- a/www/skins/admin/css/Tables.css +++ b/www/skins/admin/css/Tables.css @@ -1,4 +1,41 @@ /******* TABLES ***************************************************************/ +div.center { + width: 100%; + margin: auto; +} +.tableTitle { + margin: 20px auto; + font-weight: bold; + font-size: 14px; + text-align: center; + text-decoration: underline; +} +table.whoisTable { + margin: auto; + border: #000000 1px solid; + table-layout: fixed; +} +table.whoisTable tr { + border: #cccccc 1px solid; +} +table.whoisTable tr:hover { + background-color: #fffbcd; +} +table.whoisTable td { + padding: 3px; +} +table.whoisTable td.colTitle { + width: 120px; + text-align: left; +} +table.whoisTable td.noborder { + width: 60px; + text-align: right; +} +.spacehr { + margin-top: 40px; + margin-bottom: 30px; +} table.admintable { width: 100%; margin: 10px 0; diff --git a/www/skins/admin/less/Tables.less b/www/skins/admin/less/Tables.less index 216498e00e..723b92f0dc 100644 --- a/www/skins/admin/less/Tables.less +++ b/www/skins/admin/less/Tables.less @@ -21,6 +21,13 @@ } // Text settings +.titleTable(@m1, @m2, @size, @align, @deco) { + margin: @m1 @m2; + font-weight: bold; + font-size: @size; + text-align: @align; + text-decoration: @deco; +} .color(@c: @dark) { color: @c; } @@ -32,6 +39,43 @@ /******* TABLES ***************************************************************/ +div.center { + width: 100%; + margin: auto; +} + +.tableTitle { + .titleTable(20px, auto, 14px, center, underline); +} + +table.whoisTable { + margin: auto; + border: @black 1px solid; + table-layout: fixed; + tr { + border: @grey 1px solid; + &:hover { + .bg(@sand); + } + } + td { + padding: 3px; + &.colTitle { + width: 120px; + text-align: left; + } + &.noborder { + width: 60px; + text-align: right; + } + } +} + +.spacehr { + margin-top: 40px; + margin-bottom: 30px; +} + table.admintable { width: 100%; margin: 10px 0; From 03e0d363d7b7e91c2a1bb3d8d7637dab034787d5 Mon Sep 17 00:00:00 2001 From: Ysolyne Gresille Date: Wed, 27 Jun 2012 15:23:18 +0200 Subject: [PATCH 04/17] publications section updated for Admin --- .../web/admin/publications/fiche.html.twig | 2 +- templates/web/admin/publications/list.html | 169 +++++++++--------- templates/web/admin/publications/wrapper.html | 18 +- www/skins/admin/css/Main.css | 9 +- www/skins/admin/less/Main.less | 16 +- 5 files changed, 120 insertions(+), 94 deletions(-) diff --git a/templates/web/admin/publications/fiche.html.twig b/templates/web/admin/publications/fiche.html.twig index 546157263e..0cab8f7c6f 100644 --- a/templates/web/admin/publications/fiche.html.twig +++ b/templates/web/admin/publications/fiche.html.twig @@ -3,7 +3,7 @@ {% block content %}
          {% if error %} -
          {{error}}
          +
          {{error}}
          {% endif %} {% if feed.is_owner(user) %}

          {% trans 'Edition' %}

          diff --git a/templates/web/admin/publications/list.html b/templates/web/admin/publications/list.html index efbd0decaf..c6a9b85447 100644 --- a/templates/web/admin/publications/list.html +++ b/templates/web/admin/publications/list.html @@ -1,93 +1,97 @@ {% extends 'admin/publications/wrapper.html' %} - {% block content %} - - -
          -

          {% trans 'Ajouter une publication' %}

          -
          - - -
          -
          - - -
          -
          - - -
          -
          - - -
          -
          - -
          + +

          {% trans 'Ajouter une publication' %}

          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + +
          +
          +
          - - - - - - - - - - - - {% for feed in feeds.get_feeds %} - - - - - - - - - {% endfor %} - + + + + + + + + + + + + {% for feed in feeds.get_feeds %} + + + + + + + + + {% endfor %} +
          {% trans 'Titre' %}{% trans 'Date Creation' %}{% trans 'Restriction' %}{% trans 'Public' %}
          -
          - - - -
          -
          {{ feed.get_title() }}{{ feed.get_created_on()| formatDate }} - {% if feed.get_collection() != null %} - {{ feed.get_collection().get_databox().get_viewname() }} / - {{ feed.get_collection().get_name() }} - {% endif %} - - {% if feed.is_public() %} - - {% endif %} - - {% if feed.is_owner(user) %} -
          - -
          - {% endif %} -
          {% trans 'Titre' %}{% trans 'Date Creation' %}{% trans 'Restriction' %}{% trans 'Public' %}
          +
          + + + +
          +
          + {{ feed.get_title() }} + + {{ feed.get_created_on()|formatdate }} + + {% if feed.get_collection() != null %} + {{ feed.get_collection().get_databox().get_viewname() }} / + {{ feed.get_collection().get_name() }} + {% endif %} + + {% if feed.is_public() %} + + {% endif %} + + {% if feed.is_owner(user) %} +
          + +
          + {% endif %} +
          - -{% endblock %} \ No newline at end of file + +{% endblock %} diff --git a/templates/web/admin/publications/wrapper.html b/templates/web/admin/publications/wrapper.html index 5e3bb22fed..7004fe3db9 100644 --- a/templates/web/admin/publications/wrapper.html +++ b/templates/web/admin/publications/wrapper.html @@ -1,17 +1,17 @@

          {% trans 'Publications' %}

          - {% block content %}{% endblock %} + {% block content %}{% endblock %}
          -
          -
          - - -
          -
          - - -
          -
          - - -
          -
          - - -
          -
          - - {% trans 'boutton::annuler' %} -
          -
          -
          -

          {% trans 'Liste des personnes habilitees a publier sur ce fil' %}

          - - - - - - - - - - - {% for publisher in feed.get_publishers() %} - - - - - - - {% endfor %} - -
          {% trans 'Id' %}{% trans 'Email' %}{% trans 'Owner' %}
          - {{ publisher.get_user().get_id() }} - - {{ publisher.get_user().get_display_name() }} - - {{ publisher.get_user().get_email() }} - - {% if publisher.is_owner() == true %} - X - {% else %} -
          - - -
          - {% endif %} -
          -
          -
          - - - -
          -
          -
          - - - {% else %} - {% trans 'You are not the feed owner' %} - {% trans 'boutton::retour' %} - {% endif %} + + +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + +
          +
          +
          + + {% trans 'boutton::annuler' %} +
          +
          +
          +
          +

          {% trans 'Liste des personnes habilitees a publier sur ce fil' %}

          + + + + + + + + + + + {% for publisher in feed.get_publishers() %} + + + + + + + {% endfor %} + +
          {% trans 'Id' %}{% trans 'Email' %}{% trans 'Owner' %}
          + {{ publisher.get_user().get_id() }} + + {{ publisher.get_user().get_display_name() }} + + {{ publisher.get_user().get_email() }} + + {% if publisher.is_owner() == true %} + X + {% else %} +
          + + +
          + {% endif %} +
          +
          +
          +
          + +
          + + +
          +
          +
          +
          +
          + + + + + {% else %} + {% trans 'You are not the feed owner' %} + {% trans 'boutton::retour' %} + {% endif %}
          + {% endblock %} \ No newline at end of file diff --git a/templates/web/admin/publications/list.html b/templates/web/admin/publications/list.html index c6a9b85447..774f44391c 100644 --- a/templates/web/admin/publications/list.html +++ b/templates/web/admin/publications/list.html @@ -57,9 +57,9 @@ {% for feed in feeds.get_feeds %} -
          + diff --git a/www/skins/admin/css/Main.css b/www/skins/admin/css/Main.css index ec2285672e..bc10a758d9 100644 --- a/www/skins/admin/css/Main.css +++ b/www/skins/admin/css/Main.css @@ -6,6 +6,9 @@ body { color: #333333; overflow-y: auto; } +.clear { + clear: both; +} h1 { font-weight: bold; font-size: 24px; @@ -51,7 +54,8 @@ textarea, } select { margin: 0; - padding: 6px 4px; + padding: 5px 4px; + *padding: 4px; } .treeview ul { background-color: transparent; @@ -179,3 +183,22 @@ div.switch_right.unchecked { .form_publication .controls { margin-left: 10px; } +#pub_icon { + width: 42px; + height: 42px; + float: left; +} +#pub_icon .thumb_wrapper { + width: 32px; + height: 32px; + margin: 5px auto; +} +#pub_icon .thumb_wrapper img { + width: 32px; + height: 32px; +} +#pub_fileupload { + height: 42px; + line-height: 42px; + margin-left: 47px; +} diff --git a/www/skins/admin/less/Main.less b/www/skins/admin/less/Main.less index 12da5fea90..19efe3ec90 100644 --- a/www/skins/admin/less/Main.less +++ b/www/skins/admin/less/Main.less @@ -51,6 +51,10 @@ body { overflow-y: auto; } +.clear { + clear: both; +} + h1 { .title(@size * 2,10px,0); } @@ -89,7 +93,8 @@ input, textarea, .uneditable-input { select { margin: 0; - padding: 6px 4px; + padding: 5px 4px; + *padding: 4px; } .treeview ul { @@ -225,3 +230,25 @@ div.switch_right { } } +@ico-size: 32px; + +#pub_icon { + width: (@ico-size + 10px); + height: (@ico-size + 10px); + float: left; + .thumb_wrapper { + width: @ico-size; + height: @ico-size; + margin: 5px auto; + img { + width: @ico-size; + height: @ico-size; + } + } +} + +#pub_fileupload { + height: (@ico-size + 10px); + line-height: (@ico-size + 10px); + margin-left: (@ico-size + 10px) + 5px; +} From b0c273905f56793dae2006b5b39f488373b9f295 Mon Sep 17 00:00:00 2001 From: Ysolyne Gresille Date: Wed, 27 Jun 2012 18:22:34 +0200 Subject: [PATCH 06/17] tables skin updated for Admin --- templates/web/admin/index.html.twig | 17 ----------------- www/skins/admin/css/Main.css | 15 +++++++++++++++ www/skins/admin/css/Tables.css | 3 +++ www/skins/admin/less/Main.less | 13 +++++++++++++ www/skins/admin/less/Tables.less | 5 +++++ 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/templates/web/admin/index.html.twig b/templates/web/admin/index.html.twig index c7ef5b2861..5290174579 100644 --- a/templates/web/admin/index.html.twig +++ b/templates/web/admin/index.html.twig @@ -10,23 +10,6 @@ {% block stylesheet %} - - {% endblock %} diff --git a/www/skins/admin/css/Main.css b/www/skins/admin/css/Main.css index bc10a758d9..3e7f5d88f3 100644 --- a/www/skins/admin/css/Main.css +++ b/www/skins/admin/css/Main.css @@ -57,9 +57,24 @@ select { padding: 5px 4px; *padding: 4px; } +li.selected, +div.selected { + background-color: #f0ad30; + color: #ffffff; +} +li.selected a, +div.selected a { + background-color: #f0ad30; + color: #ffffff; +} .treeview ul { background-color: transparent; } +#right-ajax.loading { + background-image: url('/skins/icons/loaderFFF.gif'); + background-repeat: no-repeat; + background-position: center center; +} div.finder div.content div.title { margin-top: -2px; position: relative; diff --git a/www/skins/admin/css/Tables.css b/www/skins/admin/css/Tables.css index 5d72b42c5b..574500c0b8 100644 --- a/www/skins/admin/css/Tables.css +++ b/www/skins/admin/css/Tables.css @@ -45,6 +45,9 @@ table.admintable tr { height: 28px; vertical-align: middle; } +table.admintable tr.selected:hover { + background-color: #f0ad30; +} table.admintable thead { background-color: #e5d4a0; } diff --git a/www/skins/admin/less/Main.less b/www/skins/admin/less/Main.less index 19efe3ec90..432bfecae4 100644 --- a/www/skins/admin/less/Main.less +++ b/www/skins/admin/less/Main.less @@ -97,10 +97,23 @@ select { *padding: 4px; } +li.selected, div.selected { + .bg(@orange); + .color(@white); + a { + .bg(@orange); + .color(@white); + } +} + .treeview ul { .bg(transparent); } +#right-ajax.loading{ + .bgi('/skins/icons/loaderFFF.gif'); +} + div.finder div.content div.title { margin-top: -2px; position: relative; diff --git a/www/skins/admin/less/Tables.less b/www/skins/admin/less/Tables.less index 723b92f0dc..7239cdf5ef 100644 --- a/www/skins/admin/less/Tables.less +++ b/www/skins/admin/less/Tables.less @@ -83,6 +83,11 @@ table.admintable { tr { height: 28px; vertical-align: middle; + &.selected { + &:hover { + .bg(@orange); + } + } } thead { .bg(@dk-sand); From e449b80b872b7544cbf5d9b6ed405c0f10beadc2 Mon Sep 17 00:00:00 2001 From: Ysolyne Gresille Date: Thu, 28 Jun 2012 17:47:59 +0200 Subject: [PATCH 07/17] tooltips & connected users page updated --- config/nginx.rewrite.rules | 1 + lib/Alchemy/Phrasea/Application/Admin.php | 1 + .../Controller/Admin/ConnectedUsers.php | 68 ++++++ lib/classes/Session/Handler.class.php | 48 +++- templates/web/admin/connected-users.html.twig | 132 +++++++++++ templates/web/admin/index.html.twig | 55 +++-- templates/web/admin/tree.html.twig | 2 +- www/.htaccess | 3 +- www/admin/sessionwhois.php | 214 ------------------ www/skins/admin/css/Tables.css | 30 ++- www/skins/admin/less/Tables.less | 28 ++- www/skins/admin/test.php | 4 + 12 files changed, 333 insertions(+), 253 deletions(-) create mode 100644 lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php create mode 100644 templates/web/admin/connected-users.html.twig delete mode 100644 www/admin/sessionwhois.php create mode 100644 www/skins/admin/test.php diff --git a/config/nginx.rewrite.rules b/config/nginx.rewrite.rules index 5e54b68b17..2de196058f 100644 --- a/config/nginx.rewrite.rules +++ b/config/nginx.rewrite.rules @@ -14,6 +14,7 @@ rewrite ^/admin/description/.*$ /admin/router.php last; rewrite ^/admin/subdefs/.*$ /admin/router.php last; rewrite ^/admin/publications/.*$ /admin/router.php last; rewrite ^/admin/typeahead/.*$ /admin/router.php last; +rewrite ^/admin/connected-users/.*$ /admin/router.php last; rewrite ^/prod/records/edit/.*$ /prod/router.php last; diff --git a/lib/Alchemy/Phrasea/Application/Admin.php b/lib/Alchemy/Phrasea/Application/Admin.php index f84bc2b7fc..84e91aeb22 100644 --- a/lib/Alchemy/Phrasea/Application/Admin.php +++ b/lib/Alchemy/Phrasea/Application/Admin.php @@ -26,6 +26,7 @@ return call_user_func( $app['Core'] = \bootstrap::getCore(); $app->mount('/', new Controller\Root()); + $app->mount('/connected-users', new Controller\ConnectedUsers()); $app->mount('/publications', new Controller\Publications()); $app->mount('/users', new Controller\Users()); $app->mount('/fields', new Controller\Fields()); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php b/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php new file mode 100644 index 0000000000..5e6b3275b4 --- /dev/null +++ b/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php @@ -0,0 +1,68 @@ +get('/', function(Application $app, Request $request) { + + $app['Core']['Twig']->addFilter('AppName', new \Twig_Filter_Function(__CLASS__ . '::appName')); + + return new Response( + $app['Core']['Twig']->render( + 'admin/connected-users.html.twig', array('datas' => \Session_Handler::get_active_sessions() + ) + ) + ); + }); + + return $controllers; + } + + public function appName($appId) + { + $appRef = array( + '0' => _('admin::monitor: module inconnu') + , '1' => _('admin::monitor: module production') + , '2' => _('admin::monitor: module client') + , '3' => _('admin::monitor: module admin') + , '4' => _('admin::monitor: module report') + , '5' => _('admin::monitor: module thesaurus') + , '6' => _('admin::monitor: module comparateur') + , '7' => _('admin::monitor: module validation') + , '8' => _('admin::monitor: module upload') + ); + + return isset($appRef[$appId]) ? $appRef[$appId] : $appRef['0']; + } +} diff --git a/lib/classes/Session/Handler.class.php b/lib/classes/Session/Handler.class.php index 6eebf2480d..6e90f64f40 100644 --- a/lib/classes/Session/Handler.class.php +++ b/lib/classes/Session/Handler.class.php @@ -652,11 +652,43 @@ class Session_Handler $geonames = new geonames(); - foreach ($rs as $k => $row) { - $rs[$k]['created_on'] = new DateTime($row['created_on']); - $rs[$k]['lastaccess'] = new DateTime($row['lastaccess']); - $rs[$k]['token'] = ! ! $row['token']; - $rs[$k]['usr_id'] = User_Adapter::getInstance($row['usr_id'], appbox::get_instance(\bootstrap::getCore())); + $ret = array( + 'sessions' => array(), + 'applications' => array( + '0' => 0, + '1' => 0, + '2' => 0, + '3' => 0, + '4' => 0, + '5' => 0, + '6' => 0, + '7' => 0, + '8' => 0, + ) + ); + + foreach ($rs as $row) { + + $session = array(); + + $session['browser'] = $row['browser']; + $session['browser_version'] = $row['browser_version']; + $session['session_id'] = $row['session_id']; + $session['user_agent'] = $row['user_agent']; + $session['ip'] = $row['ip']; + $session['screen'] = $row['screen']; + $session['platform'] = $row['platform']; + $session['created_on'] = new DateTime($row['created_on']); + $session['lastaccess'] = new DateTime($row['lastaccess']); + $session['token'] = ! ! $row['token']; + $session['user'] = User_Adapter::getInstance($row['usr_id'], appbox::get_instance(\bootstrap::getCore())); + $session["app"] = (array) unserialize($row["app"]); + + foreach ($session["app"] as $app) { + if (isset($ret['applications'][$app])) { + $ret['applications'][$app] ++; + } + } $datas = $geonames->find_geoname_from_ip($row['ip']); @@ -670,10 +702,12 @@ class Session_Handler $infos = ''; } - $rs[$k]['ip_infos'] = $infos; + $session['ip_infos'] = $infos; + + $ret['sessions'][] = $session; } - return $rs; + return $ret; } } diff --git a/templates/web/admin/connected-users.html.twig b/templates/web/admin/connected-users.html.twig new file mode 100644 index 0000000000..1225053a8a --- /dev/null +++ b/templates/web/admin/connected-users.html.twig @@ -0,0 +1,132 @@ +{% macro tooltip_connected_users(row) %} + + + + + + + + + + + + + + + + + + + + + + + + + {% for databox in row['user'].ACL().get_granted_sbas() %} + + + + {% endfor %} + + + +
          usr_id : {{ row['user'].get_id() }}
          {{ 'admin::compte-utilisateur nom' | trans }} : {{ row['user'].get_display_name() }}
          {{ 'admin::compte-utilisateur societe' | trans }} : {{ row['user'].get_company() }}
          {{ 'admin::compte-utilisateur telephone' | trans }} : {{ row['user'].get_tel() }}
          {{ 'admin::compte-utilisateur email' | trans }} : {{ row['user'].get_email() }}
          {{ 'admin::monitor: bases sur lesquelles l\'utilisateur est connecte : ' | trans }} :
          {{ databox.get_viewname() }}
          + {{ row['platform'] }} / {{ row['browser'] }} - {{ row['browser_version'] }}
          + {% if row['token'] %} + {{ 'Session persistente' | trans }} + {%endif%} +
          +
          + +{% endmacro %} + +
          {{ 'admin::utilisateurs: utilisateurs connectes' | trans }}
          + +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% if datas['applications'][0] != 0 %} + + + + + {% endif %} +
          {{ 'admin::monitor: module production' | trans }}{{ datas['applications'][1] }}
          {{ 'admin::monitor: module client' | trans }}{{ datas['applications'][2] }}
          {{ 'admin::monitor: module admin' | trans }}{{ datas['applications'][3] }}
          {{ 'admin::monitor: module report' | trans }}{{ datas['applications'][4] }}
          {{ 'admin::monitor: module thesaurus' | trans }}{{ datas['applications'][5] }}
          {{ 'admin::monitor: module comparateur' | trans }}{{ datas['applications'][6] }}
          {{ 'admin::monitor: module validation' | trans }}{{ datas['applications'][7] }}
          {{ 'admin::monitor: total des utilisateurs uniques : ' | trans }}{{ datas['applications'][0] }}
          +
          + +
          + +
          + + + + + + + + + + + + {% for row in datas['sessions'] %} + + + {% if row["session_id"] == session.get_ses_id() %} + + {% else %} + + {% endif %} + + + + + + + + + {% endfor %} + +
          {{ 'admin::monitor: utilisateur' | trans }}{{ 'admin::monitor: modules' | trans }}{{ 'phraseanet:: adresse' | trans }}{{ 'admin::monitor: date de connexion' | trans }}{{ 'admin::monitor: dernier access' | trans }}
          {{ row['user'].get_display_name() }}{{ row['user'].get_display_name() }} + {% for app in row["app"] %} + {% if app != 0 %} + {{ app | AppName }}
          + {% endif %} + {% endfor %} +
          {{ row["ip"] }}
          {{ row["ip_infos"] }}
          {{ row['created_on'] | getDate }}{{ row['lastaccess'] | prettyString }}
          +
          + + diff --git a/templates/web/admin/index.html.twig b/templates/web/admin/index.html.twig index 5290174579..f59d199a95 100644 --- a/templates/web/admin/index.html.twig +++ b/templates/web/admin/index.html.twig @@ -164,31 +164,30 @@ {% block content %}
          -
          -
          +
          +
          {% include 'admin/tree.html.twig' %} -
          +
          -
          +
          - {% if notice %} -
          - {% if notice == "install_success" %} - {% trans %}Successful install{% endtrans %} - {% endif %} -
          - {% endif %} + {% if notice %} +
          + {% if notice == "install_success" %} + {% trans %}Successful install{% endtrans %} + {% endif %} +
          + {% endif %} - -
          -
          -
          - -
          -
          -
          -
          -
          + +
          +
          +
          +
          +
          +
          +
          + - -
          -
          -
          +
          +
          +
          +
          -
          -
          -
          + +
          +
          {% endblock %} diff --git a/templates/web/admin/tree.html.twig b/templates/web/admin/tree.html.twig index 7bda2d8964..65e076b44a 100644 --- a/templates/web/admin/tree.html.twig +++ b/templates/web/admin/tree.html.twig @@ -32,7 +32,7 @@ {% endif %}
        • - + {% trans 'admin::utilisateurs: utilisateurs connectes' %} diff --git a/www/.htaccess b/www/.htaccess index 211328fe0b..d859109912 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -10,7 +10,8 @@ RewriteRule ^register-confirm=([a-zA-Z0-9]+)$ /login/register-confirm.php?code=$1 [L] RewriteRule ^admin/$ /admin/router.php [L] - RewriteRule ^admin/description/.*$ /admin/router.php [L] + RewriteRule ^admin/description/.*$ /admin/router.php [L] + RewriteRule ^admin/connected-users/.*$ /admin/router.php [L] RewriteRule ^admin/users/.*$ /admin/router.php [L] RewriteRule ^admin/tests/.*$ /admin/router.php [L] RewriteRule ^admin/fields/.*$ /admin/router.php [L] diff --git a/www/admin/sessionwhois.php b/www/admin/sessionwhois.php deleted file mode 100644 index cd43b9e79e..0000000000 --- a/www/admin/sessionwhois.php +++ /dev/null @@ -1,214 +0,0 @@ -get_session(); -?> - - - -
          -
          - - 0 - , '1' => 0 - , '2' => 0 - , '3' => 0 - , '4' => 0 - , '5' => 0 - , '6' => 0 - , '7' => 0 - , '8' => 0 -); - -$out = ""; - - -$out.="
          \n"; - -$out.="\n"; -$out.=" \n"; -$out.=" "; -$out.=" "; -$out.=" "; -$out.=" "; -$out.=" "; -$out.=" - "; - -$n = 0; - -foreach (Session_Handler::get_active_sessions() as $row) { - $onedetail = ""; - $onedetail.="
          " . _('admin::monitor: utilisateur') . "" . _('admin::monitor: modules') . "" . _('phraseanet:: adresse') . "" . _('admin::monitor: date de connexion') . "" . _('admin::monitor: dernier access') . "
          "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - - $onedetail.=" "; - $onedetail.=" "; - - $onedetail.=" "; - $onedetail.=" "; - - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - - $onedetail.="
          "; - $onedetail.=" "; - $onedetail.="
          usr_id : " . $row['usr_id']->get_id() . "
          "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.="
          " . _('admin::compte-utilisateur nom') . ' : ' . $row['usr_id']->get_display_name() . "
          " . _('admin::compte-utilisateur societe') . ' : ' . $row['usr_id']->get_company() . "
          " . _('admin::compte-utilisateur telephone') . ' : ' . $row['usr_id']->get_tel() . "
          " . _('admin::compte-utilisateur email') . ' : ' . $row['usr_id']->get_email() . "
          "; - $onedetail.="
          "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - - foreach ($row['usr_id']->ACL()->get_granted_sbas() as $databox) { - $onedetail.=" "; - $onedetail.=" "; - $onedetail.=" "; - } - $onedetail.="
          " . _('admin::monitor: bases sur lesquelles l\'utilisateur est connecte : ') . "
          " . $databox->get_viewname() . "
          "; - $onedetail.="
          " . - $row['platform'] . ' / ' . $row['browser'] . ' - ' . $row['browser_version'] . '
          ' . ($row['token'] ? _('Session persistente') : '') . - "
          "; - $onedetail.=""; - - - - $out.=""; - - - if ($row["session_id"] == $session->get_ses_id()) - $out.=sprintf("" . $row['usr_id']->get_display_name() . "\n"); - else - $out.=sprintf("" . $row['usr_id']->get_display_name() . "\n"); - - $appRef = array( - '0' => _('admin::monitor: module inconnu') - , '1' => _('admin::monitor: module production') - , '2' => _('admin::monitor: module client') - , '3' => _('admin::monitor: module admin') - , '4' => _('admin::monitor: module report') - , '5' => _('admin::monitor: module thesaurus') - , '6' => _('admin::monitor: module comparateur') - , '7' => _('admin::monitor: module validation') - , '8' => _('admin::monitor: module upload') - ); - - - $row["app"] = unserialize($row["app"]); - - $out.= ""; - foreach ($row["app"] as $app) { - if (isset($appLaunched[$app])) - $appLaunched[$app] ++; - if ($app == '0') - continue; - $out .= ( isset($appRef[$app]) ? $appRef[$app] : $appRef[0]) . '
          '; - } - $out .= "\n"; - - $out.=sprintf("" . $row["ip"] . '
          ' . $row["ip_infos"] . "\n"); - $out.=sprintf("" . phraseadate::getDate($row['created_on']) . "\n"); - $out.=sprintf("" . phraseadate::getPrettyString($row['lastaccess']) . "\n"); - - $out.="\n"; - $n ++; -} -$out.="\n"; - - -echo "
          "; - -echo ""; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; -echo " "; -echo ""; - -echo ""; -echo " "; -echo " "; -echo ""; - -if ($appLaunched[0] > 0) { - echo ""; - echo ""; - echo ""; -} - -echo "
          " . _('admin::monitor: module production') . "" . $appLaunched[1] . "
          " . _('admin::monitor: module client') . "" . $appLaunched[2] . "
          " . _('admin::monitor: module admin') . "" . $appLaunched[3] . "
          " . _('admin::monitor: module report') . "" . $appLaunched[4] . "
          " . _('admin::monitor: module thesaurus') . "" . $appLaunched[5] . "
          " . _('admin::monitor: module comparateur') . "" . $appLaunched[6] . "
          " . _('admin::monitor: module validation') . "" . $appLaunched[7] . "
          " . _('admin::monitor: total des utilisateurs uniques : '); - echo " " . $appLaunched[0] . "
          "; -echo "
          "; - -echo "
          "; -echo $out; diff --git a/www/skins/admin/css/Tables.css b/www/skins/admin/css/Tables.css index 574500c0b8..3f74b385b5 100644 --- a/www/skins/admin/css/Tables.css +++ b/www/skins/admin/css/Tables.css @@ -28,7 +28,7 @@ table.whoisTable td.colTitle { width: 120px; text-align: left; } -table.whoisTable td.noborder { +table.whoisTable td.colValue { width: 60px; text-align: right; } @@ -102,3 +102,31 @@ td.users_col.options { color: #afafaf; cursor: pointer; } +/******* TOOLTIP CONNECTED USERS **********************************************/ +#tooltip-usr { + position: relative; + top: 0; + left: 0; + color: #333333; +} +#tooltip-usr #tabledescexp { + table-layout: fixed; + width: 300px; +} +#tooltip-usr #tabledescexp td { + border: none; + text-align: left; +} +#tooltip-usr #tabledescexp td strong { + font-weight: bold; +} +#tooltip-usr #tabledescexp td.tooltip-title { + background-color: #f0ad30; + border: 1px solid #dd9510; + margin: 10px auto; + font-weight: bold; + font-size: 14px; + text-align: center; + text-decoration: none; + color: #ffffff; +} diff --git a/www/skins/admin/less/Tables.less b/www/skins/admin/less/Tables.less index 7239cdf5ef..73f0d76c73 100644 --- a/www/skins/admin/less/Tables.less +++ b/www/skins/admin/less/Tables.less @@ -64,7 +64,7 @@ table.whoisTable { width: 120px; text-align: left; } - &.noborder { + &.colValue { width: 60px; text-align: right; } @@ -155,3 +155,29 @@ td.users_col { } } +/******* TOOLTIP CONNECTED USERS **********************************************/ + +#tooltip-usr { + position: relative; + top: 0; + left: 0; + .color; + #tabledescexp { + table-layout: fixed; + width: 300px; + td { + border: none; + text-align: left; + strong { + font-weight: bold; + } + &.tooltip-title { + .bg(@orange); + border: 1px solid (darken(@orange, 10%)); + .titleTable(10px, auto, 14px, center, none); + .color(@white); + } + } + } +} + diff --git a/www/skins/admin/test.php b/www/skins/admin/test.php new file mode 100644 index 0000000000..2e28579eca --- /dev/null +++ b/www/skins/admin/test.php @@ -0,0 +1,4 @@ +Öyé öyé Ysoline, bravo avec les éléphants\n'); From aeb8a3d5aace25c7d2818dc599ca2baea99e3fcc Mon Sep 17 00:00:00 2001 From: Ysolyne Gresille Date: Thu, 28 Jun 2012 17:51:21 +0200 Subject: [PATCH 08/17] test file deleted --- www/skins/admin/test.php | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 www/skins/admin/test.php diff --git a/www/skins/admin/test.php b/www/skins/admin/test.php deleted file mode 100644 index 2e28579eca..0000000000 --- a/www/skins/admin/test.php +++ /dev/null @@ -1,4 +0,0 @@ -Öyé öyé Ysoline, bravo avec les éléphants\n'); From 9b406b7f9f2a65806d8db0344943f91dc05d3eea Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 2 Jul 2012 13:11:11 +0200 Subject: [PATCH 09/17] Move frame load to ajax load --- lib/classes/setup.class.php | 14 ------ templates/web/admin/index.html.twig | 31 ++++++++++++- .../web/admin/publications/fiche.html.twig | 8 ++-- templates/web/admin/publications/list.html | 4 +- templates/web/admin/tree.html.twig | 8 ++-- www/admin/database.php | 20 +-------- www/admin/databases.php | 11 ----- www/admin/global_values.php | 42 ++++++------------ www/admin/sitestruct.php | 43 ++++++------------- 9 files changed, 68 insertions(+), 113 deletions(-) diff --git a/lib/classes/setup.class.php b/lib/classes/setup.class.php index b7d905cccf..f755165ad3 100644 --- a/lib/classes/setup.class.php +++ b/lib/classes/setup.class.php @@ -481,20 +481,6 @@ class setup return $php_constraints; } - function check_mail_form() - { - echo '

          ' . _('setup::Tests d\'envois d\'emails') . '

          '; - ?> -
          - - -
          - - + + @@ -89,6 +91,32 @@ $.each($('#tree a[target=right]'),function(){ var dest = $(this).attr('href'); + function enableForms(forms) { + forms.bind('submit', function(){ + + var method = $(this).attr('method'); + var url = $(this).attr('action'); + var datas = $(this).serializeArray(); + + if(!method) { + method = 'GET'; + } + $('#right-ajax').empty().addClass('loading'); + if(url) { + $.ajax({ + type: method, + url: url, + data: datas, + success: function(datas){ + $('#right-ajax').removeClass('loading').html(datas); + enableForms($('#right-ajax form:not(.no-ajax)')); + return; + } + }); + } + }); + } + $(this).bind('click',function(){ if($(this).hasClass('ajax')) { @@ -96,6 +124,7 @@ $('#right').hide(); $.get(dest, function(data) { $('#right-ajax').removeClass('loading').html(data); + enableForms($('#right-ajax form:not(.no-ajax)')); }); } else @@ -155,7 +184,7 @@ return; } - }) + }); } diff --git a/templates/web/admin/publications/fiche.html.twig b/templates/web/admin/publications/fiche.html.twig index 06b404c24d..319cb71495 100644 --- a/templates/web/admin/publications/fiche.html.twig +++ b/templates/web/admin/publications/fiche.html.twig @@ -79,7 +79,7 @@ }); -
          +
          @@ -148,7 +148,7 @@ {% if publisher.is_owner() == true %} X {% else %} - + @@ -159,7 +159,7 @@
          -
          +
          @@ -215,4 +215,4 @@ {% endif %}
          -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/web/admin/publications/list.html b/templates/web/admin/publications/list.html index 774f44391c..4372b99539 100644 --- a/templates/web/admin/publications/list.html +++ b/templates/web/admin/publications/list.html @@ -2,7 +2,7 @@ {% block content %} - +

          {% trans 'Ajouter une publication' %}

          @@ -82,7 +82,7 @@ {% if feed.is_owner(user) %} - + {% endif %} diff --git a/templates/web/admin/tree.html.twig b/templates/web/admin/tree.html.twig index 65e076b44a..f6f28dd61d 100644 --- a/templates/web/admin/tree.html.twig +++ b/templates/web/admin/tree.html.twig @@ -4,7 +4,7 @@ {% if user.is_admin() %}
        • - + {% trans 'Tableau de bord' %} @@ -17,7 +17,7 @@ {% if user.is_admin() %}
        • - + Setup @@ -73,7 +73,7 @@
        • - + {{ databox.get_viewname() }} diff --git a/www/admin/database.php b/www/admin/database.php index fac724f0a0..21b189a271 100644 --- a/www/admin/database.php +++ b/www/admin/database.php @@ -92,17 +92,11 @@ if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) { } } ?> - - - - - - - - has_post_datas() && $user_obj->is_admin() === true) { $parm = $request->get_parms('upgrade'); @@ -400,6 +392,3 @@ if ($createBase || $mountBase) {
          - - diff --git a/www/admin/global_values.php b/www/admin/global_values.php index 06362a9f5b..87d2039757 100644 --- a/www/admin/global_values.php +++ b/www/admin/global_values.php @@ -62,69 +62,57 @@ function getFormTimezone($props = array(), $selected = false) } phrasea::start($Core); ?> - - - - - - - - -
          Adresse : @@ -143,7 +131,7 @@ $rules = array(); -echo '
          '; +echo ''; foreach ($GV as $section) { echo '
          '; @@ -237,7 +225,7 @@ foreach ($GV as $section) { $JS = '$(document).ready(function() { // validate signup form on keyup and submit - $("#form").validate({ + $("#GV_form").validate({ rules: ' . p4string::jsonencode($rules) . ', messages: ' . p4string::jsonencode($messages) . ', errorPlacement: function(error, element) { @@ -252,6 +240,4 @@ $JS = '$(document).ready(function() { - - diff --git a/www/admin/sitestruct.php b/www/admin/sitestruct.php index ea6157e1c7..8552339972 100644 --- a/www/admin/sitestruct.php +++ b/www/admin/sitestruct.php @@ -40,29 +40,7 @@ if ($parm['flush_cache']) { $cache_flushed = true; } ?> - - - - - -
          - Adresse : -
          -
          - Installation : -
          -
          - Maintenance : get('GV_maintenance') == true ? "checked='checked'" : ''; ?>/> -
          -
          - Debug : get('GV_debug') == true ? "checked='checked'" : ''; ?>/> -
          + +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + get('GV_maintenance') == true ? "checked='checked'" : ''; ?>/> +
          +
          +
          + +
          + get('GV_debug') == true ? "checked='checked'" : ''; ?>/> +
          +
          + '; +echo '
          '; foreach ($GV as $section) { - echo '
          '; + echo '
          '; echo '

          ' . $section['section'] . '

          '; - echo '
            '; foreach ($section['vars'] as $value) { $readonly = false; if (isset($value['readonly']) && $value['readonly'] === true) @@ -154,8 +154,8 @@ foreach ($GV as $section) { case 'boolean': $input = ' - - + + '; break; case 'string': @@ -177,9 +177,9 @@ foreach ($GV as $section) { case 'enum_multi': if (isset($value['available']) && is_array($value['available'])) { foreach ($value['available'] as $k => $v) - $input .= '
            '; + $input .= ''; } else { - echo '

            erreur avec la valeur ' . $value['name'] . '

            '; + echo '

            erreur avec la valeur ' . $value['name'] . '

            '; } break; case 'list': @@ -203,18 +203,16 @@ foreach ($GV as $section) { } $isnew = $registry->is_set($value['name']); - echo '
          • -
            ' . $input . '
            -
            ' . ($isnew === false ? 'NEW' : '') . '
            -
          • '; + echo '
            +
            ' . $input . '
            + +
            '; if (isset($value['required'])) { $rules[$value['name']] = array('required' => $value['required']); $messages[$value['name']] = array('required' => 'Ce champ est requis !'); } } - echo '
          '; - if (isset($section['javascript'])) { echo "
          "; } @@ -235,7 +233,7 @@ $JS = '$(document).ready(function() { }); '; ?> - + - -
          -

          -get_serialized_server_info(); ?> -

          -
          -
          - ID : -
          - -
          - : - ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) { +
          +

          get_serialized_server_info(); ?>

          +

          ID :

          +

          + : + ACL()->has_right_on_sbas($sbas_id, "bas_manage")) { + ?> + + - +

          @@ -359,30 +340,29 @@ $out = ""; get_record_amount(); - - // stats sur la base distante - $out .= "
          "; - $out .= _('admin::base: nombre d\'enregistrements sur la base :') . ' '; + $out .= "

          "; + // stats sur la base distante + $out .= _('admin::base: nombre d\'enregistrements sur la base :') . ' ' . ' '; if ((int) $parm["sta"] < 1) { $out .= " (" . _('phraseanet:: details') . ")"; } else { $unique_keywords = $databox->get_unique_keywords(); - $out .= ",   "; - $out .= _('admin::base: nombre de mots uniques sur la base : ') . ' ' . $unique_keywords; + $out .= ",  "; + $out .= _('admin::base: nombre de mots uniques sur la base : ') . ' ' . $unique_keywords; $indexes = $databox->get_index_amount(); - $out .= ",   "; - $out .= _('admin::base: nombre de mots indexes sur la base') . ' ' . $indexes; + $out .= ",  "; + $out .= _('admin::base: nombre de mots indexes sur la base') . ' ' . $indexes; if ($registry->get('GV_thesaurus')) { $thits = $databox->get_thesaurus_hits(); - $out .= ",   "; - $out .= _('admin::base: nombre de termes de Thesaurus indexes :') . ' ' . $thits; - } + $out .= ",  "; + $out .= _('admin::base: nombre de termes de Thesaurus indexes :') . ' ' . $thits; + } $out .= " (" . _('admin::base: masquer les details') . ")
          \n"; @@ -473,232 +453,194 @@ $out = ""; $out .= " " . sprintf("%.2f", $mega) . " \n"; $out .= " " . sprintf("%.2f", $giga) . " \n"; $out .= "\n"; - $out .= "


          \n"; - } - $out .= "\n"; - $out .= "" . _('report:: total') . "\n"; - $out .= " " . $totobj . " \n"; - if (extension_loaded("bcmath")) - $mega = bcdiv($totsiz, 1024 * 1024, 5); - else - $mega = $totsiz / (1024 * 1024); - if (extension_loaded("bcmath")) - $giga = bcdiv($totsiz, 1024 * 1024 * 1024, 5); - else - $giga = $totsiz / (1024 * 1024 * 1024); - $out .= " " . sprintf("%.2f", $mega) . " \n"; - $out .= " " . sprintf("%.2f", $giga) . " \n"; - $out .= "\n"; - $out .= ""; - } - $out .= "
          "; + $out .= ""; + $out .= "

          "; + } print($out); ?> -
          -
          -
          -
          - : - -
          -
          -
          -
          -
          +
          +
          +

          + : + +

          +
          +
          -
          -
          - : - -
          -
          -
          -
          -
          +
          +

          + : + +

          +
          +
          -ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) { - ?> -
          - - - -
          - -
          - - - -
          + ACL()->has_right_on_sbas($sbas_id, "bas_manage")) { + ?> +
          + +
          - - - get_mountable_colls(); - - if (count($mountable_colls) > 0) { - ?> -
          +

          +
          +

          + "> + + + +

          + get_mountable_colls(); + if (count($mountable_colls) > 0) { + ?> +

          - - + + -

          +

          - get_activable_colls(); - - if (count($activable_colls) > 0) { - ?> -
          + $activable_colls = $databox->get_activable_colls(); + if (count($activable_colls) > 0) { + ?> +

          - - + + -

          +

          - -
          + +

          - - + + -

          -
          +

          +

          - - + + -

          -
          +

          +

          - - + + -

          -
          +

          +

          - - + + -

          - +

          + + +
          -
          -
          - -
          - - - -