1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- {% extends "base.html.tera" %} {% block content %}
- <div class="container">
- <form action="/api/shitpost/add", method="post">
- <label for="title">Название</label>
- <br>
- <input type="text" name="title" id="title"/>
- <br>
- <label>Тип</label>
- <br>
- {% for type in types %}
- <input type="radio" name="type_id" id="{{ type.id }}" value="{{ type.id }}"/>
- <label for="{{ type.id }}">{{type.title}}</label>
- <br>
- {% endfor %}
- <label for="url">Ссылка</label>
- <br>
- <input type="url" name="url" id="url"/>
- <br>
- <label for="seconds">Продолжительность(секунд)</label>
- <br>
- <input type="number" name="seconds" id="seconds"/>
- <br>
- <button type="submit">Добавить</button>
- </form>
- </div>
- <script lang='js'>
- function get_types() {
- axios({
- method:'get',
- url: `/shitpost/types`
- })
- .then((response) => {
- // handle success
- return response.data
- })
- .catch((error) => {
- // handle error
- console.log(error);
- })
- }
- </script>
- {% endblock content %}
|