branch develop updated (010bc96 -> 9839ff7)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git from 010bc96 Merge branch 'develop' of https://git.codelutin.com/coselmar into develop new d6e163c add completion on question.type, question.themes, document.type (plain and modal) and document.keywords(modal) new 7e7e5b0 review document creation page new 9839ff7 Merge branch 'feature/6166-add-suggestion-for-keywords' into develop The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 9839ff7afd7394587f5fa89fa7153612e7162beb Merge: 010bc96 7e7e5b0 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 15 18:16:16 2014 +0100 Merge branch 'feature/6166-add-suggestion-for-keywords' into develop commit 7e7e5b0f5621d68dfd68d324522481b4bdba6338 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 15 18:16:06 2014 +0100 review document creation page commit d6e163cbfee762f2796dbc1cb25ab4fe6d7b4e79 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 15 17:23:16 2014 +0100 add completion on question.type, question.themes, document.type (plain and modal) and document.keywords(modal) Summary of changes: .../persistence/entity/DocumentTopiaDao.java | 23 ++ .../coselmar/services/v1/DocumentsWebService.java | 14 ++ coselmar-rest/src/main/resources/mapping | 8 +- .../src/main/webapp/js/coselmar-controllers.js | 59 ++++- .../main/webapp/js/coselmar-questions-services.js | 19 +- .../src/main/webapp/js/coselmar-services.js | 21 +- .../webapp/views/documents/modalDocumentEdit.html | 77 ++++--- .../main/webapp/views/documents/newdocument.html | 249 ++++++++++++--------- .../main/webapp/views/questions/editquestion.html | 10 +- 9 files changed, 331 insertions(+), 149 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit d6e163cbfee762f2796dbc1cb25ab4fe6d7b4e79 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 15 17:23:16 2014 +0100 add completion on question.type, question.themes, document.type (plain and modal) and document.keywords(modal) --- .../persistence/entity/DocumentTopiaDao.java | 23 +++++++ .../coselmar/services/v1/DocumentsWebService.java | 14 ++++ coselmar-rest/src/main/resources/mapping | 8 ++- .../src/main/webapp/js/coselmar-controllers.js | 43 +++++++++++- .../main/webapp/js/coselmar-questions-services.js | 19 ++++-- .../src/main/webapp/js/coselmar-services.js | 21 ++++-- .../webapp/views/documents/modalDocumentEdit.html | 77 +++++++++++++++------- .../main/webapp/views/documents/newdocument.html | 5 +- .../main/webapp/views/questions/editquestion.html | 10 ++- 9 files changed, 178 insertions(+), 42 deletions(-) diff --git a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java index cfc4a60..ef773ee 100644 --- a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java @@ -72,4 +72,27 @@ public class DocumentTopiaDao extends AbstractDocumentTopiaDao<Document> { return documents; } + public List<String> findAllKeywords() { + + StringBuilder hqlBuilder = + new StringBuilder("SELECT DISTINCT(keywords)" + + " FROM " + Document.class.getName() + " D " + + " INNER JOIN D." + Document.PROPERTY_KEYWORDS + " keywords "); + + List<String> values = findAll(hqlBuilder.toString()); + + return values; + } + + public List<String> findAllTypes() { + + StringBuilder hqlBuilder = + new StringBuilder("SELECT DISTINCT(D. " + Document.PROPERTY_TYPE + ")" + + " FROM " + Document.class.getName() + " D "); + + List<String> values = findAll(hqlBuilder.toString()); + + return values; + } + } //DocumentTopiaDao diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java index b7cafe9..7bd42f7 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java @@ -289,6 +289,20 @@ public class DocumentsWebService extends CoselmarWebServiceSupport { commit(); } + public List<String> getKeywords() throws InvalidCredentialException, UnauthorizedException { + + List<String> themes = getDocumentDao().findAllKeywords(); + + return themes; + } + + public List<String> getTypes() throws InvalidCredentialException, UnauthorizedException { + + List<String> types = getDocumentDao().findAllTypes(); + + return types; + } + //////////////////////////////////////////////////////////////////////////// /////////////////////// Internal Parts ///////////////////////////// diff --git a/coselmar-rest/src/main/resources/mapping b/coselmar-rest/src/main/resources/mapping index a43119f..5c89620 100644 --- a/coselmar-rest/src/main/resources/mapping +++ b/coselmar-rest/src/main/resources/mapping @@ -14,10 +14,10 @@ default.render=fr.ifremer.coselmar.services.CoselmarRender [errors] -#fr.ifremer.coselmar.services.errors.InvalidCredentialException ErrorAction.on401 +#fr.ifremer.coselmar.services.errors.InvalidCredentialException ErrorAction.on401 #fr.ifremer.coselmar.services.errors.UnauthorizedException ErrorAction.on403 -#fr.ifremer.coselmar.services.CoselmarTechnicalException ErrorAction.on500 -#org.nuiton.topia.persistence.TopiaNoResultException ErrorAction.on404 +#fr.ifremer.coselmar.services.CoselmarTechnicalException ErrorAction.on500 +#org.nuiton.topia.persistence.TopiaNoResultException ErrorAction.on404 [actions] @@ -30,6 +30,8 @@ GET /v1/doc DocApi.showMapping # Documents Api GET /v1/documents DocumentsWebService.getDocuments +GET /v1/documents/keywords DocumentsWebService.getKeywords +GET /v1/documents/types DocumentsWebService.getTypes GET /v1/documents/{documentId} DocumentsWebService.getDocument GET /v1/documents/{documentId}/file DocumentsWebService.getDocumentFile POST /v1/documents DocumentsWebService.addDocument diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 9d03c2b..7a15b4c 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -99,6 +99,15 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'docum $scope.document = {'privacy': 'PUBLIC'}; $scope.upload = {}; + $scope.existing = {'types' : [], 'keywords' : []}; + + documentService.findAllTypes(function(results) { + $scope.existing.types = results; + }); + + documentService.findAllKeywords(function(results) { + $scope.existing.keywords = results; + }); $scope.createNewDocument = function(isValidForm){ @@ -329,6 +338,16 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam $scope.question = {'privacy' : 'PUBLIC', 'themes' : [], 'participants' : [], 'externalExperts' : [], 'clients' : [], 'relatedDocuments': [], 'newRelatedDocuments' : [] }; + $scope.existing = {'types' : [], 'themes' : []}; + + // Preload exiting types and themes + questionsService.findAllTypes(function(results) { + $scope.existing.types = results; + }); + + questionsService.findAllThemes(function(results) { + $scope.existing.themes = results; + }); //to enter in edit mode from view $scope.edit = function() { @@ -646,10 +665,30 @@ coselmarControllers.controller('ModalSearchDocumentsCtrl', function ($scope, $mo coselmarControllers.controller('ModalCreateDocumentsCtrl', function ($scope, $modalInstance, documentService) { - $scope.document = {'privacy': 'PUBLIC'}; + $scope.document = {'privacy': 'PUBLIC', 'keywords' : []}; $scope.upload = {}; + $scope.modalExisting = {'keywords' : [], 'types' : []}; - $scope.existingKeywords = []; + documentService.findAllKeywords(function(result) { + $scope.modalExisting.keywords = result; + }); + + documentService.findAllTypes(function(result) { + $scope.modalExisting.types = result; + }); + + $scope.addKeyword = function(keyword) { + if (keyword && $scope.document.keywords.indexOf(keyword) == -1) { + $scope.document.keywords.push(keyword); + } + } + + $scope.removeKeyword = function(keyword) { + var position = $scope.document.keywords.indexOf(keyword); + if (keyword && position != -1) { + $scope.document.keywords.splice(position, 1); + } + } $scope.create = function (isValidForm) { diff --git a/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js b/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js index 033de8f..db19e3f 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js @@ -64,17 +64,17 @@ function Question(resource, config){ this.getQuestions = function(successFunction, failFunction) { var questionResource = resource(baseURL); questionResource.query().$promise.then(successFunction, failFunction); - } + }; this.deleteQuestion = function(questionId, successFunction, failFunction) { var questionResource = resource(baseURL + "/" + questionId); questionResource.delete().$promise.then(successFunction, failFunction); - } + }; this.getQuestion = function(questionId, successFunction, failFunction) { var questionResource = resource(baseURL + "/" + questionId); questionResource.get().$promise.then(successFunction, failFunction); - } + }; this.addNewDocuments = function(questionId, documents, successFunction, failFunction) { @@ -93,5 +93,16 @@ function Question(resource, config){ } }); questionResource.save(null, formData, successFunction, failFunction); - } + }; + + this.findAllTypes = function(successFunction){ + var questionResource = resource(baseURL + '/types'); + questionResource.query(successFunction); + }; + + this.findAllThemes = function(successFunction){ + var questionResource = resource(baseURL + '/themes'); + questionResource.query(successFunction); + }; + }; \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/js/coselmar-services.js b/coselmar-ui/src/main/webapp/js/coselmar-services.js index 709b9e9..55a30fb 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-services.js @@ -52,7 +52,7 @@ function Document(resource, config){ } }); docResource.upload(null, formData, successFunction, failFunction); - } + }; this.getDocument = function(id, scope){ // Load the document @@ -61,14 +61,14 @@ function Document(resource, config){ console.log(document); scope.document = document; }); - } + }; this.deleteDocument = function(id, scope, successFunction){ // Load the document var docResource = resource(baseURL + '/:documentId', {documentId:'@id'}); docResource.delete({documentId:id}, successFunction); - } + }; this.getDocumentFile = function(id, scope){ // Load the document @@ -76,7 +76,7 @@ function Document(resource, config){ docResource.get({documentId:id}, function(file){ // redirect to document page ? }); - } + }; this.getDocuments = function(scope){ // Load all documents @@ -92,5 +92,16 @@ function Document(resource, config){ console.log("WTF ?!?"); } }); - } + }; + + this.findAllTypes = function(successFunction){ + var docResource = resource(baseURL + '/types'); + docResource.query(successFunction); + }; + + this.findAllKeywords = function(successFunction){ + var docResource = resource(baseURL + '/keywords'); + docResource.query(successFunction); + }; + }; \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html b/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html index 7db4b43..478cdcc 100644 --- a/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html +++ b/coselmar-ui/src/main/webapp/views/documents/modalDocumentEdit.html @@ -55,11 +55,14 @@ <div class="col-md-4"> <input type="text" class="form-control" name="type" - ng-model="document.type" required/> + data-ng-model="document.type" list="modalExistingTypes" required/> <p ng-show="documentForm.type.$invalid && !documentForm.type.$pristine" class="help-block">Document type is required.</p> </div> + <datalist id="modalExistingTypes"> + <option data-ng-repeat="type in modalExisting.types" value="{{type}}"> + </datalist> </div> </div> <!-- End Line with name and Type --> @@ -94,45 +97,49 @@ <!-- End Line with file and externalURL --> - <!-- Line with keywords and privacy --> + <!-- Line with keywords --> <div class="form-group"> - <div - ng-class="{'has-error' : documentForm.keywords.$invalid && !documentForm.keywords.$pristine}"> + <div ng-class="{'has-error' : documentForm.keywords.$invalid && + !documentForm.keywords.$pristine}"> + <label class="col-md-2 control-label">keywords *</label> - <div class="col-md-4"> + <div class="col-md-2"> <input type="text" class="form-control" name="keywords" - ng-model="document.keywords" ng-list required - placeholder="keyword 1, keyword2"/> + data-ng-model="modalToAddKeyword" list="modalExistingKeywords"/> - <p ng-show="documentForm.keywords.$invalid && !documentForm.keywords.$pristine" + <p ng-show="document.keywords.length < 1 && !documentForm.keywords.$pristine" class="help-block">At least one keyword is required.</p> </div> + <datalist id="modalExistingKeywords"> + <option data-ng-repeat="keyword in modalExisting.keywords" value="{{keyword}}"> + </datalist> </div> - <div class=""> - <label class="col-md-2 control-label">Privacy</label> + <div class="col-md-1"> + <button class="btn btn-primary" value="add" + ng-click="addKeyword(modalToAddKeyword); modalToAddKeyword=''">add</button> + </div> - <div class="col-md-4"> - <select class="form-control" name="privacy" - ng-model="document.privacy"> - <option value="PRIVATE">Private</option> - <option value="PUBLIC">Public</option> - <option value="RESTRICTED">Restricted to current Question</option> - </select> - </div> + <div class="col-md-7"> + <span ng-repeat="keyword in document.keywords" class="" aria-hidden="true"> + {{keyword}} + <button type="button" class="close" title="remove" ng-click="removeKeyword(keyword);"> + × + </button> + </span> </div> </div> - <!-- End Line with keywords and privacy --> + <!-- End Line with keywords --> - <!-- Line with publication Date, Authors and Language --> + <!-- Line with Publication Date and privacy --> <div class="form-group"> <div class=""> <label class="col-md-2 control-label">Publication date</label> - <div class="col-md-2"> + <div class="col-md-4"> <div class="input-group"> <input type="text" class="form-control" name="publicationDate" ng-model="document.publicationDate" @@ -145,11 +152,31 @@ </div> </div> + <div class=""> + <label class="col-md-2 control-label">Privacy</label> + + <div class="col-md-4"> + <select class="form-control" name="privacy" + ng-model="document.privacy"> + <option value="PRIVATE">Private</option> + <option value="PUBLIC">Public</option> + <option value="RESTRICTED">Restricted to current Question</option> + </select> + + </div> + + </div> + </div> + <!-- End Line with publication Date and privacy --> + + <!-- Line with Authors and Language --> + <div class="form-group"> + <div class="" ng-class="{'has-error' : documentForm.authors.$invalid && !documentForm.authors.$pristine}"> - <label class="col-md-1 control-label">Authors *</label> + <label class="col-md-2 control-label">Authors *</label> - <div class="col-md-4"> + <div class="col-md-5"> <input type="text" class="form-control" name="authors" ng-model="document.authors" required/> @@ -159,9 +186,9 @@ </div> <div class=""> - <label class="col-md-1 control-label">Language</label> + <label class="col-md-2 control-label">Language</label> - <div class="col-md-2"> + <div class="col-md-3"> <input type="text" class="form-control" name="language" ng-model="document.language"/> </div> diff --git a/coselmar-ui/src/main/webapp/views/documents/newdocument.html b/coselmar-ui/src/main/webapp/views/documents/newdocument.html index 39a4f0d..3996a14 100644 --- a/coselmar-ui/src/main/webapp/views/documents/newdocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/newdocument.html @@ -64,11 +64,14 @@ <div class="col-md-5"> <input type="text" class="form-control" name="type" - ng-model="document.type" required/> + data-ng-model="document.type" list="existingTypes" required/> <p ng-show="documentForm.type.$invalid && !documentForm.type.$pristine" class="help-block">Document type is required.</p> </div> + <datalist id="existingTypes"> + <option data-ng-repeat="type in existing.types" value="{{type}}"> + </datalist> </div> <div class="form-group"> diff --git a/coselmar-ui/src/main/webapp/views/questions/editquestion.html b/coselmar-ui/src/main/webapp/views/questions/editquestion.html index e46b0fe..1ea349b 100644 --- a/coselmar-ui/src/main/webapp/views/questions/editquestion.html +++ b/coselmar-ui/src/main/webapp/views/questions/editquestion.html @@ -45,9 +45,12 @@ <div class="col-md-2 "> <input type="text" class="form-control" name="type" - ng-model="question.type" required/> + data-ng-model="question.type" list="existingTypes" required/> <p ng-show="questionForm.type.$invalid && !questionForm.type.$pristine" class="help-block">Type is required.</p> </div> + <datalist id="existingTypes"> + <option data-ng-repeat="type in existing.types" value="{{type}}"> + </datalist> </div> @@ -106,11 +109,14 @@ <div class="col-md-2"> <input type="text" class="form-control" name="themes" - ng-model="toAddTheme"/> + data-ng-model="toAddTheme" list="existingThemes" /> <p ng-show="question.themes.length < 1 && !questionForm.themes.$pristine" class="help-block">At least one theme is required.</p> </div> + <datalist id="existingThemes"> + <option data-ng-repeat="theme in existing.themes" value="{{theme}}"> + </datalist> <div class="col-md-1"> <button class="btn btn-primary" value="add" ng-click="addTheme(toAddTheme); toAddTheme=''">add</button> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 7e7e5b0f5621d68dfd68d324522481b4bdba6338 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 15 18:16:06 2014 +0100 review document creation page --- .../src/main/webapp/js/coselmar-controllers.js | 16 +- .../main/webapp/views/documents/newdocument.html | 252 ++++++++++++--------- 2 files changed, 157 insertions(+), 111 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 7a15b4c..4b5cece 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -97,7 +97,7 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara // Controller for new document View coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'documentService', function($scope, $location, documentService){ - $scope.document = {'privacy': 'PUBLIC'}; + $scope.document = {'privacy': 'PUBLIC', 'keywords': []}; $scope.upload = {}; $scope.existing = {'types' : [], 'keywords' : []}; @@ -129,6 +129,20 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'docum } }; + + $scope.addKeyword = function(keyword) { + if (keyword && $scope.document.keywords.indexOf(keyword) == -1) { + $scope.document.keywords.push(keyword); + } + } + + $scope.removeKeyword = function(keyword) { + var position = $scope.document.keywords.indexOf(keyword); + if (keyword && position != -1) { + $scope.document.keywords.splice(position, 1); + } + } + }]); // Controller for single document View diff --git a/coselmar-ui/src/main/webapp/views/documents/newdocument.html b/coselmar-ui/src/main/webapp/views/documents/newdocument.html index 3996a14..8b42df5 100644 --- a/coselmar-ui/src/main/webapp/views/documents/newdocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/newdocument.html @@ -45,162 +45,193 @@ <form class="form-horizontal" name="documentForm" role="form" ng-submit="createNewDocument(documentForm.$valid)"> - <div class="form-group" - ng-class="{'has-error' : documentForm.name.$invalid && !documentForm.name.$pristine}"> - <label class="col-md-4 control-label">Name *</label> - - <div class="col-md-5"> - <input type="text" class="form-control" name="name" - ng-model="document.name" required/> - - <p ng-show="documentForm.name.$invalid && !documentForm.name.$pristine" - class="help-block">Document name is required.</p> + <!-- Line with Title, type and privacy --> + <div class="form-group row"> + <div class="" + ng-class="{'has-error' : documentForm.name.$invalid && !documentForm.name.$pristine}"> + <label class="col-md-2 control-label">Name *</label> + + <div class="col-md-4"> + <input type="text" class="form-control" name="name" + ng-model="document.name" required/> + + <p ng-show="documentForm.name.$invalid && !documentForm.name.$pristine" + class="help-block">Document name is required.</p> + </div> </div> - </div> - <div class="form-group" - ng-class="{'has-error' : documentForm.type.$invalid && !documentForm.type.$pristine}"> - <label class="col-md-4 control-label">Type *</label> + <div class="" + ng-class="{'has-error' : documentForm.type.$invalid && !documentForm.type.$pristine}"> + <label class="col-md-1 control-label">Type *</label> - <div class="col-md-5"> - <input type="text" class="form-control" name="type" - data-ng-model="document.type" list="existingTypes" required/> + <div class="col-md-2"> + <input type="text" class="form-control" name="type" + data-ng-model="document.type" list="existingTypes" required/> - <p ng-show="documentForm.type.$invalid && !documentForm.type.$pristine" - class="help-block">Document type is required.</p> + <p ng-show="documentForm.type.$invalid && !documentForm.type.$pristine" + class="help-block">Document type is required.</p> + </div> + <datalist id="existingTypes"> + <option data-ng-repeat="type in existing.types" value="{{type}}"> + </datalist> </div> - <datalist id="existingTypes"> - <option data-ng-repeat="type in existing.types" value="{{type}}"> - </datalist> - </div> - <div class="form-group"> - <label class="col-md-4 control-label">Attach File ?</label> + <div> - <div class="col-md-5"> - <input type="checkbox" ng-model="document.withFile" - ng-init="document.withFile = false"/> - </div> - </div> + <label class="col-md-1 control-label">Privacy</label> - <div class="form-group" ng-if="document.withFile"> - <label class="col-md-4 control-label">File</label> + <div class="col-md-2"> + <select class="form-control" name="privacy" + ng-model="document.privacy"> + <option value="PRIVATE">private</option> + <option value="PUBLIC">public</option> + <option value="RESTRICTED">restricted</option> + </select> - <div class="col-md-5"> - <input type="file" class="form-control" name="uploadFile" - ng-file-model="upload.file" required/> + <div ng-if="document.privacy == 'RESTRICTED'"> + Not Yet available + </div> + </div> </div> </div> - <div class="form-group" ng-if="!document.withFile" - ng-class="{'has-error' : documentForm.externalUrl.$invalid && !documentForm.externalUrl.$pristine}"> - <label class="col-md-4 control-label">External URL</label> + <!-- Line with Data : file or External URL --> + <div class="form-group" + ng-class="{'has-error' : documentForm.externalUrl.$invalid + && !documentForm.externalUrl.$pristine && !upload.file}"> - <div class="col-md-5"> - <input type="input" class="form-control" name="externalUrl" - ng-model="document.externalUrl" required/> + <div> + <label class="col-md-2 control-label">File</label> - <p ng-show="documentForm.externalUrl.$invalid && !documentForm.externalUrl.$pristine" - class="help-block">External URL is required if chosen.</p> + <div class="col-md-4"> + <input type="file" class="form-control" name="uploadFile" + ng-file-model="upload.file"/> + </div> </div> - </div> - <div class="form-group" - ng-class="{'has-error' : documentForm.keywords.$invalid && !documentForm.keywords.$pristine}"> - <label class="col-md-4 control-label">keywords *</label> + <div> + <label class="col-md-2 control-label">External URL</label> - <div class="col-md-5"> - <input type="text" class="form-control" name="keywords" - ng-model="document.keywords" ng-list required - placeholder="keyword 1, keyword2"/> + <div class="col-md-4"> + <input type="input" class="form-control" name="externalUrl" + ng-model="document.externalUrl" /> - <p ng-show="documentForm.keywords.$invalid && !documentForm.keywords.$pristine" - class="help-block">At least one keyword is required.</p> + </div> </div> + <p ng-show="!document.externalUrl && !file.upload" + class="help-block text-center">A File or an external URL is + required.</p> </div> + <!-- Line with Keywords --> <div class="form-group"> - <label class="col-md-4 control-label">Privacy</label> - - <div class="col-md-5"> - <select class="form-control" name="privacy" - ng-model="document.privacy"> - <option value="PRIVATE">private</option> - <option value="PUBLIC">public</option> - <option value="RESTRICTED">restricted</option> - </select> - - <div ng-if="privacy == 'RESTRICTED'"> - Not Yet available + <div ng-class="{'has-error' : documentForm.keywords.$invalid + && !documentForm.keywords.$pristine}"> + + <label class="col-md-2 control-label">keywords *</label> + + <div class="col-md-2"> + <input type="text" class="form-control" name="keywords" + ng-model="toAddKeyword" list="existingKeywords" /> + + <p ng-show="document.keywords.length < 1 && !documentForm.keywords.$pristine" + class="help-block">At least one keyword is required.</p> </div> + <datalist id="existingKeywords"> + <option data-ng-repeat="keyword in existing.keywords" value="{{keyword}}"> + </datalist> </div> - </div> + <div class="col-md-1"> + <button class="btn btn-primary" value="add" + ng-click="addKeyword(toAddKeyword); toAddKeyword=''">add</button> + </div> + + + <div class="col-md-7"> + <span ng-repeat="keyword in document.keywords" class="" aria-hidden="true"> + {{keyword}} + <button type="button" class="close" title="remove" ng-click="removeKeyword(keyword);"> + × + </button> + </span> - <div class="form-group"> - <label class="col-md-4 control-label">Publication date</label> - - <div class="col-md-5"> - <div class="input-group"> - <input type="text" class="form-control" name="publicationDate" - ng-model="document.publicationDate" - datepicker-popup="dd/MM/yyyy" is-open="publicationDateOpened" - ng-click="publicationDateOpened = true"/> - <span class="input-group-addon"><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span></span> - </div> </div> </div> - <div class="form-group" - ng-class="{'has-error' : documentForm.authors.$invalid && !documentForm.authors.$pristine}"> - <label class="col-md-4 control-label">Authors *</label> + <!-- Line with Authors and copyright--> + <div class="form-group"> + <div ng-class="{'has-error' : documentForm.authors.$invalid + && !documentForm.authors.$pristine}"> + <label class="col-md-2 control-label">Authors *</label> - <div class="col-md-5"> - <input type="text" class="form-control" name="authors" - ng-model="document.authors" required/> + <div class="col-md-4"> + <input type="text" class="form-control" name="authors" + ng-model="document.authors" required/> - <p ng-show="documentForm.authors.$invalid && !documentForm.authors.$pristine" - class="help-block">Document authors is required.</p> + <p ng-show="documentForm.authors.$invalid && !documentForm.authors.$pristine" + class="help-block">Document authors is required.</p> + </div> </div> - </div> - <div class="form-group" - ng-class="{'has-error' : documentForm.copyright.$invalid && !documentForm.copyright.$pristine}"> - <label class="col-md-4 control-label">Copyright *</label> + <div ng-class="{'has-error' : documentForm.copyright.$invalid + && !documentForm.copyright.$pristine}"> - <div class="col-md-5"> - <input type="text" class="form-control" name="copyright" - ng-model="document.copyright" required/> + <label class="col-md-2 control-label">Copyright *</label> - <p ng-show="documentForm.copyright.$invalid && !documentForm.copyright.$pristine" - class="help-block">Copyright is required.</p> + <div class="col-md-4"> + <input type="text" class="form-control" name="copyright" + ng-model="document.copyright" required/> + + <p ng-show="documentForm.copyright.$invalid && !documentForm.copyright.$pristine" + class="help-block">Copyright is required.</p> + </div> </div> </div> + <!-- Line with License, publication date and language --> <div class="form-group"> - <label class="col-md-4 control-label">Licence</label> + <div > + <label class="col-md-2 control-label">Licence</label> - <div class="col-md-5"> - <input type="text" class="form-control" name="licence" - ng-model="document.licence"/> + <div class="col-md-4"> + <input type="text" class="form-control" name="licence" + ng-model="document.licence"/> + </div> </div> - </div> - <div class="form-group"> - <label class="col-md-4 control-label">Language</label> + <div> + <label class="col-md-1 control-label">Language</label> + + <div class="col-md-1"> + <input type="text" class="form-control" name="language" + ng-model="document.language"/> + </div> + </div> + + <div> + <label class="col-md-2 control-label">Publication date</label> + + <div class="col-md-2"> + <div class="input-group"> + <input type="text" class="form-control" name="publicationDate" + ng-model="document.publicationDate" + datepicker-popup="dd/MM/yyyy" is-open="publicationDateOpened" + ng-click="publicationDateOpened = true"/> + <span class="input-group-addon"><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span></span> + </div> + </div> - <div class="col-md-5"> - <input type="text" class="form-control" name="language" - ng-model="document.language"/> </div> </div> + <!-- Summary --> <div class="form-group" ng-class="{'has-error' : documentForm.summary.$invalid && !documentForm.summary.$pristine}"> - <label class="col-md-4 control-label">Summary *</label> + <label class="col-md-2 control-label">Summary *</label> - <div class="col-md-5"> - <textarea type="text" class="form-control" name="summary" + <div class="col-md-10"> + <textarea type="text" class="form-control" name="summary" rows="5" ng-model="document.summary" required/> <p ng-show="documentForm.summary.$invalid && !documentForm.summary.$pristine" @@ -208,11 +239,12 @@ </div> </div> + <!-- Comment --> <div class="form-group" > - <label class="col-md-4 control-label">Comment</label> + <label class="col-md-2 control-label">Comment</label> - <div class="col-md-5"> - <textarea type="text" class="form-control" name="comment" + <div class="col-md-10"> + <textarea type="text" class="form-control" name="comment" rows="5" ng-model="document.comment" /> </div> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 9839ff7afd7394587f5fa89fa7153612e7162beb Merge: 010bc96 7e7e5b0 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 15 18:16:16 2014 +0100 Merge branch 'feature/6166-add-suggestion-for-keywords' into develop .../persistence/entity/DocumentTopiaDao.java | 23 ++ .../coselmar/services/v1/DocumentsWebService.java | 14 ++ coselmar-rest/src/main/resources/mapping | 8 +- .../src/main/webapp/js/coselmar-controllers.js | 59 ++++- .../main/webapp/js/coselmar-questions-services.js | 19 +- .../src/main/webapp/js/coselmar-services.js | 21 +- .../webapp/views/documents/modalDocumentEdit.html | 77 ++++--- .../main/webapp/views/documents/newdocument.html | 249 ++++++++++++--------- .../main/webapp/views/questions/editquestion.html | 10 +- 9 files changed, 331 insertions(+), 149 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm