Pārlūkot izejas kodu

disable login modals

Olivier Massot 5 gadi atpakaļ
vecāks
revīzija
e3b89240aa

+ 1 - 34
ot_templating/Resources/Private/Partials/Classic/UserToolbar.html

@@ -31,43 +31,10 @@
         </f:then>
         <f:else>
 
-            <a href="#" id="login-btn">
+            <a href="https://www.opentalent.fr/login/" target="_blank" id="login-btn">
                 <i class="fas fa-power-off"></i> Se connecter
             </a>
 
-            <f:comment><!-- Popup de login --></f:comment>
-
-            <div id="login-popup" class="<f:if condition='{ot:loginFailed()}==1' then='show'></f:if>">
-                <form id="login_form" class="popup-form" action="" method="POST" enctype="multipart/form-data" >
-
-                    <f:comment><!-- Just for typo3 to indentify it as a login request --></f:comment>
-                    <input type="hidden" name="logintype" value="login" />
-
-                    <input type="text"
-                           class="form-control {f:if(then: 'is-invalid', condition: '{usernameErrors}')}"
-                           placeholder="Nom d'utilisateur"
-                           name="user"
-                           required="1" />
-
-                    <input type="password"
-                           class="form-control {f:if(then: 'is-invalid', condition: '{passwordErrors}')}"
-                           name="pass"
-                           placeholder="Mot de passe"
-                           required="1" />
-
-                    <input type="submit" id="login-button" value="Se connecter" />
-
-                    <f:if condition="{ot:loginFailed()}==1">
-                        <f:then>
-                            <div class="login-errormsg alert">
-                                La tentative de connexion a échoué...<br/>
-                                Êtes-vous sûr d'avoir bien renseigné vos identifiants?
-                            </div>
-                        </f:then>
-                    </f:if>
-                </form>
-            </div>
-
         </f:else>
     </f:security.ifAuthenticated>
 </div>

+ 73 - 0
ot_templating/Resources/Private/Partials/Classic/UserToolbar.html.future

@@ -0,0 +1,73 @@
+{namespace v=FluidTYPO3\Vhs\ViewHelpers}
+{namespace ot=Opentalent\OtTemplating\ViewHelpers}
+
+<f:comment><!-- Panneau d'authentification ou espace utilisateur --></f:comment>
+
+<div class="user-toolbar">
+    <f:security.ifAuthenticated>
+        <f:then>
+
+            <div class="dropdown">
+                <a href="#" class="user-toolbar-username">
+                    <i class="fa fa-user"></i>
+                    {user.username}
+                    <i class="fa fa-caret-down"></i>
+                </a>
+
+                <ul class="dropdown-menu">
+                    <li>
+                        <a href="{settings.opentalentDashboardUrl}" target="_blank">
+                            Espace adhérent de ma structure
+                        </a>
+                    </li>
+                    <li>
+                        <f:link.page additionalParams="{logintype:'logout'}">
+                            <f:translate key="log-out"/>
+                        </f:link.page>
+                    </li>
+                </ul>
+            </div>
+
+        </f:then>
+        <f:else>
+
+            <a href="#" id="login-btn">
+                <i class="fas fa-power-off"></i> Se connecter
+            </a>
+
+            <f:comment><!-- Popup de login --></f:comment>
+
+            <div id="login-popup" class="<f:if condition='{ot:loginFailed()}==1' then='show'></f:if>">
+                <form id="login_form" class="popup-form" action="" method="POST" enctype="multipart/form-data" >
+
+                    <f:comment><!-- Just for typo3 to indentify it as a login request --></f:comment>
+                    <input type="hidden" name="logintype" value="login" />
+
+                    <input type="text"
+                           class="form-control {f:if(then: 'is-invalid', condition: '{usernameErrors}')}"
+                           placeholder="Nom d'utilisateur"
+                           name="user"
+                           required="1" />
+
+                    <input type="password"
+                           class="form-control {f:if(then: 'is-invalid', condition: '{passwordErrors}')}"
+                           name="pass"
+                           placeholder="Mot de passe"
+                           required="1" />
+
+                    <input type="submit" id="login-button" value="Se connecter" />
+
+                    <f:if condition="{ot:loginFailed()}==1">
+                        <f:then>
+                            <div class="login-errormsg alert">
+                                La tentative de connexion a échoué...<br/>
+                                Êtes-vous sûr d'avoir bien renseigné vos identifiants?
+                            </div>
+                        </f:then>
+                    </f:if>
+                </form>
+            </div>
+
+        </f:else>
+    </f:security.ifAuthenticated>
+</div>

+ 3 - 3
ot_templating/Resources/Private/Partials/Modern/Topbar.html

@@ -60,10 +60,10 @@
                             </f:then>
                             <f:else>
                                 <li>
-                                    <a href="#"
+                                    <a href="https://www.opentalent.fr/login/"
+                                       target="_blank"
                                        class="{f:if(condition: '{ot:loginFailed()}', then: 'trigger-on-load')}"
-                                       data-toggle="modal"
-                                       data-target="#loginModal">
+                                       >
                                         Se connecter
                                     </a>
                                 </li>

+ 78 - 0
ot_templating/Resources/Private/Partials/Modern/Topbar.html.future

@@ -0,0 +1,78 @@
+{namespace ot=Opentalent\OtTemplating\ViewHelpers}
+
+<div class="topbar">
+    <div class="container-fluid">
+        <div class="row">
+            <div class="col-lg-6 col-md-6 xs-mb-10">
+                <div class="topbar-call text-center text-md-left">
+                    <ul>
+
+                        <li class="brand-free">
+                            <strong>{settings.structureName}</strong> est membre de &nbsp;
+
+                            <f:if condition="{settings.networkLogo} != ''">
+                                <a href="#"
+                                   title="{settings.networkName}"
+                                   class="reseau"
+                                   data-toggle="modal"
+                                   data-target="#cmfModal">
+                                    <img src="{settings.networkLogoUrl}"
+                                         alt="{settings.networkName}"
+                                         height="22px" />
+                                </a> &nbsp;
+                            </f:if>
+
+                            <a href="#"
+                               title="Opentalent"
+                               class="reseau-opentalent"
+                               data-toggle="modal"
+                               data-target="#opentalentModal">
+                                <f:image src="EXT:ot_templating/Resources/Public/media/opentalent_longueur_S.jpg"
+                                     alt="Opentalent"
+                                     height="18px" />
+                            </a>
+                        </li>
+
+                        <li id="notice-cmf">
+                            <strong>{settings.networkName}</strong>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+            <div class="col-lg-6 col-md-6">
+                <div class="topbar-social text-center text-md-right text-bold">
+                    <ul>
+                        <f:security.ifAuthenticated>
+                            <f:then>
+                                <li>
+                                    <span>Bienvenue <b>{user.username}</b>!</span>
+                                </li>
+                                <li>
+                                    <a href="{settings.opentalentDashboardUrl}">
+                                        Accéder à l'intranet
+                                    </a>
+                                </li>
+                                <li>
+                                    <f:link.page additionalParams="{logintype:'logout'}">
+                                        <f:translate key="log-out"/>
+                                    </f:link.page>
+                                </li>
+                            </f:then>
+                            <f:else>
+                                <li>
+                                    <a href="#"
+                                       class="{f:if(condition: '{ot:loginFailed()}', then: 'trigger-on-load')}"
+                                       data-toggle="modal"
+                                       data-target="#loginModal">
+                                        Se connecter
+                                    </a>
+                                </li>
+                            </f:else>
+                        </f:security.ifAuthenticated>
+
+                    </ul>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 8 - 8
ot_templating/Resources/Public/assets/Classic/script/main.js

@@ -115,14 +115,14 @@ $(document).ready(function(){
 
 
     // **** Login Pop-Up and Auth
-    $('#login-btn').on('click', function(e) {
-        e.preventDefault();
-        $('#login-popup .popup-form').toggleClass("show");
-    });
-
-    if ($('#login-popup').find('.alert').length) {
-        $('#login-popup .popup-form').toggleClass("show");
-    }
+    // $('#login-btn').on('click', function(e) {
+    //     e.preventDefault();
+    //     $('#login-popup .popup-form').toggleClass("show");
+    // });
+    //
+    // if ($('#login-popup').find('.alert').length) {
+    //     $('#login-popup .popup-form').toggleClass("show");
+    // }
 
     // **** Forms ****
     $('.datepicker').datepicker({