Added target link attribute to menus
authorThierry Florac <thierry.florac@onf.fr>
Tue, 14 Oct 2014 14:30:54 +0200
changeset 80 8313880ee18d
parent 79 d24a725379b8
child 81 a67eb3f6b789
Added target link attribute to menus
src/ztfy/myams/viewlet/shortcuts/__init__.py
src/ztfy/myams/viewlet/shortcuts/interfaces.py
src/ztfy/myams/viewlet/shortcuts/shortcut.pt
--- a/src/ztfy/myams/viewlet/shortcuts/__init__.py	Tue Sep 30 16:18:00 2014 +0200
+++ b/src/ztfy/myams/viewlet/shortcuts/__init__.py	Tue Oct 14 14:30:54 2014 +0200
@@ -35,6 +35,7 @@
     bg_color_class = FieldProperty(IShortcutViewlet['bg_color_class'])
     icon_class = FieldProperty(IShortcutViewlet['icon_class'])
     href = FieldProperty(IShortcutViewlet['href'])
+    target = FieldProperty(IShortcutViewlet['target'])
     modal_target = FieldProperty(IShortcutViewlet['modal_target'])
     checked = FieldProperty(IShortcutViewlet['checked'])
 
@@ -49,5 +50,6 @@
     icon_class = 'fa-gears'
     label = _("Management interface")
     href = '@@properties.html'
+    target = '_blank'
     modal_target = False
     checked = False
--- a/src/ztfy/myams/viewlet/shortcuts/interfaces.py	Tue Sep 30 16:18:00 2014 +0200
+++ b/src/ztfy/myams/viewlet/shortcuts/interfaces.py	Tue Oct 14 14:30:54 2014 +0200
@@ -35,6 +35,9 @@
 
     href = TextLine(title=_("Shortcut target URL"))
 
+    target = TextLine(title=_("Window target"),
+                      required=False)
+
     modal_target = Bool(title=_("Modal target"),
                         required=True,
                         default=True)
--- a/src/ztfy/myams/viewlet/shortcuts/shortcut.pt	Tue Sep 30 16:18:00 2014 +0200
+++ b/src/ztfy/myams/viewlet/shortcuts/shortcut.pt	Tue Oct 14 14:30:54 2014 +0200
@@ -1,5 +1,6 @@
 <a i18n:domain="ztfy.myams"
 	tal:attributes="href view/getURL;
+					target view/target;
 					class string:ams-metro-tile big-cubes ${view/checked} ${view/bg_color_class};
 					data-toggle python:'modal' if view.modal_target else ''">
 	<span class="iconbox">