Gitlab CSE Unil

Commit 3225faa4 authored by Julien Furrer's avatar Julien Furrer
Browse files

Using of compiled js can be defined in settings

parent 45e762cb
......@@ -51,8 +51,16 @@ module.exports = function(grunt) {
name: "../js/su_app",
out: "../js/su_app" + jsOptimizedSuffix + ".js"
}
},
main_newao: {
options: {
name: "../js/newao_app",
out: "../js/newao_app" + jsOptimizedSuffix + ".js"
}
}
},
// ===== Copy Files =====
......@@ -184,6 +192,6 @@ module.exports = function(grunt) {
grunt.registerTask('libs', ['copy:libs', 'less:libs', 'concat:libs']);
// Build main app
grunt.registerTask('build su_app', ['uglify:adim', 'requirejs:main_su']);
grunt.registerTask('build app', ['uglify:adim', 'requirejs:main_su', 'requirejs:main_newao']);
};
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -37,7 +37,6 @@
{% block inline_script %}
{{ block.super }}
<script>
window.ADIM_CONFIG = {
mode: "edit",
......@@ -79,7 +78,7 @@ window.ADIM_CONFIG = {
{% block content_js %}
{{ block.super }}
<script src="{% static "js/libs/require.min.js" %}" data-main="{% static "js/su_app" %}"></script>
<script src="{% static "js/libs/require.min.js" %}" data-main="{% static "js/su_app" %}{{ JS_MIN }}"></script>
{% endblock %}
......
......@@ -34,20 +34,30 @@ window.ADIM_CONFIG = {
{% block content_js %}
{{ block.super }}
<script src="{% static "js/libs/require.min.js" %}" data-main="{% static "js/newao_app" %}"></script>
<script src="{% static "js/libs/require.min.js" %}" data-main="{% static "js/newao_app" %}{{ JS_MIN }}"></script>
{% endblock %}
{% block canvas_content %}
<div class="dropzone">
<div class="dropzone-inner-wrapper">
<div class="dropzone-inner adim-fu-status">
Pour ajouter une image, glisser un fichier ici <br/> ou cliquez sur &nbsp;
<span class="btn btn-success navbar-btn fileinput-button">
<span class="glyphicon glyphicon-plus"></span>&nbsp;
<span>Nouvelle image</span>
<input id="fileupload" type="file" name="image_file" data-url="{% url "adim.app:upload_file" %}"
accept="image/png,image/jpg">
</span>
<p>
Pour <strong>ajouter une image</strong>, glissez un fichier ici ou cliquez&nbsp;sur&nbsp;
<span class="btn btn-success btn-sm navbar-btn fileinput-button">
<span class="glyphicon glyphicon-plus"></span>&nbsp;
<span>Nouvelle image</span>
<input id="fileupload" type="file" name="image_file" data-url="{% url "adim.app:upload_file" %}"
accept="image/png,image/jpg">
</span>
</p>
<p>
Pour <strong>choisir une image</strong> de votre collection, cliquez&nbsp;sur&nbsp;
<button type="button" class="btn btn-sm btn-default navbar-btn" onclick="$('#aom-show-but').click()">
<span class="glyphicon glyphicon-th"></span> Mes images
</button>
</p>
<div class="progress-wrapper hide">
<div class="progress">
......
......@@ -8,7 +8,8 @@ def default(request):
context_extras = {}
context_extras.update({
'UPLOAD_MAX_FILESIZE': settings.ADIM_UPLOAD_MAX_FILESIZE
'UPLOAD_MAX_FILESIZE': settings.ADIM_UPLOAD_MAX_FILESIZE,
'JS_MIN': '' if settings.ADIM_DEBUG_JS else '.min'
})
# try:
......
# Max filesize in Mb
ADIM_UPLOAD_MAX_FILESIZE = 50
ADIM_DEBUG_JS = False
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