[views/tables|css] show actions in small tabs instead of menu indirection (closes #2004109)
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 13 Jun 2012 12:38:06 +0200
changeset 8464 895e34d9ae0d
parent 8459 1931953226f2
child 8469 82272decfa99
[views/tables|css] show actions in small tabs instead of menu indirection (closes #2004109)
i18n/de.po
i18n/en.po
i18n/es.po
i18n/fr.po
web/data/cubicweb.css
web/data/cubicweb.old.css
web/views/tableview.py
--- a/i18n/de.po	Mon Jul 09 13:57:23 2012 +0200
+++ b/i18n/de.po	Wed Jun 13 12:38:06 2012 +0200
@@ -222,9 +222,6 @@
 msgid "About this site"
 msgstr "Über diese Seite"
 
-msgid "Action"
-msgstr ""
-
 #, python-format
 msgid "Added relation : %(entity_from)s %(rtype)s %(entity_to)s"
 msgstr ""
@@ -274,6 +271,10 @@
 msgid "Browse by entity type"
 msgstr "nach Identitätstyp navigieren"
 
+#, python-format
+msgid "By %(user)s on %(dt)s [%(undo_link)s]"
+msgstr ""
+
 msgid "Bytes"
 msgstr "Bytes"
 
@@ -774,9 +775,6 @@
 msgid "TZTime_plural"
 msgstr ""
 
-msgid "Target"
-msgstr ""
-
 #, python-format
 msgid "The view %s can not be applied to this query"
 msgstr "Die Ansicht %s ist auf diese Anfrage nicht anwendbar."
@@ -909,10 +907,6 @@
 msgid "Used by:"
 msgstr "benutzt von:"
 
-#, python-format
-msgid "User %(user_eid)s on %(dt)s [%(undo_link)s] \n"
-msgstr ""
-
 msgid "Users and groups management"
 msgstr ""
 
@@ -1007,9 +1001,6 @@
 msgid "abstract base class for transitions"
 msgstr "abstrakte Basisklasse für Übergänge"
 
-msgid "action menu"
-msgstr ""
-
 msgid "action(s) on this selection"
 msgstr "Aktionen(en) bei dieser Auswahl"
 
@@ -2069,9 +2060,6 @@
 msgid "date"
 msgstr "Datum"
 
-msgid "day"
-msgstr ""
-
 msgid "deactivate"
 msgstr "deaktivieren"
 
@@ -2084,9 +2072,6 @@
 msgid "default"
 msgstr "Standardwert"
 
-msgid "default /base view for (transaction) actions "
-msgstr ""
-
 msgid "default text format for rich text fields."
 msgstr "Standardformat für Textfelder"
 
@@ -2729,6 +2714,9 @@
 msgid "has_text"
 msgstr "enthält Text"
 
+msgid "header-center"
+msgstr ""
+
 msgid "header-left"
 msgstr ""
 
@@ -3088,9 +3076,6 @@
 msgid "log in"
 msgstr "anmelden"
 
-msgid "log out first"
-msgstr "Melden Sie sich zuerst ab."
-
 msgid "login"
 msgstr "Anmeldung"
 
@@ -3193,9 +3178,6 @@
 msgid "monday"
 msgstr "Montag"
 
-msgid "month"
-msgstr ""
-
 msgid "more actions"
 msgstr "weitere Aktionen"
 
@@ -4085,6 +4067,10 @@
 msgid "there is no previous page"
 msgstr ""
 
+#, python-format
+msgid "there is no transaction #%s"
+msgstr ""
+
 msgid "this action is not reversible!"
 msgstr "Achtung! Diese Aktion ist unumkehrbar."
 
@@ -4168,15 +4154,15 @@
 msgid "to_state_object"
 msgstr "Übergang zu diesem Zustand"
 
-msgid "today"
-msgstr ""
-
 msgid "todo_by"
 msgstr "zu erledigen bis"
 
 msgid "toggle check boxes"
 msgstr "Kontrollkästchen umkehren"
 
+msgid "toggle filter"
+msgstr "filter verbergen/zeigen"
+
 msgid "tr_count"
 msgstr ""
 
@@ -4295,12 +4281,12 @@
 msgid "unauthorized value"
 msgstr "ungültiger Wert"
 
+msgid "undefined user"
+msgstr ""
+
 msgid "undo"
 msgstr "rückgängig machen"
 
-msgid "undo last change"
-msgstr ""
-
 msgid "unique identifier used to connect to the application"
 msgstr "eindeutiger Bezeichner zur Verbindung mit der Anwendung"
 
@@ -4537,9 +4523,6 @@
 msgid "wednesday"
 msgstr "Mittwoch"
 
-msgid "week"
-msgstr "Woche"
-
 #, python-format
 msgid "welcome %s !"
 msgstr "Willkommen %s !"
@@ -4635,10 +4618,3 @@
 #, python-format
 msgid "you should un-inline relation %s which is supported and may be crossed "
 msgstr ""
-
-#~ msgid ""
-#~ "Can't restore relation %(rtype)s of entity %(eid)s, this relation does "
-#~ "not exists anymore in the schema."
-#~ msgstr ""
-#~ "Kann die Relation %(rtype)s der Entität %(eid)s nicht wieder herstellen, "
-#~ "diese Relation existiert nicht mehr in dem Schema."
--- a/i18n/en.po	Mon Jul 09 13:57:23 2012 +0200
+++ b/i18n/en.po	Wed Jun 13 12:38:06 2012 +0200
@@ -211,9 +211,6 @@
 msgid "About this site"
 msgstr ""
 
-msgid "Action"
-msgstr ""
-
 #, python-format
 msgid "Added relation : %(entity_from)s %(rtype)s %(entity_to)s"
 msgstr ""
@@ -263,6 +260,10 @@
 msgid "Browse by entity type"
 msgstr ""
 
+#, python-format
+msgid "By %(user)s on %(dt)s [%(undo_link)s]"
+msgstr ""
+
 msgid "Bytes"
 msgstr "Bytes"
 
@@ -750,9 +751,6 @@
 msgid "TZTime_plural"
 msgstr "International times"
 
-msgid "Target"
-msgstr ""
-
 #, python-format
 msgid "The view %s can not be applied to this query"
 msgstr ""
@@ -885,10 +883,6 @@
 msgid "Used by:"
 msgstr ""
 
-#, python-format
-msgid "User %(user_eid)s on %(dt)s [%(undo_link)s] \n"
-msgstr ""
-
 msgid "Users and groups management"
 msgstr ""
 
@@ -969,9 +963,6 @@
 msgid "abstract base class for transitions"
 msgstr ""
 
-msgid "action menu"
-msgstr ""
-
 msgid "action(s) on this selection"
 msgstr ""
 
@@ -2026,9 +2017,6 @@
 msgid "date"
 msgstr ""
 
-msgid "day"
-msgstr ""
-
 msgid "deactivate"
 msgstr ""
 
@@ -2041,9 +2029,6 @@
 msgid "default"
 msgstr ""
 
-msgid "default /base view for (transaction) actions "
-msgstr ""
-
 msgid "default text format for rich text fields."
 msgstr ""
 
@@ -2669,6 +2654,9 @@
 msgid "has_text"
 msgstr "has text"
 
+msgid "header-center"
+msgstr ""
+
 msgid "header-left"
 msgstr "header (left)"
 
@@ -3007,9 +2995,6 @@
 msgid "log in"
 msgstr ""
 
-msgid "log out first"
-msgstr ""
-
 msgid "login"
 msgstr ""
 
@@ -3111,9 +3096,6 @@
 msgid "monday"
 msgstr ""
 
-msgid "month"
-msgstr ""
-
 msgid "more actions"
 msgstr ""
 
@@ -3985,6 +3967,10 @@
 msgid "there is no previous page"
 msgstr ""
 
+#, python-format
+msgid "there is no transaction #%s"
+msgstr ""
+
 msgid "this action is not reversible!"
 msgstr ""
 
@@ -4068,15 +4054,15 @@
 msgid "to_state_object"
 msgstr "transitions to this state"
 
-msgid "today"
-msgstr ""
-
 msgid "todo_by"
 msgstr "to do by"
 
 msgid "toggle check boxes"
 msgstr ""
 
+msgid "toggle filter"
+msgstr ""
+
 msgid "tr_count"
 msgstr "transition number"
 
@@ -4195,12 +4181,12 @@
 msgid "unauthorized value"
 msgstr ""
 
+msgid "undefined user"
+msgstr ""
+
 msgid "undo"
 msgstr ""
 
-msgid "undo last change"
-msgstr ""
-
 msgid "unique identifier used to connect to the application"
 msgstr ""
 
@@ -4426,9 +4412,6 @@
 msgid "wednesday"
 msgstr ""
 
-msgid "week"
-msgstr ""
-
 #, python-format
 msgid "welcome %s !"
 msgstr ""
--- a/i18n/es.po	Mon Jul 09 13:57:23 2012 +0200
+++ b/i18n/es.po	Wed Jun 13 12:38:06 2012 +0200
@@ -223,9 +223,6 @@
 msgid "About this site"
 msgstr "Información del Sistema"
 
-msgid "Action"
-msgstr ""
-
 #, python-format
 msgid "Added relation : %(entity_from)s %(rtype)s %(entity_to)s"
 msgstr ""
@@ -275,6 +272,10 @@
 msgid "Browse by entity type"
 msgstr "Busca por tipo de entidad"
 
+#, python-format
+msgid "By %(user)s on %(dt)s [%(undo_link)s]"
+msgstr ""
+
 msgid "Bytes"
 msgstr "Bytes"
 
@@ -775,9 +776,6 @@
 msgid "TZTime_plural"
 msgstr "Horas internacionales"
 
-msgid "Target"
-msgstr ""
-
 #, python-format
 msgid "The view %s can not be applied to this query"
 msgstr "La vista %s no puede ser aplicada a esta búsqueda"
@@ -912,10 +910,6 @@
 msgid "Used by:"
 msgstr "Utilizado por :"
 
-#, python-format
-msgid "User %(user_eid)s on %(dt)s [%(undo_link)s] \n"
-msgstr ""
-
 msgid "Users and groups management"
 msgstr "Usuarios y grupos de administradores"
 
@@ -1017,9 +1011,6 @@
 msgid "abstract base class for transitions"
 msgstr "Clase de base abstracta para la transiciones"
 
-msgid "action menu"
-msgstr ""
-
 msgid "action(s) on this selection"
 msgstr "Acción(es) en esta selección"
 
@@ -2098,9 +2089,6 @@
 msgid "date"
 msgstr "Fecha"
 
-msgid "day"
-msgstr "día"
-
 msgid "deactivate"
 msgstr "Desactivar"
 
@@ -2113,9 +2101,6 @@
 msgid "default"
 msgstr "Valor por defecto"
 
-msgid "default /base view for (transaction) actions "
-msgstr ""
-
 msgid "default text format for rich text fields."
 msgstr ""
 "Formato de texto que se utilizará por defecto para los campos de tipo texto"
@@ -2770,6 +2755,9 @@
 msgid "has_text"
 msgstr "Contiene el texto"
 
+msgid "header-center"
+msgstr ""
+
 msgid "header-left"
 msgstr "encabezado (izquierdo)"
 
@@ -3130,9 +3118,6 @@
 msgid "log in"
 msgstr "Acceder"
 
-msgid "log out first"
-msgstr "Desconéctese primero"
-
 msgid "login"
 msgstr "Usuario"
 
@@ -3234,9 +3219,6 @@
 msgid "monday"
 msgstr "Lunes"
 
-msgid "month"
-msgstr "mes"
-
 msgid "more actions"
 msgstr "Más acciones"
 
@@ -4135,6 +4117,10 @@
 msgid "there is no previous page"
 msgstr ""
 
+#, python-format
+msgid "there is no transaction #%s"
+msgstr ""
+
 msgid "this action is not reversible!"
 msgstr "Esta acción es irreversible!."
 
@@ -4218,15 +4204,15 @@
 msgid "to_state_object"
 msgstr "Transición hacia este Estado"
 
-msgid "today"
-msgstr "hoy"
-
 msgid "todo_by"
 msgstr "Asignada a"
 
 msgid "toggle check boxes"
 msgstr "Cambiar valor"
 
+msgid "toggle filter"
+msgstr "esconder/mostrar el filtro"
+
 msgid "tr_count"
 msgstr "n° de transición"
 
@@ -4345,12 +4331,12 @@
 msgid "unauthorized value"
 msgstr "Valor no permitido"
 
+msgid "undefined user"
+msgstr ""
+
 msgid "undo"
 msgstr "Anular"
 
-msgid "undo last change"
-msgstr ""
-
 msgid "unique identifier used to connect to the application"
 msgstr "Identificador único utilizado para conectarse al Sistema"
 
@@ -4585,9 +4571,6 @@
 msgid "wednesday"
 msgstr "Miércoles"
 
-msgid "week"
-msgstr "sem."
-
 #, python-format
 msgid "welcome %s !"
 msgstr "¡ Bienvenido %s  !"
@@ -4686,10 +4669,3 @@
 msgstr ""
 "usted debe  quitar la puesta en línea de la relación %s que es aceptada y "
 "puede ser cruzada"
-
-#~ msgid ""
-#~ "Can't restore relation %(rtype)s of entity %(eid)s, this relation does "
-#~ "not exists anymore in the schema."
-#~ msgstr ""
-#~ "No puede restaurar la relación %(rtype)s de la entidad %(eid)s, esta "
-#~ "relación ya no existe en el esquema."
--- a/i18n/fr.po	Mon Jul 09 13:57:23 2012 +0200
+++ b/i18n/fr.po	Wed Jun 13 12:38:06 2012 +0200
@@ -223,9 +223,6 @@
 msgid "About this site"
 msgstr "À propos de ce site"
 
-msgid "Action"
-msgstr "Action"
-
 #, python-format
 msgid "Added relation : %(entity_from)s %(rtype)s %(entity_to)s"
 msgstr "Relation ajoutée : %(entity_from)s %(rtype)s %(entity_to)s"
@@ -275,6 +272,10 @@
 msgid "Browse by entity type"
 msgstr "Naviguer par type d'entité"
 
+#, python-format
+msgid "By %(user)s on %(dt)s [%(undo_link)s]"
+msgstr "Par %(user)s le %(dt)s [%(undo_link)s] "
+
 msgid "Bytes"
 msgstr "Donnée binaires"
 
@@ -775,9 +776,6 @@
 msgid "TZTime_plural"
 msgstr "Heures internationales"
 
-msgid "Target"
-msgstr ""
-
 #, python-format
 msgid "The view %s can not be applied to this query"
 msgstr "La vue %s ne peut être appliquée à cette requête"
@@ -912,10 +910,6 @@
 msgid "Used by:"
 msgstr "Utilisé par :"
 
-#, python-format
-msgid "By %(user)s on %(dt)s [%(undo_link)s]"
-msgstr "Par %(user)s le %(dt)s [%(undo_link)s] "
-
 msgid "Users and groups management"
 msgstr "Gestion des utilisateurs et groupes"
 
@@ -1017,9 +1011,6 @@
 msgid "abstract base class for transitions"
 msgstr "classe de base abstraite pour les transitions"
 
-msgid "action menu"
-msgstr "actions"
-
 msgid "action(s) on this selection"
 msgstr "action(s) sur cette sélection"
 
@@ -1259,7 +1250,7 @@
 msgstr "anonyme"
 
 msgid "anyrsetview"
-msgstr "vues \"tous les rset\""
+msgstr "vues pour tout rset"
 
 msgid "april"
 msgstr "avril"
@@ -2110,9 +2101,6 @@
 msgid "date"
 msgstr "date"
 
-msgid "day"
-msgstr "jour"
-
 msgid "deactivate"
 msgstr "désactiver"
 
@@ -2125,9 +2113,6 @@
 msgid "default"
 msgstr "valeur par défaut"
 
-msgid "default /base view for (transaction) actions "
-msgstr ""
-
 msgid "default text format for rich text fields."
 msgstr "format de texte par défaut pour les champs textes"
 
@@ -2779,6 +2764,9 @@
 msgid "has_text"
 msgstr "contient le texte"
 
+msgid "header-center"
+msgstr ""
+
 msgid "header-left"
 msgstr "en-tête (gauche)"
 
@@ -3137,9 +3125,6 @@
 msgid "log in"
 msgstr "s'identifier"
 
-msgid "log out first"
-msgstr "déconnecter vous d'abord"
-
 msgid "login"
 msgstr "identifiant"
 
@@ -3241,9 +3226,6 @@
 msgid "monday"
 msgstr "lundi"
 
-msgid "month"
-msgstr "mois"
-
 msgid "more actions"
 msgstr "plus d'actions"
 
@@ -4145,6 +4127,10 @@
 msgid "there is no previous page"
 msgstr "il n'y a pas de page précédente"
 
+#, python-format
+msgid "there is no transaction #%s"
+msgstr ""
+
 msgid "this action is not reversible!"
 msgstr ""
 "Attention ! Cette opération va détruire les données de façon irréversible."
@@ -4229,14 +4215,14 @@
 msgid "to_state_object"
 msgstr "transition vers cet état"
 
-msgid "today"
-msgstr "aujourd'hui"
-
 msgid "todo_by"
 msgstr "à faire par"
 
 msgid "toggle check boxes"
-msgstr "inverser les cases à cocher"
+msgstr "afficher/masquer les cases à cocher"
+
+msgid "toggle filter"
+msgstr "afficher/masquer le filtre"
 
 msgid "tr_count"
 msgstr "n° de transition"
@@ -4356,12 +4342,12 @@
 msgid "unauthorized value"
 msgstr "valeur non autorisée"
 
+msgid "undefined user"
+msgstr ""
+
 msgid "undo"
 msgstr "annuler"
 
-msgid "undo last change"
-msgstr "annuler dernier changement"
-
 msgid "unique identifier used to connect to the application"
 msgstr "identifiant unique utilisé pour se connecter à l'application"
 
@@ -4595,9 +4581,6 @@
 msgid "wednesday"
 msgstr "mercredi"
 
-msgid "week"
-msgstr "semaine"
-
 #, python-format
 msgid "welcome %s !"
 msgstr "bienvenue %s !"
--- a/web/data/cubicweb.css	Mon Jul 09 13:57:23 2012 +0200
+++ b/web/data/cubicweb.css	Wed Jun 13 12:38:06 2012 +0200
@@ -545,6 +545,16 @@
   padding-left: 2em;
 }
 
+/* actions around tables */
+.tableactions span {
+  padding: 0 18px;
+  height: 24px;
+  background: #F8F8F8;
+  border: 1px solid #DFDFDF;
+  border-bottom: none;
+  border-radius: 4px 4px 0 0;
+}
+
 /* custom boxes */
 
 .search_box div.boxBody {
--- a/web/data/cubicweb.old.css	Mon Jul 09 13:57:23 2012 +0200
+++ b/web/data/cubicweb.old.css	Wed Jun 13 12:38:06 2012 +0200
@@ -899,6 +899,16 @@
   padding-left: 0.5em;
 }
 
+/* actions around tables */
+.tableactions span {
+  padding: 0 18px;
+  height: 24px;
+  background: #F8F8F8;
+  border: 1px solid #DFDFDF;
+  border-bottom: none;
+  border-radius: 4px 4px 0 0;
+}
+
 /***************************************/
 /* error view (views/management.py)    */
 /***************************************/
--- a/web/views/tableview.py	Mon Jul 09 13:57:23 2012 +0200
+++ b/web/views/tableview.py	Wed Jun 13 12:38:06 2012 +0200
@@ -290,20 +290,17 @@
         return attrs
 
     def render_actions(self, w, actions):
-        box = MenuWidget('', '', _class='tableActionsBox', islist=False)
-        label = tags.span(self._cw._('action menu'))
-        menu = PopupBoxMenu(label, isitem=False, link_class='actionsBox',
-                            ident='%sActions' % self.view.domid)
-        box.append(menu)
+        w(u'<div class="tableactions">')
         for action in actions:
-            menu.append(action)
-        box.render(w=w)
-        w(u'<div class="clear"></div>')
+            w(u'<span>')
+            action.render(w)
+            w(u'</span>')
+        w(u'</div>')
 
     def show_hide_filter_actions(self, currentlydisplayed=False):
         divid = self.view.domid
         showhide = u';'.join(toggle_action('%s%s' % (divid, what))[11:]
-                             for what in ('Form', 'Show', 'Hide', 'Actions'))
+                             for what in ('Form', 'Actions'))
         showhide = 'javascript:' + showhide
         self._cw.add_onload(u'''\
 $(document).ready(function() {
@@ -313,10 +310,8 @@
     $('#%(id)sShow').attr('class', 'hidden');
   }
 });''' % {'id': divid})
-        showlabel = self._cw._('show filter form')
-        hidelabel = self._cw._('hide filter form')
-        return [component.Link(showhide, showlabel, id='%sShow' % divid),
-                component.Link(showhide, hidelabel, id='%sHide' % divid)]
+        showlabel = self._cw._('toggle filter')
+        return [component.Link(showhide, showlabel, id='%sToggle' % divid)]
 
 
 class AbstractColumnRenderer(object):