recup code pour mu editor

This commit is contained in:
2025-07-05 16:11:20 +02:00
parent 12b8efafbf
commit 5e9ac09dcf
25 changed files with 1006 additions and 0 deletions

View File

@ -0,0 +1,19 @@
{% extends "base.html" %}
{% block content %}
<h1>Age-o-meter</h1>
<p>How old are you..?
<form action="/age" method="post">
{% if error %}
<p><strong>{{error}}</strong></p>
{% endif %}
<label for="dob">Please enter your date of birth:</label>
<input type="text" name="dob" placeholder="YYYY-MM-DD">
<input type="submit" value="Submit">
</form>
{% if days_old %}
<p>Your are <strong>{{days_old}}</strong> days old.</p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{% block title %}Hello from Mu! :-){% endblock %}</title>
<meta name="description" content="A big hello from Mu">
<meta name="author" content="Add your name here">
<!-- CSS
-->
<link rel="stylesheet" href="/static/css/normalize.css">
<link rel="stylesheet" href="/static/css/skeleton.css">
<!-- Javascript
-->
<!-- Mobile Specific Metas (Do not change)
-->
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="container">
{% block content %}{% endblock %}
</div>
</body>
</html>

View File

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block content %}
<h1>Hello!</h1>
<p>Hello {{name}}, how are you?</p>
{% endblock %}

View File

@ -0,0 +1,32 @@
{% extends "base.html" %}
{% block content %}
<div class="row">
<div class="two columns"><img src="/static/img/logo.png" alt="logo"/></div>
<div class="ten columns"><h1>Hello from Mu!</h1></div>
</div>
<div class="row">
<p>This is a very simple dynamic web application built using Python and
the
<a href="http://flask.pocoo.org/" target="_new">Flask web framework</a>.</p>
<p>Why not try adding the following route to your Python code?</p>
<pre><code>
@app.route('/hello/&lt;name&gt;')
def greet(name='Stranger'):
return render_template("greeting.html", name=name)
</code></pre>
<p>Now add the following template with the filename, "greeting.html".</p>
<pre><code>
&#123;% extends "base.html" %&#125;
&#123;% block content %&#125;
&lt;p&gt;Hello &#123;&#123;name&#125;&#125;, how are you?&lt;/p&gt;
&#123;% endblock %&#125;
</code></pre>
<p>Once you've done that, go visit
<a href="/hello/yourname">/hello/yourname</a> (but replace "yourname" in
the address bar with, you know, your actual name). :-)</p>
</div>
{% endblock %}