Gitlab CSE Unil

Commit 267a5727 authored by Julien Furrer's avatar Julien Furrer
Browse files

ajouté vue pour les essais, accessible que par INTERNAL_IPS en mode DEBUG

parent 906cf465
......@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.conf.urls import url, include
from .views import home, upload_file, annotate_new, annotate, send_anobj_img, anobj_thumb, upload_anobj_thumb, \
suggest_users, essai
urlpatterns = [
url(r'^$', home, name="home"),
......@@ -23,4 +23,5 @@ urlpatterns = [
url(r'^s/u/$', suggest_users, name='suggest-users'),
url(r'^essai/$', essai, name='suggest-users'),
......@@ -52,14 +52,18 @@ def handle_404(request):
return HttpResponseRedirect(reverse('adim_app:home'))
def essai(request):
Page d'essais
:param request:
return render(request, "adim/essai.html", {})
if settings.DEBUG and request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:
return render(request, "adim/essai.html", {})
raise Http404()
{% extends "base.html" %}
{% load static i18n %}
{% block page_head %}{% endblock %}
{% block main_container %}
<div class="container" id="main-home">
<div class="row">
<div class="col-sm-12">
<div id="aom-list-panel" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
{% trans "Liste des annotables" %}
<button class="btn btn-xs btn-success pull-right">
<span class="glyphicon glyphicon-plus"></span>&nbsp;
{% trans "Ajouter une image" %}
<div class="panel-body">
<div id="aom-list-container"></div>
<div id="aom-dropzone">
<div class="well text-center lead">
{% trans "Pour ajouter une image, glissez le fichier ici ou cliquez sur" %}
<button class="btn btn-success">
<span class="glyphicon glyphicon-plus"></span>&nbsp;
{% trans "Ajouter une image" %}
{% endblock %}
{% block js_templates %}
{# ===== MODAL DLG EditName ===== #}
<div class="modal" id="aom-edit-name-dlg">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">{% trans "Changer le nom du document à annoter" %}</h4>
<div class="modal-body">
<input type="text" class="form-control" name="ao-name" placeholder="{% trans "Nom du document à annoter" %}"/>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">{% trans "Annuler" %}</button>
<button type="button" class="btn btn-sm btn-primary btn-submit">{% trans "Enregistrer" %}</button>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script type="text/template" id="aom-list-item">
<span class="name" title="Clicker pour éditer"><%= name %></span>
<a href="<%= '{% url "" anobj_id="_" %}'.replace('_', id) %>">
<img src="<%= image_thumb %>">
<script type="text/template" id="aom-list-item-popup-content">
<dl class="dl-horizontal">
<dt>{% trans "Modifié le" %} :</dt>
<dd>(last modif date)</dd>
<dt>{% trans "Annotations" %} :</dt>
<dd><%= annotations.length %></dd>
{% endblock %}
{% block inline_script %}
window.ADIM_CONFIG = {
mode: "edit",
csrfToken: "{{ csrf_token }}",
api: {
baseUrl: "{% url "api-root" %}"
{% endblock %}
{% block content_js %}
{{ block.super }}
<script src="{% static "js/libs/require.min.js" %}" data-main="{% static "js/anobj_mgr" %}"></script>
{% endblock %}
<h1>{{ ip }}</h1>
{% with toto="/babibu/" %}
<strong>Val: </strong><code>{{ toto }}</code>
<strong>Val: </strong><code>{{ toto|make_list|slice:"1:"|join:"" }}</code>
<li><strong>admin: </strong><code>{% url "admin:index" %}</code></li>
<li><strong>admin: </strong><code>{% filter make_list|slice:"1:"|join:"" %}{% url "admin:index" %}{% endfilter %}</code></li>
{% endwith %}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment