job_offer_form.html 2.86 KB
Newer Older
1
2
3
4
5
6
7
8
{% extends "index.html" %}
{% block title %}Formulaire de dépôt d'une offre d'emploi{% endblock %}
{% block ogtitle %}Formulaire de dépôt d'une offre d'emploi{% endblock %}
{% block ogurl %}{{ SITEURL }}/contact.html{%endblock%}
{% block canonicalurl %}{{ SITEURL }}/contact.html{%endblock%}

{% block content %}

9
10
<link rel="stylesheet" href="{{ SITEURL }}/css/simplemde.min.css">
<script src="{{ SITEURL }}/js/simplemde.min.js"></script>
11
12

<p>
13
    <span class="error">* informations obligatoires.</span>
14
</p>
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<form name="job_offer_form" enctype="multipart/form-data" method="post" action="">
    Type de l'offre* : <select name="job_type" required>
    {{ '
        <option hidden disabled {% if not form.job_type %} selected {% endif %} value></option>
    {% for key, value in job_type_list.items() %}
        <option value="{{key}}" {% if key == form.job_type %} selected {% endif %} >{{value}}</option>
    {% endfor %}
    ' }}
    </select>
    <span class="error">{{ '{{errors.job_type}}' }}</span>
    <br><br>
    Titre* : <input type="text" name="title" value="{{ '{{form.title}}' }}" autofocus required>
    <span class="error">{{ '{{errors.title}}' }}</span>
    <br><br>
    Nom du contact* : <input type="text" name="author" value="{{ '{{form.author}}' }}" required>
    <span class="error">{{ '{{errors.author}}' }}</span>
    <br><br>
    E-mail : <input type="email" name="email" value="{{ '{{form.email}}' }}">
    <span class="error" name="error-email">{{ '{{errors.email}}' }}</span>
    <br><br>
    Site web : <input type="url" name="website" value="">
    <span class="error" name="error-url"></span>
    <br><br>
    Description* : <textarea name="description" rows="5" cols="40" id="job_offer_description" required>{{ '{{form.description}}' }}</textarea>
    <span class="error" name="error-description">{{ '{{errors.description}}' }}</span>
    <br><br>
    Fichier : <input type="file" name="file" accept="{{ '{{file_accept}}' }}">
    <span class="error" name="error-file">{{ '{{errors.attachment}}' }}</span>
    <br><br>
44
45
46
    <input type="submit" name="submit" value="Soumettre">
</form>

47
48
49
50
51
52
53
54
55
56
<script>
    var simplemde = new SimpleMDE({
        element: document.getElementById("job_offer_description"),
        spellChecker: false,
        forceSync: true
    });

    // Fix HTML5 required attribute for the description when SimpleMDE is used
    // See: https://github.com/sparksuite/simplemde-markdown-editor/issues/324
    document.querySelector('#job_offer_description').required = undefined;
57
58
59
60
61
62
63
64
65
66

    // Workaround to avoid browser message about empty description when
    // it has been pre-filled.
    {{ '
    {% if not form.description %}
    document.querySelector(".CodeMirror textarea").required = true;
    {% else %}
    simplemde.codemirror.on("change", function() { document.querySelector(".CodeMirror textarea").required = true; });
    {% endif %}
    ' }}
67
</script>
68
{% endblock %}