From f342a07588d6efd508b3210beb8198068209e619 Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Thu, 1 Sep 2016 17:42:13 +0200 Subject: upload: add datepicker diff --git a/www/index.html b/www/index.html index 933c72f..cde478f 100644 --- a/www/index.html +++ b/www/index.html @@ -9,6 +9,7 @@ + @@ -75,30 +76,59 @@ @@ -457,6 +487,7 @@ + diff --git a/www/js/importer.js b/www/js/importer.js index 3776aad..d43c4b2 100644 --- a/www/js/importer.js +++ b/www/js/importer.js @@ -105,7 +105,7 @@ Rdxport.Importer.prototype.checkListWebSocket = function() { if(!this.listWebSocket || this.listWebSocket.readyState == 3) { this.initListWebSocket(); } -} +}; Rdxport.Importer.prototype.syncUploads = function(route, groupView, done) { var sessions = this.sessions.filter(function(session) { @@ -132,17 +132,49 @@ Rdxport.Importer.prototype.syncUploads = function(route, groupView, done) { }; Rdxport.Importer.prototype.resetModal = function() { - $('div.modal-header h4', this.$el).text("Datei auswählen..."); $('.modal-body .drop', this.$el).css("background-image", "url('/img/dz-backdrop.png')"); $('.modal-body .drop form input[type="file"]', this.$el).val(''); $('.modal-body #sourceUri', this.$el).val(''); $('#uploadModal-confirm', this.$el).attr('disabled','disabled').off('click'); $('form input[type="file"]', this.$el).removeAttr('multiple'); $('form ul', self.$el).empty(); + + // tab menu + $('.nav-tabs li', this.$el).removeClass('active'); + $('.nav-tabs li:first', this.$el).addClass('active'); + $('.upload-tabs > div', self.$el).hide(); + $('.upload-tabs div:first', self.$el).show(); }; Rdxport.Importer.prototype.openModal = function(group, groupView, cartNumber, useMetadata, multifiles) { this.resetModal(); + + var $datepicker = $('.datepicker', this.$el).datepicker({ + format: "dd.mm.yyyy", + language: "de", + startDate: '01/01/2014', + endDate: new Date() + }); + var $spinner = $('.spinner', this.$el); + + // tab menu + var self = this; + $('.nav-tabs li a', this.$el).off().on('click', function(event) { + event.preventDefault(); + $('.nav-tabs li', self.$el).removeClass('active'); + $(this).parent().addClass('active'); + var tabName = $(this).data('tab-name'); + $('.upload-tabs > div', self.$el).hide(); + $('.upload-tabs .tab-' + tabName, self.$el).show(); + $('#uploadModal-confirm', this.$el).attr('disabled','disabled').off('click'); + if (tabName === 'archive') { + /*$('#uploadModal-confirm', this.$el).removeAttr('disabled').on('click', function() { + var date = $datepicker.datepicker('getDate') + + });*/ + } + }); + var $drop = $('.modal-body .drop', this.$el); var $form = $('form', $drop); var $fileInput = $('input[type="file"]', $form); @@ -182,13 +214,11 @@ Rdxport.Importer.prototype.openModal = function(group, groupView, cartNumber, us }*/ if (multifiles && files.length > 1) { - $('div.modal-header h4', self.$el).text(files.length + ' files.'); var $formUl = $('form ul', self.$el).empty(); $.each(files, function(index, file) { //$formUl.append($('
  • ').text(file.name)); }); } else { - $('div.modal-header h4', self.$el).text(files[0].name); $('form ul', self.$el).empty(); } $('div.modal-body .drop', self.$el).css("background-image", "url('/img/audio_file.png')"); diff --git a/www/js/musicgrid.js b/www/js/musicgrid.js index a0a0c10..80b8735 100644 --- a/www/js/musicgrid.js +++ b/www/js/musicgrid.js @@ -102,7 +102,6 @@ Rdxport.MusicpoolModal = function(model) { Rdxport.MusicpoolModal.prototype.selectClock = function(dow, hour, clockName) { $('#musicpoolModal').modal({keyboard: true}); - var $modalHeader = $('#musicpoolModal .modal-header'); var $modalBody = $('#musicpoolModal .modal-body'); $('h4', $modalHeader).text('Musikpool auswählen für Tag: ' + dow + ' Stunde: ' + hour + '.'); diff --git a/www/js/shows.js b/www/js/shows.js index 8e1d17e..d58aa66 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -386,7 +386,7 @@ Rdxport.ShowCartView.renderUploading = function(upload) { }; Rdxport.ShowCartView.renderEmpty = function(group, groupView, cartNumber) { - var $uploadButton = $(''); + var $uploadButton = $(''); $uploadButton.off('click').on('click', function() { importer.openModal(group, groupView, cartNumber, true, false); diff --git a/www/styles/main-style.css b/www/styles/main-style.css index af38c79..c01e238 100644 --- a/www/styles/main-style.css +++ b/www/styles/main-style.css @@ -88,20 +88,44 @@ body { font-size: 1.8em; } +#uploadModal div.modal-header { + border-bottom: none; + padding: 15px 0; +} + +#uploadModal div.modal-header .nav-tabs > li:first-child { + margin-left: 10px; +} + +#uploadModal div.modal-header .close { + margin-right: 15px; +} + #uploadModal div.modal-body { text-align: center; } +#uploadModal div.modal-body .upload-tabs .tab-archive, +#uploadModal div.modal-body .upload-tabs .tab-external { + display: none; +} + #uploadModal div.modal-body .drop { padding-left: 0; padding-right: 0; - width: 100%; + margin: 0 auto; + width: 250px; height: 250px; + cursor: pointer; background-image: url('../img/dz-backdrop.png'); background-repeat: no-repeat; background-position: center center; } +#uploadModal div.modal-body .datepicker { + margin: 0 auto; +} + #uploadModal div.modal-body .drop form input { display: none; } -- cgit v0.10.2