[views] Bootstrap'ify registration link, see #3295939
authorDimitri Papadopoulos <dimitri.papadopoulos@cea.fr>
Thu, 14 Nov 2013 13:23:41 +0000
changeset 437 52d16f42f072
parent 403 3a7c9a5c6545
child 438 c090cae6f5c4
[views] Bootstrap'ify registration link, see #3295939
views/components.py
views/register.py
--- a/views/components.py	Mon Oct 28 09:28:36 2013 +0000
+++ b/views/components.py	Thu Nov 14 13:23:41 2013 +0000
@@ -253,6 +253,3 @@
     from cubicweb.web.views.basecomponents import ApplLogo, AnonUserStatusLink
     vreg.unregister(ApplLogo)
     vreg.unregister(AnonUserStatusLink)
-    # Unregister register component in the right corner
-    from cubes.registration.views import RegisterLink
-    vreg.unregister(RegisterLink)
--- a/views/register.py	Mon Oct 28 09:28:36 2013 +0000
+++ b/views/register.py	Thu Nov 14 13:23:41 2013 +0000
@@ -28,7 +28,18 @@
 from cubes.registration.views import (RegistrationFormView,
                                       RegistrationForm,
                                       RegistrationSendMailController,
-                                      RegistrationConfirmController, qname)
+                                      RegistrationConfirmController,
+                                      RegisterLink, qname)
+
+
+###############################################################################
+### REGISTRATION LINK #########################################################
+###############################################################################
+class BrainomicsRegisterLink(RegisterLink):
+
+    def render(self, w):
+        w(u'<a class="btn btn-info" href="%s">%s</a>' % (
+            self._cw.build_url('register'), self._cw._('i18n_register_user')))
 
 
 ###############################################################################
@@ -140,3 +151,4 @@
     vreg.register_and_replace(BrainomicsRegistrationConfirmController,
                               RegistrationConfirmController)
     vreg.register_and_replace(BrainomicsRegistrationFormView, RegistrationFormView)
+    vreg.register_and_replace(BrainomicsRegisterLink, RegisterLink)