-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #185: Migliorie nell`implementazione delle FAQ (testo diviso in…
… domanda e risposta)
- Loading branch information
Showing
20 changed files
with
648 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"fluentMethods": true, | ||
"relationships": [], | ||
"fields": [ | ||
{ | ||
"fieldName": "domanda", | ||
"fieldType": "String", | ||
"fieldValidateRules": [ | ||
"required" | ||
] | ||
}, | ||
{ | ||
"fieldName": "risposta", | ||
"fieldType": "String", | ||
"fieldValidateRules": [ | ||
"required" | ||
] | ||
}, | ||
{ | ||
"fieldName": "isReadable", | ||
"fieldType": "Boolean", | ||
"fieldValidateRules": [ | ||
"required" | ||
] | ||
} | ||
], | ||
"changelogDate": "20190723085228", | ||
"dto": "no", | ||
"service": "no", | ||
"entityTableName": "faq", | ||
"pagination": "no" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
id;testo;is_readable | ||
id;domanda;risposta;is_readable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
id;testo;is_readable | ||
1;Prova FAQ 1;TRUE | ||
2;Prova FAQ 2;TRUE | ||
3;Prova FAQ non leggibile;FALSE | ||
id;domanda;risposta;is_readable | ||
1;Domanda 1?;Risposta 1;TRUE | ||
2;Domanda 2?;Risposta 2;TRUE | ||
3;Domanda 3?;Risposta 3;FALSE |
28 changes: 28 additions & 0 deletions
28
src/main/webapp/app/entities/faq/faq-delete-dialog.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular | ||
.module('sprintApp') | ||
.controller('FaqDeleteController',FaqDeleteController); | ||
|
||
FaqDeleteController.$inject = ['$uibModalInstance', 'entity', 'Faq']; | ||
|
||
function FaqDeleteController($uibModalInstance, entity, Faq) { | ||
var vm = this; | ||
|
||
vm.faq = entity; | ||
vm.clear = clear; | ||
vm.confirmDelete = confirmDelete; | ||
|
||
function clear () { | ||
$uibModalInstance.dismiss('cancel'); | ||
} | ||
|
||
function confirmDelete (id) { | ||
Faq.delete({id: id}, | ||
function () { | ||
$uibModalInstance.close(true); | ||
}); | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<form name="deleteForm" ng-submit="vm.confirmDelete(vm.faq.id)"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" | ||
ng-click="vm.clear()">×</button> | ||
<h4 class="modal-title" translate="entity.delete.title">Confirm delete operation</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<jhi-alert-error></jhi-alert-error> | ||
<p translate="sprintApp.faq.delete.question" translate-values="{id: '{{vm.faq.id}}'}">Are you sure you want to delete this Faq?</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()"> | ||
<span class="glyphicon glyphicon-ban-circle"></span> <span translate="entity.action.cancel">Cancel</span> | ||
</button> | ||
<button type="submit" ng-disabled="deleteForm.$invalid" class="btn btn-danger"> | ||
<span class="glyphicon glyphicon-remove-circle"></span> <span translate="entity.action.delete">Delete</span> | ||
</button> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular | ||
.module('sprintApp') | ||
.controller('FaqDetailController', FaqDetailController); | ||
|
||
FaqDetailController.$inject = ['$scope', '$rootScope', '$stateParams', 'previousState', 'entity', 'Faq']; | ||
|
||
function FaqDetailController($scope, $rootScope, $stateParams, previousState, entity, Faq) { | ||
var vm = this; | ||
|
||
vm.faq = entity; | ||
vm.previousState = previousState.name; | ||
|
||
var unsubscribe = $rootScope.$on('sprintApp:faqUpdate', function(event, result) { | ||
vm.faq = result; | ||
}); | ||
$scope.$on('$destroy', unsubscribe); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
<div> | ||
<h2><span translate="sprintApp.faq.detail.title">Faq</span> {{vm.faq.id}}</h2> | ||
<hr> | ||
<jhi-alert-error></jhi-alert-error> | ||
<dl class="dl-horizontal jh-entity-details"> | ||
<dt><span translate="sprintApp.faq.domanda">Domanda</span></dt> | ||
<dd> | ||
<span>{{vm.faq.domanda}}</span> | ||
</dd> | ||
<dt><span translate="sprintApp.faq.risposta">Risposta</span></dt> | ||
<dd> | ||
<span>{{vm.faq.risposta}}</span> | ||
</dd> | ||
<dt><span translate="sprintApp.faq.isReadable">Is Readable</span></dt> | ||
<dd> | ||
<span>{{vm.faq.isReadable}}</span> | ||
</dd> | ||
</dl> | ||
|
||
<button type="submit" | ||
ui-sref="{{ vm.previousState }}" | ||
class="btn btn-info"> | ||
<span class="glyphicon glyphicon-arrow-left"></span> <span translate="entity.action.back"> Back</span> | ||
</button> | ||
|
||
<button type="button" ui-sref="faq-detail.edit({id:vm.faq.id})" class="btn btn-primary"> | ||
<span class="glyphicon glyphicon-pencil"></span> | ||
<span class="hidden-xs hidden-sm" translate="entity.action.edit"> Edit</span> | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular | ||
.module('sprintApp') | ||
.controller('FaqDialogController', FaqDialogController); | ||
|
||
FaqDialogController.$inject = ['$timeout', '$scope', '$stateParams', '$uibModalInstance', 'entity', 'Faq']; | ||
|
||
function FaqDialogController ($timeout, $scope, $stateParams, $uibModalInstance, entity, Faq) { | ||
var vm = this; | ||
|
||
vm.faq = entity; | ||
vm.clear = clear; | ||
vm.save = save; | ||
|
||
$timeout(function (){ | ||
angular.element('.form-group:eq(1)>input').focus(); | ||
}); | ||
|
||
function clear () { | ||
$uibModalInstance.dismiss('cancel'); | ||
} | ||
|
||
function save () { | ||
vm.isSaving = true; | ||
if (vm.faq.id !== null) { | ||
Faq.update(vm.faq, onSaveSuccess, onSaveError); | ||
} else { | ||
Faq.save(vm.faq, onSaveSuccess, onSaveError); | ||
} | ||
} | ||
|
||
function onSaveSuccess (result) { | ||
$scope.$emit('sprintApp:faqUpdate', result); | ||
$uibModalInstance.close(result); | ||
vm.isSaving = false; | ||
} | ||
|
||
function onSaveError () { | ||
vm.isSaving = false; | ||
} | ||
|
||
|
||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
<form name="editForm" role="form" novalidate ng-submit="vm.save()" show-validation> | ||
|
||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" | ||
ng-click="vm.clear()">×</button> | ||
<h4 class="modal-title" id="myFaqLabel" translate="sprintApp.faq.home.createOrEditLabel">Create or edit a Faq</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<jhi-alert-error></jhi-alert-error> | ||
<div class="form-group" ng-show="vm.faq.id"> | ||
<label for="id" translate="global.field.id">ID</label> | ||
<input type="text" class="form-control" id="id" name="id" | ||
ng-model="vm.faq.id" readonly /> | ||
</div> | ||
<div class="form-group"> | ||
<label class="control-label" translate="sprintApp.faq.domanda" for="field_domanda">Domanda</label> | ||
<input type="text" class="form-control" name="domanda" id="field_domanda" | ||
ng-model="vm.faq.domanda" | ||
required /> | ||
<div ng-show="editForm.domanda.$invalid"> | ||
<p class="help-block" | ||
ng-show="editForm.domanda.$error.required" translate="entity.validation.required"> | ||
This field is required. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="control-label" translate="sprintApp.faq.risposta" for="field_risposta">Risposta</label> | ||
<input type="text" class="form-control" name="risposta" id="field_risposta" | ||
ng-model="vm.faq.risposta" | ||
required /> | ||
<div ng-show="editForm.risposta.$invalid"> | ||
<p class="help-block" | ||
ng-show="editForm.risposta.$error.required" translate="entity.validation.required"> | ||
This field is required. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="control-label" translate="sprintApp.faq.isReadable" for="field_isReadable">Is Readable</label> | ||
<input type="checkbox" class="form-control" name="isReadable" id="field_isReadable" | ||
ng-model="vm.faq.isReadable" | ||
/> | ||
<div ng-show="editForm.isReadable.$invalid"> | ||
<p class="help-block" | ||
ng-show="editForm.isReadable.$error.required" translate="entity.validation.required"> | ||
This field is required. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()"> | ||
<span class="glyphicon glyphicon-ban-circle"></span> <span translate="entity.action.cancel">Cancel</span> | ||
</button> | ||
<button type="submit" ng-disabled="editForm.$invalid || vm.isSaving" class="btn btn-primary"> | ||
<span class="glyphicon glyphicon-save"></span> <span translate="entity.action.save">Save</span> | ||
</button> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular | ||
.module('sprintApp') | ||
.controller('FaqController', FaqController); | ||
|
||
FaqController.$inject = ['$scope', '$state', 'Faq']; | ||
|
||
function FaqController ($scope, $state, Faq) { | ||
var vm = this; | ||
|
||
vm.faqs = []; | ||
|
||
loadAll(); | ||
|
||
function loadAll() { | ||
Faq.query(function(result) { | ||
vm.faqs = result; | ||
}); | ||
} | ||
} | ||
})(); |
Oops, something went wrong.