Commit 4c232eca authored by gijs's avatar gijs

Fixes issue where quotes where not allowed in score title, scores should be displayed faster

parent f5011573
......@@ -1050,8 +1050,8 @@ window.W = window.W || {};
initialize: function () {
this.hasChanges = false;
this.metaToggled = false;
this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model, 'sync', this.render);
// this.listenTo(this.model, 'change', this.render);
// this.listenTo(this.model, 'sync', this.render);
$(window).on('beforeunload', (function (e) {
if (this.hasChanges) {
......@@ -1061,6 +1061,11 @@ window.W = window.W || {};
}
}
}).bind(this));
this.listenToOnce(this.model, 'sync', (function () {
this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model, 'sync', this.render);
}).bind(this));
},
toggleForm: function (e) {
......@@ -1311,7 +1316,7 @@ window.W = window.W || {};
'click .search': 'search',
},
onSearch: function(event) {
onSearch: function (event) {
this.collection.queryParams.search = this.$el.find('.search-input').val();
this.collection.fetch();
},
......@@ -1325,7 +1330,7 @@ window.W = window.W || {};
W.PaginationView = Backbone.Marionette.View.extend({
template: '#pagination-template',
templateContext: function() {
templateContext: function () {
return {
currentPage: this.collection.state.currentPage,
lastPage: this.collection.state.lastPage,
......@@ -1339,12 +1344,12 @@ window.W = window.W || {};
'click .previous-page': 'previousPage',
},
onNextPage: function(event) {
onNextPage: function (event) {
this.collection.getNextPage();
console.log(this.collection.state)
},
onPreviousPage: function(event) {
onPreviousPage: function (event) {
this.collection.getPreviousPage();
console.log(this.collection.state)
},
......@@ -1386,7 +1391,7 @@ window.W = window.W || {};
regions: {
search: '#search',
list: '#list',
pagination : '#pagination',
pagination: '#pagination',
create: '#create'
},
......@@ -1404,9 +1409,9 @@ window.W = window.W || {};
order: -1
},
// queryParams: {
// search: "Ménagerie"
// }
// queryParams: {
// search: "Ménagerie"
// }
});
var myListView = new W.ListView({
......
<!-- Title -->
<label>
<span class="label-text">Titre:</span>
<input type="text" name="title" value="<%= title %>">
<input type="text" name="title" value="<%- title %>">
</label>
<!-- description -->
<label>
<span class="label-text">Présentation: </span>
<textarea name="presentation"><%= presentation %></textarea>
<textarea name="presentation"><%- presentation %></textarea>
</label>
<!-- Setting -->
......@@ -19,24 +19,24 @@
<!-- Performance author -->
<label>
<span class="label-text">Auteur de la perfomance:</span>
<input type="text" name="performance_author" value="<%= performance_author %>" <%= (score_type === 2) ? 'disabled' : '' %>>
<input type="text" name="performance_author" value="<%- performance_author %>" <%- (score_type === 2) ? 'disabled' : '' %>>
</label>
<!-- Score author -->
<label>
<span class="label-text">Auteur de la partition:</span>
<input type="text" name="score_author" value="<%= score_author %>">
<input type="text" name="score_author" value="<%- score_author %>">
</label>
<!-- score_type = models.PositiveSmallIntegerField(default=1, choices=SCORE_TYPE_CHOICES) -->
<label>
<span class="label-text">Type:</span>
<select name="score_type">
<option value="1" <%= (score_type === 1) ? 'selected' : '' %>>Transcription</option>
<option value="2" <%= (score_type === 2) ? 'selected' : '' %>>Prescription</option>
<option value="3" <%= (score_type === 3) ? 'selected' : '' %>>Traduction</option>
<option value="1" <%- (score_type === 1) ? 'selected' : '' %>>Transcription</option>
<option value="2" <%- (score_type === 2) ? 'selected' : '' %>>Prescription</option>
<option value="3" <%- (score_type === 3) ? 'selected' : '' %>>Traduction</option>
</select>
<!-- <input type="text" name="score_type" value="<%= score_type %>"> -->
<!-- <input type="text" name="score_type" value="<%- score_type %>"> -->
</label>
<!-- effectif = models.CharField(blank=True, max_length=255) -->
......@@ -45,19 +45,19 @@
<!-- Duration -->
<label>
<span class="label-text">Durée:</span>
<input type="text" name="duration" value="<%= duration %>">
<input type="text" name="duration" value="<%- duration %>">
</label>
<!-- Tags -->
<label>
<span class="label-text">Tags: </span>
<input type="text" name="tags" value="<%= tags %>">
<input type="text" name="tags" value="<%- tags %>">
</label>
<!-- Language -->
<label>
<span class="label-text">Langue: </span>
<input type="text" name="language" value="<%= (language) ? language : getUserLanguage() %>">
<input type="text" name="language" value="<%- (language) ? language : getUserLanguage() %>">
</label>
<button data-name="close">Annuler</button>
......
Markdown is supported
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