Commit 69d2bb3f authored by Evren Kutar's avatar Evren Kutar

v0.0.3.1 list page fix for all cases

parent f239bad5
......@@ -198,7 +198,7 @@ module.exports = function (grunt) {
},
watch: {
dev: {
files: ['app/**/*.js', 'app/components/**/*.html', 'index.html', 'Gruntfile.js', '!app/tmp/*.js', '!app/app.js'],
files: ['app/**/*.js', 'app/components/**/*.html', 'app/main.html', 'Gruntfile.js', '!app/tmp/*.js', '!app/app.js'],
tasks: ['env:dev', 'preprocess:dev', 'html2js:dev'],
options: {
atBegin: false
......
......@@ -58,12 +58,7 @@ crud.controller('CRUDListCtrl', function ($scope, $rootScope, Generator, $routeP
// call generator's get_list func
Generator.get_list($scope)
.then(function (res) {
var data = res.data.objects;
for (var item in data){
delete data[item].data['deleted'];
delete data[item].data['timestamp'];
}
$scope.objects = data;
$scope.nobjects = res.data.nobjects;
$scope.model = $routeParams.model;
});
});
......
......@@ -10,27 +10,36 @@
Hepsini Seç
</label>
</th>
<th ng-repeat="(key,value) in nobjects[0].data">{{ key }}</th>
<th ng-repeat="value in nobjects[0]" ng-if="nobjects[0]!='-1'">{{ value }}</th>
<th ng-if="nobjects[0]=='-1'">{{ model }}</th>
<th>action</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="object in nobjects">
<tr ng-repeat="object in nobjects" ng-if="$index>0">
<td width="60">
<label>
<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">
</label>
</td>
<th scope="row" style="text-align:center">{{$index + 1}}</th>
<td ng-repeat="(key,value) in object.data">{{value}}</td>
<th scope="row" style="text-align:center">{{$index}}</th>
<td ng-repeat="k in object" ng-if="nobjects[0]=='-1' && $index>0">
<a ng-href="#/{{model}}/{{object[0]}}">{{object[1]}}</a>
</td>
<td ng-repeat="(key,value) in object" ng-if="nobjects[0]!='-1' && $index>0">
<a ng-href="#/{{model}}/{{object[0]}}" ng-if="$index==1">{{value}}</a>
<span ng-if="$index!=1">{{value}}</span>
</td>
<td>
<a ng-href="#/{{model}}/edit/{{object.key}}">Edit</a><br>
<a ng-href="#/{{model}}/{{object.key}}">Show</a>
<a ng-href="#/{{model}}/edit/{{object[0]}}">Edit</a><br>
</td>
</tr>
</tbody>
</table>
</div>
<br/>
<hr/>
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
......
......@@ -87,7 +87,6 @@
<script src="tmp/templates.js"></script>
<script src="app.js"></script>
<script src="app_routes.js"></script>
<script src="shared/scripts/theme.js"></script>
<script src="shared/scripts/jquery-ui.min.js"></script>
<script src="shared/directives.js"></script>
<script src="zetalib/interceptors.js"></script>
......
......@@ -95,7 +95,6 @@
<script src="tmp/templates.js"></script>
<script src="app.js"></script>
<script src="app_routes.js"></script>
<script src="shared/scripts/theme.js"></script>
<script src="shared/scripts/jquery-ui.min.js"></script>
<script src="shared/directives.js"></script>
<script src="zetalib/interceptors.js"></script>
......@@ -120,7 +119,6 @@
<script src="shared/translations.js"></script>
<script src="templates.js"></script>
<script src="app.js"></script>
<script src="bower_components/theme.js"></script>
<!-- @endif -->
</body>
</html>
......@@ -70,7 +70,7 @@ app.directive('sidebar', ['$location', function () {
restrict: 'E',
replace: true,
scope: {},
controller: function ($scope, $rootScope, $http, RESTURL, $location) {
controller: function ($scope, $rootScope, $http, RESTURL, $location, $timeout) {
$rootScope.$watch(
$rootScope.loggedInUser, function(){
$http.post(RESTURL.url + 'crud/').success(function (data) {
......@@ -79,9 +79,10 @@ app.directive('sidebar', ['$location', function () {
}
);
//$http.post(RESTURL.url + 'crud/').success(function (data) {
// $scope.menuItems = data.app_models;
//});
$timeout(function(){
$('#side-menu').metisMenu();
console.log('amk');
}, 1000);
$scope.selectedMenu = $location.path();
$scope.collapseVar = 0;
......
......@@ -238,8 +238,6 @@ form_generator.controller('ModalCtrl', function ($scope, $modalInstance, Generat
$scope[key] = items[key];
});
console.log(items);
Generator.prepareFormItems($scope);
$scope.onSubmit = function (form) {
......
This diff is collapsed.
......@@ -50,27 +50,36 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" Hepsini Seç\n" +
" </label>\n" +
" </th>\n" +
" <th ng-repeat=\"(key,value) in nobjects[0].data\">{{ key }}</th>\n" +
" <th ng-repeat=\"value in nobjects[0]\" ng-if=\"nobjects[0]!='-1'\">{{ value }}</th>\n" +
" <th ng-if=\"nobjects[0]=='-1'\">{{ model }}</th>\n" +
" <th>action</th>\n" +
" </tr>\n" +
" </thead>\n" +
" <tbody>\n" +
" <tr ng-repeat=\"object in nobjects\">\n" +
" <tr ng-repeat=\"object in nobjects\" ng-if=\"$index>0\">\n" +
" <td width=\"60\">\n" +
" <label>\n" +
" <input type=\"checkbox\" style=\"zoom:1.5; margin:5px 0 0 8px;\">\n" +
" </label>\n" +
" </td>\n" +
" <th scope=\"row\" style=\"text-align:center\">{{$index + 1}}</th>\n" +
" <td ng-repeat=\"(key,value) in object.data\">{{value}}</td>\n" +
" <th scope=\"row\" style=\"text-align:center\">{{$index}}</th>\n" +
" <td ng-repeat=\"k in object\" ng-if=\"nobjects[0]=='-1' && $index>0\">\n" +
" <a ng-href=\"#/{{model}}/{{object[0]}}\">{{object[1]}}</a>\n" +
" </td>\n" +
"\n" +
" <td ng-repeat=\"(key,value) in object\" ng-if=\"nobjects[0]!='-1' && $index>0\">\n" +
" <a ng-href=\"#/{{model}}/{{object[0]}}\" ng-if=\"$index==1\">{{value}}</a>\n" +
" <span ng-if=\"$index!=1\">{{value}}</span>\n" +
" </td>\n" +
" <td>\n" +
" <a ng-href=\"#/{{model}}/edit/{{object.key}}\">Edit</a><br>\n" +
" <a ng-href=\"#/{{model}}/{{object.key}}\">Show</a>\n" +
" <a ng-href=\"#/{{model}}/edit/{{object[0]}}\">Edit</a><br>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" <br/>\n" +
" <hr/>\n" +
"\n" +
" <div class=\"btn-group\">\n" +
" <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\"\n" +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment