From: Florent Bruneau Date: Sun, 14 Mar 2010 20:49:05 +0000 (+0100) Subject: Cleanup search page. X-Git-Tag: xorg/1.0.0~332^2~71 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=85b457170f1e742390e0f6f76c6e36331a7c7419;p=platal.git Cleanup search page. Don't display the 'Trombi promo' box anymore. It created a gap between the search box and its documentation. Signed-off-by: Florent Bruneau --- diff --git a/htdocs/css/keynote.css b/htdocs/css/keynote.css index 685cea6..7372142 100644 --- a/htdocs/css/keynote.css +++ b/htdocs/css/keynote.css @@ -62,8 +62,9 @@ legend { border-left: 1px solid #fff; background: url('../images/skins/keynote_bg_verylighter.png') #bbbbaa top left repeat-x fixed; color: #000; + font-weight: bold; - padding: 2px 4px; + padding: 2px 8px 2px 4px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; } diff --git a/modules/search.php b/modules/search.php index a0057ef..7b4b302 100644 --- a/modules/search.php +++ b/modules/search.php @@ -47,15 +47,8 @@ class SearchModule extends PLModule { global $globals; - $res = XDB::query("SELECT MIN(diminutif), MAX(diminutif) - FROM groups - WHERE cat = 'Promotions'"); - list($min, $max) = $res->fetchOneRow(); - $page->assign('promo_min', $min); - $page->assign('promo_max', $max); - if (Env::has('quick') || $action == 'geoloc') { - $quick = trim(Env::v('quick')); + $quick = trim(Env::t('quick')); if (S::logged() && !Env::has('page')) { S::logger()->log('search', 'quick=' . $quick); } @@ -91,6 +84,17 @@ class SearchModule extends PLModule $url .= 'action=search&q=' . urlencode(substr($quick, 4)); $url .= '&group=' . urlencode('-Equipe,-Main,-PmWiki,-Site,-Review'); pl_redirect($url); + } elseif (strpos($quick, 'trombi:') === 0) { + $promo = substr($quick, 7); + $res = XDB::query("SELECT diminutif + FROM groups + WHERE cat = 'Promotions' AND diminutif = {?}", + $promo); + if ($res->numRows() == 0) { + $page->trigWarning("La promotion demandée n'est pas valide: $promo"); + } else { + http_redirect('http://www.polytechnique.net/login/' . $promo . '/annuaire/trombi'); + } } $page->assign('formulaire', 0); diff --git a/templates/search/quick.form.tpl b/templates/search/quick.form.tpl index 7eff7bc..228ba81 100644 --- a/templates/search/quick.form.tpl +++ b/templates/search/quick.form.tpl @@ -23,28 +23,34 @@

Recherche dans l'annuaire

- - {if $smarty.session.auth ge AUTH_COOKIE} - - - - - - - - - - {else} + {if $smarty.session.auth ge AUTH_COOKIE} +
+ {icon name=magnifier} Recherche simple + +
- Recherche simple -
-
-
- -
-
-
-
-
+ + + + + + + +
+
+
+ +
+
+
+
+
+
+ + + {else} + - {/if}

@@ -52,21 +58,17 @@
+ {/if}
-{if $smarty.session.auth ge AUTH_COOKIE} -

[Effectuer une recherche avancée]

-{/if} {if $show_js} {literal} {/literal} {/if} diff --git a/templates/search/quick.tpl b/templates/search/quick.tpl index 1e5e1c4..cc3de24 100644 --- a/templates/search/quick.tpl +++ b/templates/search/quick.tpl @@ -22,42 +22,6 @@ {include file=search/quick.form.tpl show_js=1} -{if hasPerm('user')} -

Voir le trombi d'une promotion

- -

- - - -
- - - - - -
Promotion : - - -
-
- -{/if} -

Comment faire une recherche ?

Nom, Prénom, Promotion…

@@ -98,6 +62,7 @@ notre base de données.