job_offer_form.html 4.4 KB
Newer Older
1
2
{% extends "base.html" %}

3
4
5
6
7
{% 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%}

8
9
10
11
12
13
14
15
16
17
{% block header_content %}
    <a href="{{ SITEURL }}/category/offres-demploi.html" class="btn btn-dark my-1" id="header-btn">
        <div class="row m-0 d-flex align-items-center">
            <div id="circle-offresdemploi"></div>
            <span class="category text-uppercase pl-2">Offres d'emploi</span>
        </div>
    </a>
    <h1 class="my-3">Publier une offre d'emploi</h1>
{% endblock header_content %}

18
19
{% block content %}

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<div class="container-fluid job_offers">
    <div class="container job_form">
        <link rel="stylesheet" href="{{ SITEURL }}/css/simplemde.min.css">
        <script src="{{ SITEURL }}/js/simplemde.min.js"></script>
        <p><span class="error">Les informations obligatoires sont indiquées par une *.</span></p>
        <form name="job_offer_form" enctype="multipart/form-data" method="post" action="">
            <P>
                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>
            </p>
            <p>
            Titre* <br>
                <input type="text" name="title" value="{{ '{{form.title}}' }}" autofocus required>
                <span class="error">{{ '{{errors.title}}' }}</span>
            </p>
            <p>
                Nom du contact* <br>
                <input type="text" name="author" value="{{ '{{form.author}}' }}" required>
                <span class="error">{{ '{{errors.author}}' }}</span>
            </p>
            <p>
                E-mail <br>
                <input type="email" name="email" value="{{ '{{form.email}}' }}">
                <span class="error" name="error-email">{{ '{{errors.email}}' }}</span>
            </p>
            <p>
                Site web <br>
                <input type="url" name="website" value="">
55
56
57
58
59
60
61
62
63
                <span class="error" name="error-website"></span>
            </p>
            <p>
                Lieu <br>
                <input type="text" name="location" value="">
            </p>
            <p>
                Durée <br>
                <input type="text" name="duration" value="">
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
            </p>
            <p>
                Description* <br>
                <textarea name="description" rows="5" cols="40" id="job_offer_description" required>{{ '{{form.description}}' }}</textarea>
                <span class="error" name="error-description">{{ '{{errors.description}}' }}</span>
            </p>
            <p>
                Fichier joint : 
                <input type="file" name="file" accept="{{ '{{file_accept}}' }}">
                <span class="error" name="error-file">{{ '{{errors.attachment}}' }}</span>
            </p>
            <p>
                <input type="submit" name="submit" value="Soumettre">
            </p>
        </form>
79

80
81
82
83
        <script>
            var simplemde = new SimpleMDE({
                element: document.getElementById("job_offer_description"),
                spellChecker: false,
84
85
                forceSync: true,
                hideIcons: ["image"],
86
            });
87

88
89
90
            // 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;
91

92
93
94
95
96
97
98
99
100
101
102
103
            // 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 %}
            ' }}
        </script>
    </div>
</div>
104

105
{% endblock content %}