Functional

This commit is contained in:
Antoine Martin 2022-05-13 05:11:35 +02:00
parent 7a053983a7
commit c924918387
15 changed files with 281 additions and 19 deletions

View file

@ -0,0 +1,27 @@
{% load static %}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{% static 'scratch_show/base.css' %}" />
<link rel="icon" type="image/png" href="{% static 'scratch_show/favicon.png' %}" />
<title>Ateliers Scratch by Prologin</title>
</head>
<body>
<header class="site-header">
<a href="/" class="header-home-link">
<img src="https://prologin.org/static/img/logo_cube.png" alt="Prologin Cube Logo">
<h1 class="site-title">Ateliers Scratch by Prologin</h1>
</a>
</header>
<main>
<div class="container">
{% block content %}
{% endblock %}
</div>
</main>
</body>
</html>

View file

@ -0,0 +1,15 @@
{% extends 'scratch_show/base.html' %}
{% block content %}
<h1>{{ event.name }}, le {{ event.date|date }}</h1>
<ul>
{% for project in projects %}
<li><a href="{% url 'scratch_show:project-detail' project.pk %}">{{ project.name }}</a> par {{ project.author_name }}</li>
{% empty %}
<li>Aucun projet pour le moment !</li>
{% endfor %}
</ul>
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends 'scratch_show/base.html' %}
{% block content %}
{% if current_event %}
<h2>Atelier en cours: <a href="{% url 'scratch_show:event-detail' current_event.pk %}">{{ current_event.name }}</a></h2>
<b><a href="{% url 'scratch_show:project-add' %}">Clique ici pour ajouter ton projet !</a></b>
{% endif %}
<h2>Ateliers passés</h2>
<ul>
{% for event in past_events %}
<li><a href="{% url 'scratch_show:event-detail' event.pk %}">{{ event.name }}</a> le {{ event.date|date}}</li>
{% empty %}
<li>Pas d'ancien atelier pour le moment.</li>
{% endfor %}
</ul>
{% endblock %}

View file

@ -1,4 +1,10 @@
{% extends 'scratch_show/base.html' %}
{% block content %}
<h1>{{ object.name }}</h1>
<p>Créateur : {{ object.author_name }}</p>
<iframe src="https://scratch.mit.edu/projects/{{ object.project_id }}/embed" allowtransparency="true" width="485" height="402" frameborder="0" scrolling="no" allowfullscreen></iframe>
<iframe src="{{ object.project_url }}/embed" allowtransparency="true" width="485" height="402" frameborder="0" scrolling="no" allowfullscreen></iframe>
{% endblock %}

View file

@ -1,4 +1,11 @@
{% extends 'scratch_show/base.html' %}
{% block content %}
<form method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save">
</form>
{% endblock %}