Commit 72e22f28 authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor code to add action to back to login page

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44235 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a2b1e42a
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
<tr><td>Password:</td><td><input type="password" name="password"/></td></tr>\n <tr><td>Password:</td><td><input type="password" name="password"/></td></tr>\n
<tr><td>Confirm Password:</td><td><input type="password" name="confirm"/></td></tr>\n <tr><td>Confirm Password:</td><td><input type="password" name="confirm"/></td></tr>\n
<td align="center" colspan="2"><input type="submit" name="logged_in:method" class="submit" value="Create Account"></td>\n <td align="center" colspan="2"><input type="submit" name="logged_in:method" class="submit" value="Create Account"></td>\n
<tr><td id="back-login" align="left" colspan="2"><< Back</td></tr>\n
</table>\n </table>\n
</form>\n </form>\n
</td>\n </td>\n
......
...@@ -1094,6 +1094,13 @@ div.footer {\n ...@@ -1094,6 +1094,13 @@ div.footer {\n
\n \n
div.header-left h2 {\n div.header-left h2 {\n
font-size: 14pt;\n font-size: 14pt;\n
}\n
\n
form#create-user table tbody tr:last-child td {\n
color: #20C;\n
text-decoration: underline;\n
font-size: 8pt;\n
cursor: pointer;\n
} }
]]></string> </value> ]]></string> </value>
......
...@@ -134,7 +134,8 @@ function displayFormMessage(message){\n ...@@ -134,7 +134,8 @@ function displayFormMessage(message){\n
\n \n
function displayLoginForm(){\n function displayLoginForm(){\n
var tagToHide = "a.ung_docs, img[alt=\'calendar_logo_box\']," + \n var tagToHide = "a.ung_docs, img[alt=\'calendar_logo_box\']," + \n
"table#create-new-user, img[alt=\'mail_logo_box\']";\n "table#create-new-user, img[alt=\'mail_logo_box\']" + \n
", div.navigation";\n
$(tagToHide).hide();\n $(tagToHide).hide();\n
$("div.header-left div.field input, div.main-right, div.main-left").hide();\n $("div.header-left div.field input, div.main-right, div.main-left").hide();\n
$.get("WebSection_loginDialog", function(data){\n $.get("WebSection_loginDialog", function(data){\n
...@@ -146,6 +147,9 @@ function displayLoginForm(){\n ...@@ -146,6 +147,9 @@ function displayLoginForm(){\n
});\n });\n
$("table#field_table, table#new-account-table, table#create-new-user").css("width", "100%");\n $("table#field_table, table#new-account-table, table#create-new-user").css("width", "100%");\n
$("table#create-new-user").show();\n $("table#create-new-user").show();\n
$("td#back-login").click(function(event){\n
reloadLoginPage(event);\n
});\n
$("form#create-user").submit(function(event){\n $("form#create-user").submit(function(event){\n
event.preventDefault();\n event.preventDefault();\n
var formHash = {};\n var formHash = {};\n
...@@ -172,6 +176,18 @@ function displayLoginForm(){\n ...@@ -172,6 +176,18 @@ function displayLoginForm(){\n
});\n });\n
}\n }\n
\n \n
function reloadLoginPage(event){\n
event.preventDefault();\n
if ($("div#main-content").html() == null){\n
displayLoginForm();\n
}\n
if ($("table#create-new-user").css("display") != "none"){\n
$("table#field_table, table#new-account-table, table#create-new-user").css("width", "78%");\n
$("table#create-new-user").hide();\n
$("table#field_table, table#new-account-table").show();\n
}\n
}\n
\n
$().ready(function(){\n $().ready(function(){\n
$("p.clear").remove();\n $("p.clear").remove();\n
if ($("a#login").html() != null){\n if ($("a#login").html() != null){\n
...@@ -470,15 +486,7 @@ $().ready(function(){\n ...@@ -470,15 +486,7 @@ $().ready(function(){\n
showNotImplementedMessage("a#right_message");\n showNotImplementedMessage("a#right_message");\n
});\n });\n
$("a#login").click(function(event){\n $("a#login").click(function(event){\n
event.preventDefault();\n reloadLoginPage(event);\n
if ($("div#main-content").html() == null){\n
displayLoginForm();\n
}\n
if ($("table#create-new-user").css("display") != "none"){\n
$("table#field_table, table#new-account-table, table#create-new-user").css("width", "78%");\n
$("table#create-new-user").hide();\n
$("table#field_table, table#new-account-table").show();\n
}\n
});\n });\n
$("input.listbox-check-all").click(function(event){\n $("input.listbox-check-all").click(function(event){\n
event.preventDefault();\n event.preventDefault();\n
......
296 297
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment