Skip to content

Commit

Permalink
Refs #253, merging changes
Browse files Browse the repository at this point in the history
  • Loading branch information
doumdi committed Sep 25, 2024
2 parents feafedc + 21e2d8d commit ef3d23a
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 80 deletions.
4 changes: 3 additions & 1 deletion teraserver/python/modules/FlaskModule/Views/LoginView.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ def get(self):
if 'X_EXTERNALPORT' in request.headers:
port = request.headers['X_EXTERNALPORT']

show_logo = 'no_logo' not in request.args

versions = TeraVersions()
versions.load_from_db()

return render_template('login.html', hostname=hostname, port=port,
server_version=versions.version_string)
server_version=versions.version_string, show_logo=show_logo)
9 changes: 4 additions & 5 deletions teraserver/python/static/bootstrap/css/bootstrap.min.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions teraserver/python/static/bootstrap/js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion teraserver/python/static/bootstrap/js/bootstrap.min.js.map

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions teraserver/python/static/css/login_style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
body{
background-color: #2c3338;
}

.card-header, .card-footer{
background-color: #4c5861;
color: white;
}

.card-body{
background-color: black;
color: white;
}

.card{
border: none;
box-shadow: 5px 5px 4px #424242;
}

.img-logo{
max-height: 175px;
}
1 change: 1 addition & 0 deletions teraserver/python/static/css/main_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
.jumbotron{
padding:10px 10px 10px 10px;
margin-bottom:10px;
background-color: #e9ecef;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 16 additions & 15 deletions teraserver/python/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<body>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0 text-center">
<div class="jumbotron ms-2 me-2 mb-0 mt-0 text-center">
<a href="https://www.telereadaptation.com" target="_blank"><img src="./static/img/logos/Estrad.png" class="img-fluid img-logo" /></a>
<a href="https://introlab.3it.usherbrooke.ca" target="_blank"><img src="./static/img/logos/IntRoLab.png" class="img-fluid img-logo" /></a>
<a href="https://regroupementinter.com" target="_blank"><img src="./static/img/logos/INTER.png" class="img-fluid img-logo" /></a>
Expand All @@ -22,44 +22,45 @@
<a href="https://www.cdrv.ca" target="_blank"><img src="./static/img/logos/logo_CDRV.png" class="img-fluid img-logo" /></a>
</div>

<div class="jumbotron ml-2 mr-2 mb-0">
<div class="jumbotron ms-2 me-2 mb-0">
<h1>{% trans %}Versions{% endtrans%}</h1>
<a href="https://github.com/introlab/opentera"> Project OpenTera on GitHub</a><br>
Server URL : https://{{hostname}}:{{port}} <br>
Version: {{server_version}} <br>
</div>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<div class="jumbotron ms-2 me-2 mb-0 mt-0">
<h1>{% trans %}Downloads{% endtrans%}</h1>
<div class="row">
<div class="card col-4 text-center mt-2" style="width: 18rem;">
<img src="./static/img/logos/Windows-icon.png" class="card-img-top img-logo-download m-auto" alt="Windows logo">
<div class="row m-2 gap-2">
<div class="card col text-center">
<img src="./static/img/logos/Windows-icon.png" class="card-img-top img-logo-download mt-2 m-auto" alt="Windows logo">
<div class="card-body">
<h5 class="card-title">Windows</h5>
<p class="card-text">{% trans %}Latest version: {% endtrans%}{{openteraplus_version.client_version}}</p>
<a href="{{openteraplus_version.client_windows_download_url}}" class="btn btn-primary">Download</a>
</div>
</div>
<div class="card col-4 text-center mt-2" style="width: 18rem;">
<img src="./static/img/logos/Mac-icon.png" class="card-img-top img-logo-download m-auto" alt="Mac logo">
<div class="card col text-center">
<img src="./static/img/logos/Mac-icon.png" class="card-img-top img-logo-download mt-2 m-auto" alt="Mac logo">
<div class="card-body">
<h5 class="card-title">Mac</h5>
<p class="card-text">{% trans %}Latest version: {% endtrans%}{{openteraplus_version.client_version}}</p>
<a href="{{openteraplus_version.client_mac_download_url}}" class="btn btn-primary align-center">Download</a>
</div>
</div>
<div class="card col-4 text-center mt-2" style="width: 18rem;">
<img src="./static/img/logos/Linux-icon.png" class="card-img-top img-logo-download m-auto" alt="Linux logo">
<div class="card col text-center">
<img src="./static/img/logos/Linux-icon.png" class="card-img-top img-logo-download mt-2 m-auto" alt="Linux logo">
<div class="card-body">
<h5 class="card-title">Linux</h5>
<p class="card-text">{% trans %}Latest version: {% endtrans%}{{openteraplus_version.client_version}}</p>
<a href="{{openteraplus_version.client_linux_download_url}}" class="btn btn-primary">Download</a>
<!--<p class="card-text">{% trans %}Latest version: {% endtrans%}{{openteraplus_version.client_version}}</p>
<a href="{{openteraplus_version.client_linux_download_url}}" class="btn btn-primary">Download</a>-->
Not yet available
</div>
</div>
</div>
</div>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<div class="jumbotron ms-2 me-2 mb-0 mt-0">
<h1>{% trans %}License{% endtrans%}</h1>
<p class="lead">
OpenTera is licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a>
Expand All @@ -73,7 +74,7 @@ <h1>{% trans %}License{% endtrans%}</h1>



<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<div class="jumbotron ms-2 me-2 mb-0 mt-0">
<h1>{% trans %}Authors{% endtrans%}</h1>
<ul class="list-group">
<li class="list-group-item">Simon Brière, ing., M.Sc.A. ([email protected])</li>
Expand All @@ -83,7 +84,7 @@ <h1>{% trans %}Authors{% endtrans%}</h1>
</ul>
</div>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<div class="jumbotron ms-2 me-2 mb-0 mt-0">
<h1>{% trans %}Contributors{% endtrans%}</h1>
<ul class="list-group">
<li class="list-group-item">Philippe Arsenault</li>
Expand Down
44 changes: 2 additions & 42 deletions teraserver/python/templates/disabled_doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<body>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0 text-center">
<div class="jumbotron ms-2 me-2 mb-0 mt-0 text-center">
<a href="https://www.telereadaptation.com" target="_blank"><img src="./static/img/logos/Estrad.png" class="img-fluid img-logo" /></a>
<a href="https://introlab.3it.usherbrooke.ca" target="_blank"><img src="./static/img/logos/IntRoLab.png" class="img-fluid img-logo" /></a>
<a href="https://regroupementinter.com" target="_blank"><img src="./static/img/logos/INTER.png" class="img-fluid img-logo" /></a>
Expand All @@ -22,52 +22,12 @@
<a href="https://www.cdrv.ca" target="_blank"><img src="./static/img/logos/logo_CDRV.png" class="img-fluid img-logo" /></a>
</div>

<div class="jumbotron ml-2 mr-2 mb-0">
<h1>{% trans %}Versions{% endtrans %}</h1>
<a href="https://github.com/introlab/opentera"> Project OpenTera on GitHub</a><br>
Server URL : https://{{hostname}}:{{port}} <br>
Version: {{server_version}} <br>
</div>



<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<h1>{% trans %}License{% endtrans %}</h1>
<p class="lead">
OpenTera is licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a>
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</p>
</div>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<div class="jumbotron ms-2 me-2 mb-0 mt-0">
<div class="alert alert-primary" role="alert">
<center><h1>{% trans %}Documentation is disabled!{% endtrans %}</h1></center>
</div>
</div>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<h1>{% trans %}Authors{% endtrans %}</h1>
<ul class="list-group">
<li class="list-group-item">Simon Brière, ing., M.Sc.A. ([email protected])</li>
<li class="list-group-item">Dominic Létourneau, ing., M.Sc.A ([email protected])</li>
<li class="list-group-item">François Michaud, ing., Ph.D ([email protected])</li>
<li class="list-group-item">Michel Tousignant, Pht, Ph.D ([email protected])</li>
</ul>
</div>

<div class="jumbotron ml-2 mr-2 mb-0 mt-0">
<h1>{% trans %}Contributors{% endtrans %}</h1>
<ul class="list-group">
<li class="list-group-item">Philippe Arsenault</li>
<li class="list-group-item">Cédric Godin</li>
<li class="list-group-item">Marc-Antoine Maheux</li>
<li class="list-group-item">Cynthia Vilanova</li>
</ul>
</div>

</body>
</html>
35 changes: 23 additions & 12 deletions teraserver/python/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link href="./static/img/favicon.ico" rel="icon" type="image/x-icon" />
<link href="./static/img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" href="./static/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="./static/css/main_style.css" />
<link rel="stylesheet" href="./static/css/login_style.css" />
<script src="./static/js/jquery-3.7.1.min.js"></script>
<script src="./static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
Expand Down Expand Up @@ -63,33 +63,44 @@
}
});
});
$("input").change(function(){
$('#error_message').hide();
});
});

</script>
</head>
<body>
<!-- Create a login form using bootstrap -->
<div class="container">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="col col-md-6">
{% if show_logo %}
<div class="w-100 d-flex">
<img src="./static/img/logos/LogoOpenTera.png" class="img-logo ms-auto me-auto">
</div>
{% endif %}
<div class="card">
<div class="card-header">Login</div>
<div class="card-header"></div>
<div class="card-body">
<form id="loginForm" action="/api/user/login" method="post">
<div class="form-group row">
<label for="username" class="col-md-4 col-form-label text-md-right">Username</label>
<div class="col-md-6">
<div class="form-group row">
<label for="username" class="col-4 col-form-label text-md-right">Username</label>
<div class="col-8 col-md-6">
<input type="text" id="username" class="form-control" name="username" required autofocus>
</div>
</div>
<div class="form-group
row">
<label for="password" class="col-md-4 col-form-label text-md-right">Password</label>
<div class="col-md-6">
<div class="form-group row mt-2">
<label for="password" class="col-4 col-form-label text-md-right">Password</label>
<div class="col-8 col-md-6">
<input type="password" id="password" class="form-control" name="password" required>
</div>
</div>
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">Login</button>
<div class="row mt-2">
<div class="col-4"></div>
<div class="col-8 col-md-6">
<button type="submit" class="btn btn-primary w-100">Login</button>
</div>
</div>
</form>
</div>
Expand Down

0 comments on commit ef3d23a

Please sign in to comment.