1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-26 10:03:37 +03:00

Feature #1431: Move sunstone login to erb template and reuse common html head

(cherry picked from commit 3547a59b5a7d750faab1e6c53ebd6a704ae2d5a5)
This commit is contained in:
Hector Sanjuan 2012-08-28 18:26:05 +02:00 committed by Ruben S. Montero
parent 31e39b128e
commit c50b28fd61
6 changed files with 60 additions and 90 deletions

View File

@ -280,7 +280,6 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/routes \
$SUNSTONE_LOCATION/public/vendor/FontAwesome/css \
$SUNSTONE_LOCATION/public/vendor/FontAwesome/font \
$SUNSTONE_LOCATION/public/images \
$SUNSTONE_LOCATION/templates \
$SUNSTONE_LOCATION/views"
OZONES_DIRS="$OZONES_LOCATION/lib \
@ -485,7 +484,6 @@ INSTALL_SUNSTONE_FILES=(
SUNSTONE_BIN_FILES:$BIN_LOCATION
SUNSTONE_MODELS_FILES:$SUNSTONE_LOCATION/models
SUNSTONE_MODELS_JSON_FILES:$SUNSTONE_LOCATION/models/OpenNebulaJSON
SUNSTONE_TEMPLATE_FILES:$SUNSTONE_LOCATION/templates
SUNSTONE_VIEWS_FILES:$SUNSTONE_LOCATION/views
SUNSTONE_PUBLIC_JS_FILES:$SUNSTONE_LOCATION/public/js
SUNSTONE_PUBLIC_JS_PLUGINS_FILES:$SUNSTONE_LOCATION/public/js/plugins
@ -1253,10 +1251,10 @@ SUNSTONE_MODELS_JSON_FILES="src/sunstone/models/OpenNebulaJSON/HostJSON.rb \
src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb \
src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb"
SUNSTONE_TEMPLATE_FILES="src/sunstone/templates/login.html \
src/sunstone/templates/login_x509.html"
SUNSTONE_VIEWS_FILES="src/sunstone/views/index.erb"
SUNSTONE_VIEWS_FILES="src/sunstone/views/index.erb \
src/sunstone/views/login.erb \
src/sunstone/views/_login_standard.erb \
src/sunstone/views/_login_x509.erb"
SUNSTONE_PUBLIC_JS_FILES="src/sunstone/public/js/layout.js \
src/sunstone/public/js/login.js \

View File

@ -246,13 +246,7 @@ end
get '/login' do
if !authorized?
if settings.config[:auth] == "x509"
templ = "login_x509.html"
else
templ = "login.html"
end
return File.read(File.dirname(__FILE__)+'/templates/'+templ)
erb :login
end
end

View File

@ -1,52 +0,0 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenNebula Sunstone Login</title>
<link rel="stylesheet" type="text/css" href="css/login.css" />
<link rel="stylesheet" type="text/css" href="vendor/jQueryUI/jquery-ui-1.8.16.custom.css" />
<!-- Vendor Libraries -->
<script type="text/javascript" src="vendor/jQuery/jquery-1.7.2.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="vendor/crypto-js/core-min.js"></script>
<script type="text/javascript" src="vendor/crypto-js/enc-base64-min.js"></script>
<![endif]-->
<!-- End Vendor Libraries -->
<script type="text/javascript" src="js/opennebula.js"></script>
<script type="text/javascript" src="js/login.js"></script>
</head>
<body>
<div id="header">
<div id="logo">
The OpenNebula Cloud Operations Center
</div>
</div>
<div id="wrapper">
<div id="logo_sunstone">
</div>
<div id="error_box" class="error_message ui-state-error ui-corner-all">
</div>
<form id="login_form">
<div class="border" id="login">
<div class="content">
Username
<input type="text" size="15" name="username" id="username" class="box"/>
Password
<input type="password" size="15" name="password" id="password" class="box"/>
<br />
<input type="checkbox" id="check_remember" />
<label id="label_remember" for="check_remember">Remember me</label>
<input type="submit" id="login_btn" value="" />
<img src="images/ajax-loader.gif" alt="retrieving" id="login_spinner" />
</div>
</div>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,24 @@
<div id="wrapper">
<div id="logo_sunstone">
</div>
<div id="error_box" class="error_message ui-state-error ui-corner-all">
</div>
<form id="login_form">
<div class="border" id="login">
<div class="content">
Username
<input type="text" size="15" name="username" id="username" class="box"/>
Password
<input type="password" size="15" name="password" id="password" class="box"/>
<br />
<input type="checkbox" id="check_remember" />
<label id="label_remember" for="check_remember">Remember me</label>
<input type="submit" id="login_btn" value="" />
<img src="images/ajax-loader.gif" alt="retrieving" id="login_spinner" />
</div>
</div>
</form>
</div>

View File

@ -1,26 +1,3 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenNebula Sunstone Login</title>
<link rel="stylesheet" type="text/css" href="css/login.css" />
<!-- Vendor Libraries -->
<script type="text/javascript" src="vendor/jQuery/jquery-1.7.2.min.js"></script>
<!-- End Vendor Libraries -->
<script type="text/javascript" src="js/opennebula.js"></script>
<script type="text/javascript" src="js/login.js"></script>
</head>
<body>
<div id="header">
<div id="logo">
The OpenNebula Cloud Operations Center
</div>
</div>
<div id="wrapper">
<div id="logo_sunstone">
</div>
@ -43,5 +20,3 @@
</div>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenNebula Sunstone Login</title>
<link rel="stylesheet" type="text/css" href="css/login.css" />
<!-- Vendor Libraries -->
<script type="text/javascript" src="vendor/jQuery/jquery-1.7.2.min.js"></script>
<!-- End Vendor Libraries -->
<script type="text/javascript" src="js/opennebula.js"></script>
<script type="text/javascript" src="js/login.js"></script>
</head>
<body>
<div id="header">
<div id="logo">
The OpenNebula Cloud Operations Center
</div>
</div>
<% if settings.config[:auth] == "x509" %>
<%= erb :_login_x509 %>
<% else %>
<%= erb :_login_standard %>
<% end %>
</body>
</html>