Skip to content

Commit 26047b3

Browse files
committed
configuração de datatable
1 parent a23fa1e commit 26047b3

File tree

9 files changed

+131
-117
lines changed

9 files changed

+131
-117
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
var aqtApp = angular.module("aqtApp", ['ngResource','angular-growl','datatables', 'ngRoute','LocalStorageModule', 'angular-loading-bar', 'ngAnimate', 'infinite-scroll']);
1+
var aqtApp = angular.module("aqtApp", ['ngResource','angular-growl','datatables', 'datatables.bootstrap', 'ngRoute','LocalStorageModule', 'angular-loading-bar', 'ngAnimate', 'infinite-scroll']);
22

33

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
aqtApp.run(function(DTDefaultOptions) {
2+
3+
DTDefaultOptions.setBootstrapOptions({
4+
TableTools : {
5+
classes : {
6+
container : 'btn-group',
7+
buttons : {
8+
normal : 'btn btn-danger'
9+
}
10+
}
11+
},
12+
ColVis : {
13+
classes : {
14+
masterButton : 'btn btn-primary'
15+
}
16+
}
17+
});
18+
});

AnalyzerQuestionsRESTful/src/main/resources/static/js/controllers/user-controller.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
aqtApp.controller("userController",function($scope, userService, $location, localStorageService,
2-
DTOptionsBuilder, DTColumnDefBuilder, $routeParams) {
2+
DTOptionsBuilder, DTColumnDefBuilder, DTColumnBuilder, $routeParams) {
33

44
$scope.users = [];
55
$scope.user = {};
@@ -15,12 +15,15 @@ aqtApp.controller("userController",function($scope, userService, $location, loca
1515
};
1616

1717
$scope.dtOptions = DTOptionsBuilder.newOptions()
18-
.withPaginationType('full_numbers').withDisplayLength(10);
18+
.withPaginationType('simple_numbers').withDisplayLength(10).withBootstrap();
1919

2020
$scope.dtColumnDefs = [
21-
DTColumnDefBuilder.newColumnDef(0).notSortable(),
22-
DTColumnDefBuilder.newColumnDef(1),
23-
DTColumnDefBuilder.newColumnDef(2) ];
21+
DTColumnDefBuilder.newColumnDef(1).notSortable(),
22+
DTColumnDefBuilder.newColumnDef(2).notSortable(),
23+
DTColumnDefBuilder.newColumnDef(3).notSortable(),
24+
DTColumnDefBuilder.newColumnDef(4).notSortable(),
25+
DTColumnDefBuilder.newColumnDef(5).notSortable()
26+
];
2427

2528
var findAll = function() {
2629
userService.findAll().$promise.then(function(response) {

AnalyzerQuestionsRESTful/src/main/resources/static/view/response-questions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h2>{{vm.question.title}}</h2>
2121
</div>
2222
<div class="col-md-5">
2323
<form novalidate name="vm.frmOptions">
24-
<div class="well">
24+
<div class="well well-sm">
2525
<div class="row">
2626
<div class="col-md-3">
2727
<button type="reset" class="btn btn-primary"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<main>
22
<div class="jumbotron aqt-jumbotron">
3-
<h1>Passo 2</h1>
4-
<p>Descrição do que o usuário irá fazer...</p>
3+
<h1>{{config.steps.step2.head}}</h1>
4+
<p>{{config.steps.step2.description}}</p>
55
<p><a class="btn btn-danger aqt-btn-end-time" href="#/listQuestions" role="button">PROSSEGUIR</a></p>
66
</div>
77
</main>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<main>
22
<div class="jumbotron aqt-jumbotron">
3-
<h1>Passo 3</h1>
4-
<p>Descrição do que o usuário irá fazer...</p>
3+
<h1>{{config.steps.step3.head}}</h1>
4+
<p>{{config.steps.step3.description}}</p>
55
<p><a class="btn btn-danger aqt-btn-end-time" href="#/responseQuestions" role="button">PROSSEGUIR</a></p>
66
</div>
77
</main>
Lines changed: 90 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,98 @@
11
<div class="container-fluid">
2-
<div class="panel panel-primary" style="margin-top: 30px;">
3-
<div class="panel-heading">
4-
<strong>{{user.name}} - {{user.email}}</strong>
5-
</div>
6-
<div class="panel-body">
2+
<div class="panel panel-primary" style="margin-top: 30px;">
3+
<div class="panel-heading">
4+
<strong>{{user.name}} - {{user.email}}</strong>
5+
</div>
6+
<div class="panel-body">
77

8-
<div class="panel panel-default">
9-
<div class="panel-heading">PERGUNTA ORIGINAL</div>
10-
<div class="panel-body"></div>
11-
<div class="table-responsive">
12-
<table
13-
class="table table-striped table-bordered table-hover table-condensed js-sticky-table">
14-
<thead>
15-
<tr>
16-
<th width="10%">ID</th>
17-
<th width="40%">Título</th>
18-
<th width="60%">Descrição</th>
19-
</tr>
20-
</thead>
21-
<tbody>
22-
<tr>
23-
<td>{{user.question.id}}</td>
24-
<td>{{user.question.title}}</td>
25-
<td>{{user.question.description}}</td>
26-
</tr>
27-
</tbody>
28-
</table>
8+
<div class="panel panel-default">
9+
<div class="panel-heading">PERGUNTA ORIGINAL</div>
10+
<div class="panel-body"></div>
11+
<div class="table-responsive">
12+
<table
13+
class="table table-striped table-bordered table-hover table-condensed js-sticky-table">
14+
<thead>
15+
<tr>
16+
<th width="10%">ID</th>
17+
<th width="40%">Título</th>
18+
<th width="60%">Descrição</th>
19+
</tr>
20+
</thead>
21+
<tbody>
22+
<tr>
23+
<td>{{user.question.id}}</td>
24+
<td>{{user.question.title}}</td>
25+
<td>{{user.question.description}}</td>
26+
</tr>
27+
</tbody>
28+
</table>
29+
</div>
2930
</div>
30-
</div>
31-
<div class="panel panel-default">
32-
<div class="panel-heading">PERGUNTA MODIFICADA</div>
33-
<div class="panel-body"></div>
34-
<div class="table-responsive">
35-
<table
36-
class="table table-striped table-bordered table-hover table-condensed js-sticky-table">
37-
<thead>
38-
<tr>
39-
<th width="4%">ID</th>
40-
<th width="30%">Título</th>
41-
<th width="50%">Descrição</th>
42-
<th width="40%">Sugestões selecionadas</th>
43-
</tr>
44-
</thead>
45-
<tbody>
46-
<tr>
47-
<td>{{user.questionWrapper.question.id}}</td>
48-
<td>{{user.questionWrapper.question.title}}</td>
49-
<td>{{user.questionWrapper.question.description}}</td>
50-
<td>
51-
<div ng-repeat="s in user.questionWrapper.suggestions">
52-
<li>{{s}}</li>
53-
</div>
54-
</td>
55-
</tr>
56-
</tbody>
57-
</table>
31+
<div class="panel panel-default">
32+
<div class="panel-heading">PERGUNTA MODIFICADA</div>
33+
<div class="panel-body"></div>
34+
<div class="table-responsive">
35+
<table
36+
class="table table-striped table-bordered table-hover table-condensed js-sticky-table">
37+
<thead>
38+
<tr>
39+
<th width="4%">ID</th>
40+
<th width="30%">Título</th>
41+
<th width="50%">Descrição</th>
42+
<th width="40%">Sugestões selecionadas</th>
43+
</tr>
44+
</thead>
45+
<tbody>
46+
<tr>
47+
<td>{{user.questionWrapper.question.id}}</td>
48+
<td>{{user.questionWrapper.question.title}}</td>
49+
<td>{{user.questionWrapper.question.description}}</td>
50+
<td>
51+
<div ng-repeat="s in user.questionWrapper.suggestions">
52+
<li>{{s}}</li>
53+
</div>
54+
</td>
55+
</tr>
56+
</tbody>
57+
</table>
58+
</div>
5859
</div>
59-
</div>
60-
<div class="panel panel-default">
61-
<div class="panel-heading">PERGUNTAS ESCOLHIDAS/CLICADAS</div>
62-
<div class="panel-body"></div>
63-
<div class="table-responsive">
64-
<table
65-
class="table table-striped table-bordered table-hover table-condensed js-sticky-table">
66-
<thead>
67-
<tr>
68-
<th width="4%">ID</th>
69-
<th width="25%">Título</th>
70-
<th width="40%">Descrição</th>
71-
<th width="10%">AÇÃO</th>
72-
<th width="40%">Motivos</th>
73-
</tr>
74-
</thead>
75-
<tbody>
76-
<tr
77-
ng-repeat="question in user.chosenQuestionsWrapper.chosenQuestions">
78-
<td>{{question.id}}</td>
79-
<td>{{question.title}}</td>
80-
<td>{{question.description.substring(0, 500)}}</td>
81-
<td>{{question.questionType === 'CHOSEN'?
82-
'Escolhida':'Clicada'}}</td>
83-
<td>
84-
<div ng-repeat="m in question.motives">
85-
<li>{{m}}</li>
86-
</div>
87-
</td>
88-
</tr>
89-
</tbody>
90-
</table>
60+
<div class="panel panel-default">
61+
<div class="panel-heading">PERGUNTAS ESCOLHIDAS/CLICADAS</div>
62+
<div class="panel-body"></div>
63+
<div class="table-responsive">
64+
<table
65+
class="table table-striped table-bordered table-hover table-condensed js-sticky-table">
66+
<thead>
67+
<tr>
68+
<th width="4%">ID</th>
69+
<th width="25%">Título</th>
70+
<th width="40%">Descrição</th>
71+
<th width="10%">AÇÃO</th>
72+
<th width="40%">Motivos</th>
73+
</tr>
74+
</thead>
75+
<tbody>
76+
<tr
77+
ng-repeat="question in user.chosenQuestionsWrapper.chosenQuestions">
78+
<td>{{question.id}}</td>
79+
<td>{{question.title}}</td>
80+
<td>{{question.description.substring(0, 400)}} ...</td>
81+
<td>{{question.questionType === 'CHOSEN'?
82+
'Escolhida':'Clicada'}}</td>
83+
<td>
84+
<div ng-repeat="m in question.motives">
85+
<li>{{m}}</li>
86+
</div>
87+
</td>
88+
</tr>
89+
</tbody>
90+
</table>
91+
</div>
9192
</div>
9293
</div>
9394
</div>
94-
</div>
95+
<div class="well well-sm">
96+
<a href="#/adminUsers/" class="btn btn-primary"> VOLTAR </a>
97+
</div>
9598
</div>

AnalyzerQuestionsRESTful/src/main/resources/static/view/users.html

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@
1414
</div>
1515
</div>
1616
</div>
17-
<div class="col-sm-6">
18-
<div style="margin-top: 20px;" class="panel panel-default">
19-
<div class="panel-body">
20-
<ul class="list-group" ng-repeat="user in users">
21-
<li class="list-group-item"><strong>NOME:</strong>
22-
{{user.name}} <strong>E-MAIL:</strong> {{user.email}}</li>
23-
</ul>
24-
</div>
25-
</div>
26-
</div>
2717
</div>
2818
<div class="row">
2919
<div class="table-responsive">
@@ -32,27 +22,24 @@
3222
class="table table-striped table-bordered table-hover table-condensed js-sticky-table">
3323
<thead>
3424
<tr>
35-
<th width="2%">#</th>
3625
<th width="15%">Usuário- Nome</th>
3726
<th width="15%">Usuário- E-mail</th>
3827
<th width="30%">Pergunta Original</th>
3928
<th width="30%">Pergunta Alterada</th>
40-
<th width="10%">Pergunta Selecionadas</th>
29+
<th width="10%">Pergunta Sel.</th>
30+
<th width="2%">Ações</th>
4131
</tr>
4232
</thead>
4333
<tbody>
4434
<tr ng-repeat="user in users">
45-
<td class="acoes">
46-
<div class="btn-group">
47-
<a href="#/viewUser/{{user.id}}" class="btn btn-default btn-xs">
48-
<i class="fa fa-search"></i>
49-
</a>
50-
</td>
5135
<td>{{user.name}}</td>
5236
<td>{{user.email}}</td>
5337
<td>{{user.question.title}}</td>
5438
<td>{{user.questionWrapper.question.title}}</td>
5539
<td>{{user.chosenQuestionsWrapper.chosenQuestions.length}}</td>
40+
<td class="acoes"><a href="#/viewUser/{{user.id}}"
41+
class="btn btn-default btn-xs"> <i class="fa fa-search"></i>
42+
</a></td>
5643
</tr>
5744
</tbody>
5845
</table>

AnalyzerQuestionsRESTful/src/main/resources/templates/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<link rel="stylesheet" type="text/css" href="/vendors/angular-growl/angular-growl.min.css" />
1212
<link rel="stylesheet" type="text/css" href="/vendors/jquery-datatables/media/css/dataTables.bootstrap.min.css" />
1313
<link rel="stylesheet" type="text/css" href="/vendors/angular-datatable/css/angular-datatables.css" />
14+
<link rel="stylesheet" type="text/css" href="/vendors/angular-datatable/plugins/bootstrap/datatables.bootstrap.min.css" />
1415
<link href="https://fonts.googleapis.com/css?family=Abel" rel="stylesheet"/>
1516
</head>
1617
<body ng-controller="mainController">
@@ -25,6 +26,7 @@
2526
<script src="/js/vendors/angular.min.js"></script>
2627
<script src="/js/vendors/angular-animate.min.js"></script>
2728
<script src="/vendors/angular-datatable/angular-datatables.min.js"></script>
29+
<script src="/vendors/angular-datatable/plugins/bootstrap/angular-datatables.bootstrap.min.js"></script>
2830
<script src="/js/vendors/angular-route.min.js"></script>
2931
<script src="/js/vendors/angular-resource.min.js"></script>
3032
<script src="/js/vendors/angular-local-storage.min.js"></script>
@@ -39,7 +41,8 @@
3941
<script src="/js/config/loading-bar-config.js"></script>
4042
<script src="/js/config/local-store-config.js"></script>
4143
<script src="/js/config/growl-config.js"></script>
42-
<script src="/js/config/cronometer-config.js"></script>
44+
<script src="/js/config/cronometer-config.js"></script>
45+
<script src="/js/config/datatables-config.js"></script>
4346

4447
<script src="/js/services/user-services.js"></script>
4548
<script src="/js/services/question-services.js"></script>

0 commit comments

Comments
 (0)