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