1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

moved abuses panel to admin zone + fix loading template

This commit is contained in:
Sylvain 2019-05-21 11:16:12 +02:00
parent dd4b6e2cb1
commit 630809b91f
18 changed files with 85 additions and 64 deletions

View File

@ -4,6 +4,6 @@
Application.Controllers.controller('AbusesController', ['$scope', '$state', 'Abuse', 'abusesPromise', 'growl', '_t',
function ($scope, $state, Abuse, abusesPromise, growl, _t) {
// List of all reported abuses
$scope.abuses = abusesPromise;
$scope.abuses = abusesPromise.abuses;
}
]);

View File

@ -311,19 +311,6 @@ angular.module('application.router', ['ui.router'])
translations: ['Translations', function (Translations) { return Translations.query(['app.logged.projects_edit', 'app.shared.project']).$promise; }]
}
})
.state('app.admin.manage_abuses', {
url: '/abuses',
views: {
'main@': {
templateUrl: '<%= asset_path "abuses/index.html" %>',
controller: 'AbusesController'
}
},
resolve: {
abusesPromise: ['Abuse', function(Abuse) { return Abuse.query().$promise; }],
translations: ['Translations', function(Translations) { return Translations.query('app.admin.manage_abuses').$promise; }]
}
})
// machines
.state('app.public.machines_list', {
@ -683,6 +670,19 @@ angular.module('application.router', ['ui.router'])
translations: ['Translations', function (Translations) { return Translations.query('app.admin.project_elements').$promise; }]
}
})
.state('app.admin.manage_abuses', {
url: '/admin/abuses',
views: {
'main@': {
templateUrl: '<%= asset_path "admin/abuses/index.html" %>',
controller: 'AbusesController'
}
},
resolve: {
abusesPromise: ['Abuse', function(Abuse) { return Abuse.query().$promise; }],
translations: ['Translations', function(Translations) { return Translations.query('app.admin.manage_abuses').$promise; }]
}
})
// trainings
.state('app.admin.trainings', {

View File

@ -3,8 +3,8 @@
Application.Services.factory('Abuse', ['$resource', function ($resource) {
return $resource('/api/abuses/:id',
{ id: '@id' }, {
update: {
method: 'PUT'
query: {
isArray: false
}
}
);

View File

@ -1,13 +0,0 @@
<section class="heading b-b">
<div class="row no-gutter">
<h1 translate>{{ 'manage_abuses.abuses_list' }}</h1>
</div>
</section>
<section class="m-lg">
<div class="row m-b-md">>
<ul>
<li ng-repeat="abuse in abuses">{{abuse.id}}</li>
</ul>
</div>
</section>

View File

@ -0,0 +1,23 @@
<section class="heading b-b">
<div class="row no-gutter">
<div class="col-xs-2 col-sm-2 col-md-1">
<section class="heading-btn">
<a href="#" ng-click="backPrevLocation($event)"><i class="fa fa-long-arrow-left "></i></a>
</section>
</div>
<div class="col-xs-10 col-sm-10 col-md-8 b-l">
<section class="heading-title">
<h1 translate>{{ 'manage_abuses.abuses_list' }}</h1>
</section>
</div>
</div>
</section>
<section class="m-lg">
<div class="row m-b-md">
<span ng-show="abuses.length === 0" translate>{{ 'manage_abuses.no_reports' }}</span>
<ul ng-show="abuses.length > 0">
<li ng-repeat="abuse in abuses">{{abuse.id}}</li>
</ul>
</div>
</section>

View File

@ -7,10 +7,14 @@
</div>
<div class="col-xs-10 col-sm-10 col-md-8 b-l">
<section class="heading-title">
<h1 translate>{{ 'projects_elements_management' }}</h1>
<h1 translate>{{ 'project_elements.projects_elements_management' }}</h1>
</section>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 b-t hide-b-md">
<section class="heading-actions wrapper">
<a class="btn btn-ng btn-warning b-2x rounded m-t-sm upper text-sm" ui-sref="app.admin.manage_abuses" role="button" translate>{{ 'project_elements.manage_abuses' }}</a>
</section>
</div>
</div>
</section>
@ -26,7 +30,7 @@
<uib-tab heading="{{ 'themes' | translate }}">
<ng-include src="'<%= asset_path 'admin/project_elements/themes.html' %>'"></ng-include>
</uib-tab>
<uib-tab heading="{{ 'licences' | translate }}">
<uib-tab heading="{{ 'project_elements.licences' | translate }}">
<ng-include src="'<%= asset_path 'admin/project_elements/licences.html' %>'"></ng-include>
</uib-tab>
</uib-tabset>

View File

@ -1,4 +1,4 @@
<button type="button" class="btn btn-warning m-t m-b" ng-click="addLicence()" translate>{{ 'add_a_new_licence' }}</button>
<button type="button" class="btn btn-warning m-t m-b" ng-click="addLicence()" translate>{{ 'project_elements.add_a_new_licence' }}</button>
<table class="table">
<thead>

View File

@ -1,4 +1,4 @@
<button type="button" class="btn btn-warning m-b m-t" ng-click="addComponent()" translate>{{ 'add_a_material' }}</button>
<button type="button" class="btn btn-warning m-b m-t" ng-click="addComponent()" translate>{{ 'project_elements.add_a_material' }}</button>
<table class="table">
<thead>

View File

@ -1,4 +1,4 @@
<button type="button" class="btn btn-warning m-t m-b" ng-click="addTheme()" translate>{{ 'add_a_new_theme' }}</button>
<button type="button" class="btn btn-warning m-t m-b" ng-click="addTheme()" translate>{{ 'project_elements.add_a_new_theme' }}</button>
<table class="table">
<thead>

View File

@ -14,7 +14,6 @@
<div class="col-xs-12 col-sm-12 col-md-3 b-t hide-b-md" ng-if="isAuthorized(['admin','member'])">
<section class="heading-actions wrapper">
<a class="btn btn-lg btn-warning bg-white b-2x rounded m-t-sm upper text-sm" ui-sref="app.logged.projects_new" role="button" translate>{{ 'projects_list.add_a_project' }}</a>
<a class="btn btn-ng btn-warning b-2x rounded m-t-sm upper text-sm" ng-if="isAuthorized(['admin'])" ui-sref="app.admin.manage_abuses" role="button" translate>{{ 'projects_list.manage_abuses' }}</a>
</section>
</div>
</div>

View File

@ -64,11 +64,13 @@ en:
project_elements:
# management of the projects' components
projects_elements_management: "Projects elements management"
add_a_material: "Add a material"
add_a_new_theme: "Add a new theme"
licences: "Licences"
add_a_new_licence: "Add a new licence"
project_elements:
projects_elements_management: "Projects elements management"
add_a_material: "Add a material"
add_a_new_theme: "Add a new theme"
licences: "Licences"
add_a_new_licence: "Add a new licence"
manage_abuses: "Manage the reports"
trainings:
# track and monitor the trainings
@ -758,4 +760,5 @@ en:
manage_abuses:
# process and delete abuses reports
manage_abuses:
abuses_list: "Abuses list"
abuses_list: "Reports list"
no_reports: "No reports for now"

View File

@ -64,11 +64,13 @@ es:
project_elements:
# management of the projects' components
projects_elements_management: "Gestión de elementos de proyectos"
add_a_material: "Añadir un material"
add_a_new_theme: "Añadir un nuevo tema"
licences: "Licencias"
add_a_new_licence: "Agregar una nueva licencia"
project_elements:
projects_elements_management: "Gestión de elementos de proyectos"
add_a_material: "Añadir un material"
add_a_new_theme: "Añadir un nuevo tema"
licences: "Licencias"
add_a_new_licence: "Agregar una nueva licencia"
manage_abuses: "Administrar informes"
trainings:
# track and monitor the trainings
@ -758,4 +760,5 @@ es:
manage_abuses:
# process and delete abuses reports
manage_abuses:
abuses_list: "Abuses list" # translation_missing
abuses_list: "Lista de informes"
no_reports: "No informes por ahora"

View File

@ -64,11 +64,13 @@ fr:
project_elements:
# gestion des éléments constituant les projets
projects_elements_management: "Gestion des éléments projets"
add_a_material: "Ajouter un matériau"
add_a_new_theme: "Ajouter une nouvelle thématique"
licences: "Licences"
add_a_new_licence: "Ajouter une nouvelle licence"
project_elements:
projects_elements_management: "Gestion des éléments projets"
add_a_material: "Ajouter un matériau"
add_a_new_theme: "Ajouter une nouvelle thématique"
licences: "Licences"
add_a_new_licence: "Ajouter une nouvelle licence"
manage_abuses: "Gérer les signalements"
trainings:
# suivre et surveiller les formations
@ -758,4 +760,5 @@ fr:
manage_abuses:
# traiter et supprimer les rapports d'abus
manage_abuses:
abuses_list: "Liste des abus"
abuses_list: "Liste des signalements"
no_reports: "Aucun signalement pour le moment"

View File

@ -64,11 +64,13 @@ pt:
project_elements:
# management of the projects' components
projects_elements_management: "Gerenciar projetos e elementos"
add_a_material: "Adicionar um material"
add_a_new_theme: "Adicionar um novo tema"
licences: "Licenças"
add_a_new_licence: "Adicionar uma nova licença"
project_elements:
projects_elements_management: "Gerenciar projetos e elementos"
add_a_material: "Adicionar um material"
add_a_new_theme: "Adicionar um novo tema"
licences: "Licenças"
add_a_new_licence: "Adicionar uma nova licença"
manage_abuses: "Gerenciar relatórios"
trainings:
# track and monitor the trainings
@ -758,4 +760,5 @@ pt:
manage_abuses:
# process and delete abuses reports
manage_abuses:
abuses_list: "Abuses list" # translation_missing
abuses_list: "Lista de relatórios"
no_reports: "Não há relatos de agora"

View File

@ -165,7 +165,6 @@ en:
all_materials: "All materials"
load_next_projects: "Load next projects"
rough_draft: "Rough draft"
manage_abuses: "Manage abuses reports"
projects_show:
# details of a projet

View File

@ -164,7 +164,6 @@ es:
all_materials: "Todo el material"
load_next_projects: "Cargar más proyectos"
rough_draft: "Borrador"
manage_abuses: "Manage abuses reports" #translation_missing
projects_show:
# details of a projet

View File

@ -165,7 +165,6 @@ fr:
all_materials: "Tous les matériaux"
load_next_projects: "Charger les projets suivants"
rough_draft: "Brouillon"
manage_abuses: "Gérer les rapports d'abus"
projects_show:
# détails d'un projet

View File

@ -165,7 +165,6 @@ pt:
all_materials: "Todos os materiais"
load_next_projects: "Carregar próximos projetos"
rough_draft: "Rascunho"
manage_abuses: "Manage abuses reports" #translation_missing
projects_show:
# details of a projet