Skip to content

Commit

Permalink
Migrating to Flask
Browse files Browse the repository at this point in the history
From this commit we have started to implement Flask in all new versions of the platform, to learn more visit the wiki, in this commit we have started to create files for the proper functioning of Flask. ALL THE FILES OF THE OLD VERSION ARE TEMPORARILY IN /old, since the development has not yet been completed.
  • Loading branch information
Isaaker committed Dec 3, 2023
1 parent 442d0b4 commit 2ddc90a
Show file tree
Hide file tree
Showing 50 changed files with 140 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ __pycache__/
*.py[cod]
*$py.class

### Flask ###
.venv/

*.pyc
__pycache__/

instance/

.pytest_cache/
.coverage
htmlcov/

dist/
build/
*.egg-info/

# C extensions
*.so

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The reason why it is called Ghost Simulator, is that in archery we call these tr

The following technologies have been used in this project:

<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original-wordmark.svg" alt="HTML 5 Logo" width=50 height=50/><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/php/php-original.svg" alt="PHP Logo" width=50 height=50/> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/css3/css3-original-wordmark.svg" alt="CSS3 Logo" width=50 height=50/><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg" alt="Javascript Logo" width=50 height=50/>
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original-wordmark.svg" alt="HTML 5 Logo" width=50 height=50/><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/flask/flask-original.svgw" alt="Flask Logo" width=50 height=50/> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/css3/css3-original-wordmark.svg" alt="CSS3 Logo" width=50 height=50/><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg" alt="Javascript Logo" width=50 height=50/>



Expand Down
28 changes: 28 additions & 0 deletions ghost_simulator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os

from flask import Flask


def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)

if test_config is None:
# load the instance config, if it exists, when not testing
app.config.from_pyfile('config.py', silent=True)
else:
# load the test config if passed in
app.config.from_mapping(test_config)

# ensure the instance folder exists
try:
os.makedirs(app.instance_path)
except OSError:
pass

@app.route('/index')
def index():
return 'Hello, World!'

return app

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions ghost_simulator/old/css/settings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
background-color: #fade95;
}

message {
margin: 100px auto;
width: 700px;
height: 400px;
border: 1px solid #ccc;
border-radius: 5px;
padding: 10px;
font-family: sans-serif;
font-size: 14px;
color: #333;
background-color: white;
}

.message .header {
font-size: 24px;
font-weight: bold;
color: red;
}

.message .body {
font-size: 20px;
line-height: 1.5;
}

.message .color-red {
font-size: 20px;
line-height: 1.5;
color: red;
}

.icons {
display: flex;
flex-direction: row;
justify-content: space-around;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions ghost_simulator/old/html/settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
</head>
<body>
<div class="message">
<h1>Configuración</h1>
<h2></h2>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion simulator.php → ghost_simulator/old/simulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
<center>


<!--- Make table data visible --->
<!--- Save Simulation Data --->

<br>
<center>
Expand Down
43 changes: 43 additions & 0 deletions ghost_simulator/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!doctype html>
<title>{% block title %}{% endblock %} - Ghost Simulator</title>

<!--- Responsive Platform --->
<meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt>

<meta charset="utf-8">
<meta name="robots" content="noindex">

<!--- Favicon --->
<link rel="apple-touch-icon" sizes="180x180" href="./images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./images/favicon-16x16.png">
<link rel="manifest" href="./images/site.webmanifest">
<meta name="msapplication-TileColor" content="#fade95">
<meta name="theme-color" content="#fade95">

<!--- Check JavaScript --->
<noscript>
<meta http-equiv="refresh" content="0;URL='./javascript_disabled.html'" />
</noscript>

<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">

<!--- Content --->

<a href="./"><img src="/images/Archery_Ghost_Simulator.png" alt="ghost simulator logo" width="40" height="40"></img></a>
<h1>Archery Ghost Simulator</h1>
<div class="UI_icons">
<a href="/about.html"><img src="/images/ui_icons/info.svg" alt="about"><img></a>
<a href="/settings.html"><img src="/images/ui_icons/settings.svg" alt="settings"><img></a>
<a href="https://ghostsimulator.eu.auth0.com/oidc/logout"><img src="/images/ui_icons/log-out.svg" alt="logout"><img></a>
</div>

<section class="content">
<header>
{% block header %}{% endblock %}
</header>
{% for message in get_flashed_messages() %}
<div class="flash">{{ message }}</div>
{% endfor %}
{% block content %}{% endblock %}
</section>

0 comments on commit 2ddc90a

Please sign in to comment.