|
@@ -369,8 +369,10 @@ class GenController {
|
|
|
// $code[] = "\t\t\$subRecords = DB::table('$foreignTable')->where('$foreignField', \$record->$localField)->get();";
|
|
|
$input[] = "'subRecords'";
|
|
|
}
|
|
|
- $code[] = "\t\treturn view('{$this->root}/{$this->name}/{$method->name}', " .
|
|
|
- "compact(" . implode(", ", $input) . "));";
|
|
|
+ // return response()->view('pro/my_teams/add_new', compact('records'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
|
|
|
+ $code[] = "\t\treturn response()->view('{$this->root}/{$this->name}/{$method->name}', " .
|
|
|
+ "compact(" . implode(", ", $input) . "), " .
|
|
|
+ "session('message') ? 500 : 200)->header('Content-Type', 'text/html');";
|
|
|
}
|
|
|
else {
|
|
|
$loadingLine = [];
|
|
@@ -380,8 +382,9 @@ class GenController {
|
|
|
}
|
|
|
$loadingLine[] = "->get();";
|
|
|
$code[] = implode("", $loadingLine);
|
|
|
- $code[] = "\t\treturn view('{$this->root}/{$this->name}/{$method->name}', " .
|
|
|
- "compact('records'));";
|
|
|
+ $code[] = "\t\treturn response()->view('{$this->root}/{$this->name}/{$method->name}', " .
|
|
|
+ "compact('records'), " .
|
|
|
+ "session('message') ? 500 : 200)->header('Content-Type', 'text/html');";
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -435,6 +438,7 @@ class GenController {
|
|
|
foreach ($controller->methods as $m) {
|
|
|
if($m->type === 'add') {
|
|
|
$addLinks[] = "<a class='btn btn-primary btn-sm ml-2' " .
|
|
|
+ 'up-modal=".form-contents" up-width="800" up-history="false" ' .
|
|
|
"href='/{$controller->name}/{$m->name}'>" .
|
|
|
"<i class='fa fa-plus-circle' aria-hidden='true'></i> " .
|
|
|
"{$this->snakeToTitleCase($m->name)}</a>";
|
|
@@ -518,6 +522,7 @@ class GenController {
|
|
|
$display = $this->camelToTitleCase(substr($meth->name, 7));
|
|
|
$actionLinks[] = ($meth->show ? "@if(\$record->{$meth->show}) " : "") .
|
|
|
"<a " .
|
|
|
+ 'up-modal=".form-contents" up-width="800" up-history="false" ' .
|
|
|
"href='/{$controller->parentControllerName}/view/<?= \$record->uid ?>/{$meth->name}' " .
|
|
|
"class='d-block btn btn-sm btn-default mb-3'>$display</a>" .
|
|
|
($meth->show ? " @endif" : "");
|
|
@@ -571,6 +576,7 @@ class GenController {
|
|
|
|
|
|
if(count($method->data) > 1 && strpos($method->data[1], 'add_new') === 0) {
|
|
|
$addLink = '<a class="btn btn-primary btn-sm" ' .
|
|
|
+ 'up-modal=".form-contents" up-width="800" up-history="false" ' .
|
|
|
'href="{{route(\'' . $method->childAddRoute . '\', [\'uid\' => $record->uid])}}">' .
|
|
|
"<i class='fa fa-plus-circle' aria-hidden='true'></i> Add New</a>";
|
|
|
$text = str_replace("<!-- _ADD_NEW_LINK_ -->", $addLink, $text);
|
|
@@ -755,7 +761,7 @@ class GenController {
|
|
|
case "bool":
|
|
|
$code[] = "<div class='form-group mb-3'>";
|
|
|
$code[] = "<label class='control-label'>{$this->camelToTitleCase($this->snakeToTitleCase($display))} ";
|
|
|
- $code[] = "<input class='form-control' type='checkbox' name='$name'>";
|
|
|
+ $code[] = "<input class='ml-2' type='checkbox' name='$name'>";
|
|
|
$code[] = "</label>";
|
|
|
break;
|
|
|
default:
|