Gitlab CSE Unil
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
ADIM
Commits
267a5727
Commit
267a5727
authored
Aug 06, 2015
by
Julien Furrer
Browse files
ajouté vue pour les essais, accessible que par INTERNAL_IPS en mode DEBUG
parent
906cf465
Changes
3
Hide whitespace changes
Inline
Side-by-side
adim_project/adim_app/urls.py
View file @
267a5727
...
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
...
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from
django.conf.urls
import
url
,
include
from
django.conf.urls
import
url
,
include
from
.views
import
home
,
upload_file
,
annotate_new
,
annotate
,
send_anobj_img
,
anobj_thumb
,
upload_anobj_thumb
,
\
from
.views
import
home
,
upload_file
,
annotate_new
,
annotate
,
send_anobj_img
,
anobj_thumb
,
upload_anobj_thumb
,
\
suggest_users
suggest_users
,
essai
urlpatterns
=
[
urlpatterns
=
[
url
(
r
'^$'
,
home
,
name
=
"home"
),
url
(
r
'^$'
,
home
,
name
=
"home"
),
...
@@ -23,4 +23,5 @@ urlpatterns = [
...
@@ -23,4 +23,5 @@ urlpatterns = [
),
),
url
(
r
'^s/u/$'
,
suggest_users
,
name
=
'suggest-users'
),
url
(
r
'^s/u/$'
,
suggest_users
,
name
=
'suggest-users'
),
url
(
r
'^essai/$'
,
essai
,
name
=
'suggest-users'
),
]
]
adim_project/adim_app/views.py
View file @
267a5727
...
@@ -52,14 +52,18 @@ def handle_404(request):
...
@@ -52,14 +52,18 @@ def handle_404(request):
else
:
else
:
return
HttpResponseRedirect
(
reverse
(
'adim_app:home'
))
return
HttpResponseRedirect
(
reverse
(
'adim_app:home'
))
@
login_required
()
@
login_required
def
essai
(
request
):
def
essai
(
request
):
"""
"""
Page d'essais
Page d'essais
:param request:
:param request:
:return:
:return:
"""
"""
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"
,
{})
else
:
raise
Http404
()
@
login_required
@
login_required
...
...
adim_project/templates/adim/essai.html
View file @
267a5727
{% extends "base.html" %}
<h1>
{{ ip }}
</h1>
{% load static i18n %}
{% with toto="/babibu/" %}
<ul>
{% block page_head %}{% endblock %}
<li>
<strong>
Val:
</strong><code>
{{ toto }}
</code>
{% block main_container %}
</li><li>
<div
class=
"container"
id=
"main-home"
>
<strong>
Val:
</strong><code>
{{ toto|make_list|slice:"1:"|join:"" }}
</code>
<div
class=
"row"
>
</li>
<div
class=
"col-sm-12"
>
<li><strong>
admin:
</strong><code>
{% url "admin:index" %}
</code></li>
<div
id=
"aom-list-panel"
class=
"panel panel-default"
>
<li><strong>
admin:
</strong><code>
{% filter make_list|slice:"1:"|join:"" %}{% url "admin:index" %}{% endfilter %}
</code></li>
<div
class=
"panel-heading"
>
</ul>
<h3
class=
"panel-title"
>
{% endwith %}
{% trans "Liste des annotables" %}
\ No newline at end of file
<button
class=
"btn btn-xs btn-success pull-right"
>
<span
class=
"glyphicon glyphicon-plus"
></span>
{% trans "Ajouter une image" %}
</button>
</h3>
</div>
<div
class=
"panel-body"
>
<div
id=
"aom-list-container"
></div>
<div
id=
"aom-dropzone"
>
<div
class=
"well text-center lead"
>
<small>
{% trans "Pour ajouter une image, glissez le fichier ici ou cliquez sur" %}
</small>
<button
class=
"btn btn-success"
>
<span
class=
"glyphicon glyphicon-plus"
></span>
{% trans "Ajouter une image" %}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% 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"
>
×
</span><span
class=
"sr-only"
>
Close
</span></button>
<h4
class=
"modal-title"
>
{% trans "Changer le nom du document à annoter" %}
</h4>
</div>
<div
class=
"modal-body"
>
<p>
<input
type=
"text"
class=
"form-control"
name=
"ao-name"
placeholder=
"{% trans "
Nom
du
document
à
annoter
"
%}"
/>
</p>
</div>
<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>
</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
"
adim
.
app
:
annotate
"
anobj_id=
"
_
"
%}'.replace('_', id) %>
"
>
<
img
src
=
"
<%= image_thumb %>
"
>
<
/a
>
</script>
<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
>
<
/dl
>
</script>
{% endblock %}
{% block inline_script %}
<script>
window
.
ADIM_CONFIG
=
{
mode
:
"
edit
"
,
csrfToken
:
"
{{ csrf_token }}
"
,
api
:
{
baseUrl
:
"
{% url
"
api
-
root
"
%}
"
}
};
</script>
{% endblock %}
{% block content_js %}
{{ block.super }}
<script
src=
"{% static "
js
/
libs
/
require.min.js
"
%}"
data-main=
"{% static "
js
/
anobj_mgr
"
%}"
></script>
{% endblock %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment