Commit 94ec1592 authored by Evren Kutar's avatar Evren Kutar

v0.0.3.1 linkedmodel modal model_name fix

parent b4c9e7f7
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
Hepsini Seç Hepsini Seç
</label> </label>
</th> </th>
<th ng-repeat="(key,value) in objects[0].data">{{ key }}</th> <th ng-repeat="(key,value) in nobjects[0].data">{{ key }}</th>
<th>action</th> <th>action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="object in objects"> <tr ng-repeat="object in nobjects">
<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;">
......
...@@ -70,14 +70,14 @@ form_generator.factory('Generator', function ($http, $q, $log, $location, $modal ...@@ -70,14 +70,14 @@ form_generator.factory('Generator', function ($http, $q, $log, $location, $modal
if (k.type == 'model') { if (k.type == 'model') {
var formitem = scope.form[scope.form.indexOf(v)]; var formitem = scope.form[scope.form.indexOf(v)];
debugger;
var modelscope = {"url": scope.url, "form_params": {model: k.model_name}}; var modelscope = {"url": scope.url, "form_params": {model: k.model_name}};
debugger;
formitem = { formitem = {
"type": "template", type: "template",
"templateUrl": "shared/templates/foreignKey.html", templateUrl: "shared/templates/foreignKey.html",
"title": k.title, title: k.title,
"titleMap": generator.get_list(modelscope).then(function (res) { model_name: k.model_name,
titleMap: generator.get_list(modelscope).then(function (res) {
formitem.titleMap = []; formitem.titleMap = [];
angular.forEach(res.data.objects, function (item) { angular.forEach(res.data.objects, function (item) {
formitem.titleMap.push({ formitem.titleMap.push({
...@@ -318,9 +318,10 @@ form_generator.directive('addModalForLinkedModel', function ($modal, Generator) ...@@ -318,9 +318,10 @@ form_generator.directive('addModalForLinkedModel', function ($modal, Generator)
size: 'lg', size: 'lg',
resolve: { resolve: {
items: function () { items: function () {
debugger;
return Generator.get_form({ return Generator.get_form({
url: 'crud', url: 'crud',
form_params: {'model': scope.form.title, "cmd": "add"} form_params: {'model': scope.form.model_name, "cmd": "add"}
}); });
} }
} }
......
This diff is collapsed.
...@@ -50,12 +50,12 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache", ...@@ -50,12 +50,12 @@ 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 objects[0].data\">{{ key }}</th>\n" + " <th ng-repeat=\"(key,value) in nobjects[0].data\">{{ key }}</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 objects\">\n" + " <tr ng-repeat=\"object in nobjects\">\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" +
......
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