aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/moon_gui/static/app/model/action
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4/moon_gui/static/app/model/action')
-rwxr-xr-xmoonv4/moon_gui/static/app/model/action/model-add.tpl.html66
-rwxr-xr-xmoonv4/moon_gui/static/app/model/action/model-delete.tpl.html39
-rwxr-xr-xmoonv4/moon_gui/static/app/model/action/model-view.tpl.html41
-rwxr-xr-xmoonv4/moon_gui/static/app/model/action/model.controller.add.js71
-rwxr-xr-xmoonv4/moon_gui/static/app/model/action/model.controller.delete.js72
-rwxr-xr-xmoonv4/moon_gui/static/app/model/action/model.controller.view.js53
6 files changed, 0 insertions, 342 deletions
diff --git a/moonv4/moon_gui/static/app/model/action/model-add.tpl.html b/moonv4/moon_gui/static/app/model/action/model-add.tpl.html
deleted file mode 100755
index dee53a97..00000000
--- a/moonv4/moon_gui/static/app/model/action/model-add.tpl.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<div ng-controller="ModelAddController as add" class="modal" tabindex="-1" data-role="modalAddModel">
-
- <div class="modal-dialog">
-
- <div class="modal-content">
-
- <div class="modal-header">
- <button type="button" class="close" ng-click="$hide()">&times;</button>
- <h4 class="modal-title" data-translate="moon.model.add.title"></h4>
- </div>
-
- <div class="modal-body">
-
- <form class="form-horizontal" role="form" name="add.form">
-
- <div class="form-group" ng-class="{'has-error': add.form.name.$invalid && add.form.name.$dirty}">
-
- <label for="name" class="col-sm-3 control-label" data-translate="moon.model.add.form.name">Name</label>
-
- <div class="col-sm-6">
-
- <input name="name" id="name" class="form-control" type="text" data-ng-model="add.model.name" required />
-
- <div class="help-block" ng-show="add.form.name.$dirty && add.form.name.$invalid">
- <small class="error" ng-show="add.form.name.$error.required" data-translate="moon.model.add.check.name.required">Name is required</small>
- </div>
-
- </div>
- </div>
-
- <div class="form-group">
-
- <label for="description" class="col-sm-3 control-label" data-translate="moon.model.add.form.description">Description</label>
- <div class="col-sm-6">
- <textarea id="description" name="description" class="form-control" data-ng-model="add.model.description"></textarea>
- </div>
-
- </div>
-
- </form>
-
- </div>
-
- <div class="modal-footer">
-
- <div class="btn-toolbar" style="float: right;">
-
- <a href="" ng-click="$hide()" class="btn btn-default">
- <span data-translate="moon.model.add.action.cancel">Cancel</span>
- </a>
-
- <a href="" ng-disabled="add.loading" ng-click="add.create()" class="btn btn-warning">
- <span class="glyphicon glyphicon-save"></span>
- <span data-translate="moon.model.add.action.create">Create Model</span>
- </a>
- <moon-loader ng-if="add.loading"></moon-loader>
-
- </div>
-
- </div>
-
- </div>
-
- </div>
-
-</div>
diff --git a/moonv4/moon_gui/static/app/model/action/model-delete.tpl.html b/moonv4/moon_gui/static/app/model/action/model-delete.tpl.html
deleted file mode 100755
index cde16d0e..00000000
--- a/moonv4/moon_gui/static/app/model/action/model-delete.tpl.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<div ng-controller="ModelDeleteController as del" class="modal" tabindex="-1" data-role="modalDeleteModel">
-
- <div class="modal-dialog">
-
- <div class="modal-content">
-
- <div class="modal-header">
- <button type="button" class="close" ng-click="$hide()">&times;</button>
- <h4 class="modal-title" data-translate="moon.model.remove.title"></h4>
- </div>
-
- <div class="modal-body">
-
- <p><span data-translate="moon.model.remove.content.query" data-translate-values="{ modelName: del.model.name }"></span></p>
-
- </div>
-
- <div class="modal-footer">
- <div class="btn-toolbar" style="float: right;">
-
- <a href="" ng-click="$hide()" class="btn btn-default">
- <span data-translate="moon.model.remove.action.cancel">Cancel</span>
- </a>
-
- <a href="" ng-disabled="del.loading" ng-click="del.remove()" class="btn btn-warning">
- <span class="glyphicon glyphicon-trash"></span>
- <span data-translate="moon.model.remove.action.delete">Delete</span>
- </a>
-
- <moon-loader ng-if="del.loading" ></moon-loader>
-
- </div>
- </div>
-
- </div>
-
- </div>
-
-</div> \ No newline at end of file
diff --git a/moonv4/moon_gui/static/app/model/action/model-view.tpl.html b/moonv4/moon_gui/static/app/model/action/model-view.tpl.html
deleted file mode 100755
index 46c295c7..00000000
--- a/moonv4/moon_gui/static/app/model/action/model-view.tpl.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<div ng-controller="ModelViewController as view" class="modal" tabindex="-1" data-role="modalViewProject">
-
- <div class="modal-dialog">
-
- <div class="modal-content">
-
- <div class="modal-header">
- <button type="button" class="close" ng-click="$hide()">&times;</button>
- <h4 class="modal-title" data-translate="moon.model.view.title" data-translate-values="{modelName: view.model.name}"></h4>
- </div>
- <div class="modal-body">
- <dl class="dl-horizontal">
- <dt data-translate="moon.model.view.id">Id</dt>
- <dd ng-bind="view.model.id"></dd>
- <dt data-translate="moon.model.view.name">Name</dt>
- <dd ng-bind="view.model.name"></dd>
- <dt data-translate="moon.model.view.description">Description</dt>
- <dd ng-bind="view.model.description"></dd>
- </dl>
-
- <div ng-if="view.meta_rules_values">
- <moon-meta-rules-list mapped-model="view.model" edit-mode="false"></moon-meta-rules-list>
- </div>
-
- <div ng-if="!view.meta_rules_values">
- <moon-loader></moon-loader>
- </div>
-
- </div>
-
- <div class="modal-footer top10">
- <div class="btn-toolbar" style="float: right;">
- <button ng-click="$hide()" class="btn btn-default" data-translate="moon.model.view.action.close">Close</button>
- </div>
- </div>
-
- </div>
-
- </div>
-
-</div>
diff --git a/moonv4/moon_gui/static/app/model/action/model.controller.add.js b/moonv4/moon_gui/static/app/model/action/model.controller.add.js
deleted file mode 100755
index 11d3abf4..00000000
--- a/moonv4/moon_gui/static/app/model/action/model.controller.add.js
+++ /dev/null
@@ -1,71 +0,0 @@
-(function() {
-
- 'use strict';
-
- angular
- .module('moon')
- .controller('ModelAddController', ModelAddController);
-
- ModelAddController.$inject = ['$scope', 'modelService', 'alertService', '$translate', 'formService', 'utilService'];
-
- function ModelAddController($scope, modelService, alertService, $translate, formService, utilService) {
-
- var add = this;
-
- /*
- *
- */
-
- add.form = {};
-
- add.loading = false;
-
- add.model = { name: null, description: null, meta_rules : [] };
-
- add.create = createModel;
-
- function createModel() {
-
- if(formService.isInvalid(add.form)) {
-
- formService.checkFieldsValidity(add.form);
-
- } else {
-
- add.loading = true;
-
- modelService.data.create({}, add.model, createSuccess, createError);
-
- }
-
- function createSuccess(data) {
-
- var createdModel = utilService.transformOne(data, 'models');
-
- $translate('moon.model.add.success', { modelName: createdModel.name }).then(function (translatedValue) {
- alertService.alertSuccess(translatedValue);
- });
-
- add.loading = false;
-
- $scope.$emit('event:modelCreatedSuccess', createdModel);
-
- }
-
- function createError(reason) {
-
- $translate('moon.model.add.error', { modelName: add.model.name }).then(function (translatedValue) {
- alertService.alertError(translatedValue);
- });
-
- add.loading = false;
-
- $scope.$emit('event:modelCreatedError', add.project);
-
- }
-
- }
-
- }
-
-})();
diff --git a/moonv4/moon_gui/static/app/model/action/model.controller.delete.js b/moonv4/moon_gui/static/app/model/action/model.controller.delete.js
deleted file mode 100755
index 5d9dae1a..00000000
--- a/moonv4/moon_gui/static/app/model/action/model.controller.delete.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @author arnaud marhin<arnaud.marhin@orange.com>
- */
-
-(function() {
-
- 'use strict';
-
- angular
- .module('moon')
- .controller('ModelDeleteController', ModelDeleteController);
-
- ModelDeleteController.$inject = ['$scope', '$translate', 'alertService', 'modelService'];
-
- function ModelDeleteController($scope, $translate, alertService, modelService) {
-
- var del = this;
-
- /*
- *
- */
-
- del.model = $scope.model;
- del.loading = false;
-
- del.remove = deleteModel;
-
- activate();
-
- /**
- *
- */
-
- function activate(){
-
- }
-
-
- function deleteModel(){
-
- del.loading = true;
-
- modelService.delete(del.model, deleteSuccess, deleteError);
-
- function deleteSuccess(data) {
-
- $translate('moon.model.remove.success', { modelName: del.model.name }).then(function (translatedValue) {
- alertService.alertSuccess(translatedValue);
- });
-
- del.loading = false;
-
- $scope.$emit('event:modelDeletedSuccess', del.model);
-
- }
-
- function deleteError(reason) {
-
- $translate('moon.model.remove.error', { modelName: del.model.name, errorCode: reason.data.error.code, message : reason.data.error.message } ).then(function (translatedValue) {
- alertService.alertError(translatedValue);
- });
-
- del.loading = false;
-
- $scope.$emit('event:modelDeletedError', del.model);
-
- }
-
- }
- }
-
-})();
diff --git a/moonv4/moon_gui/static/app/model/action/model.controller.view.js b/moonv4/moon_gui/static/app/model/action/model.controller.view.js
deleted file mode 100755
index 7605eecf..00000000
--- a/moonv4/moon_gui/static/app/model/action/model.controller.view.js
+++ /dev/null
@@ -1,53 +0,0 @@
-(function() {
-
- 'use strict';
-
- angular
- .module('moon')
- .controller('ModelViewController', ModelViewController);
-
- ModelViewController.$inject = ['$scope', 'metaRuleService'];
-
- function ModelViewController($scope, metaRuleService) {
-
- var view = this;
-
- /*
- *
- */
-
- view.model = $scope.model;
-
- view.meta_rules_values = false;
-
- activate();
-
- function activate(){
-
- if(view.model.meta_rules.length > 0 ){
-
- findMetaRules();
-
- }else{
-
- view.meta_rules_values = [];
-
- }
-
- }
-
- function findMetaRules(){
-
- metaRuleService.findSomeWithMetaData(view.model.meta_rules).then(function(metaRules){
-
- view.meta_rules_values = metaRules;
-
- view.model.meta_rules_values = metaRules;
-
- });
-
- }
-
- }
-
-})();