A first stab at the ‘validatebutton’ plugin
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 14 Dec 2013 09:39:44 +0000 (10:39 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 14 Dec 2013 09:39:44 +0000 (10:39 +0100)
commit69482802ee8c2bef1323ba7b95ba5e629d11fa91
tree127323cf239d4175912881c47653230e7937b7c3
parent3e7d6bec45272c88745574bbef3d7c750931c515
A first stab at the ‘validatebutton’ plugin
This is not yet integrated in the sliceview and others, but works in a standalone test view like this
http://localhost:8080/trash/simplevalidatebutton/ple.inria.thierry_parmentelat

in a nutshell, we have topmenu display a disabled link ‘validation’ and send a query in background
if anything gets returned by this query - meaning the user is PI at some authority - we then
re-enable the menu button

There is one catch at this point, which is that the DOM element attached to the plugin - the menu button - needs to
have the ‘plugin’ class because this is what is used to trigger query events
So in this version we add this plugin class to the topmenu buttons, which is awkward

The reason why this plugin is special is, it does not come with its own DOM element but piggybacks on an existing one - which had no reason to have this plugin class attached
The plan to get this right is to have the plugin.js code manage an extra class (for example named pubsub) independantly from the DOM building code and conventions
manifold/static/js/manifold.js
myslice/settings.py
plugins/validatebutton/__init__.py [new file with mode: 0644]
plugins/validatebutton/static/js/validatebutton.js [new file with mode: 0644]
trash/simplevalidatebutton.py [new file with mode: 0644]
trash/urls.py
ui/templates/widget-topmenu.html
ui/topmenu.py
unfold/page.py