Skip to content

Commit

Permalink
LTE UI
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyu65 committed Aug 23, 2017
1 parent ec29606 commit ab04a4f
Show file tree
Hide file tree
Showing 12 changed files with 299 additions and 344 deletions.
8 changes: 4 additions & 4 deletions src/Routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

$existFields = DB::table($fieldTable)->where('table_id', $tableId)->pluck('field')->toArray();
$re = [];
$allFields->map(function ($key) use ($existFields, &$re) {
if (!in_array($key, $existFields)) {
array_push($re, $key);
foreach ($allFields as $field) {
if (!in_array($field, $existFields)) {
array_push($re, $field);
}
});
}
return $re;
});

Expand Down
12 changes: 6 additions & 6 deletions src/Umi/PageBuilder/umiFieldDisplayBuilder_LTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ public function showExistRecords($tableName, $tableId)
$TR .= "<td>$value</td>";
}
$url = url('editing') . "/$tableName/$record->id";
$TR .= "<td><button type='button' class='btn btn-mini btn-success' onclick='showEditing(\"$url\");'>Edit</button> ";
$TR .= "<button type='button' class='btn btn-mini btn-danger' onclick='recordDelete(\"$tableName\", \"$record->id\");'>Delete</button></td>";
$TR .= "<td><button type='button' class='btn btn-success btn-flat' onclick='showEditing(\"$url\");'>Edit</button> ";
$TR .= "<button type='button' class='btn btn btn-danger btn-flat' onclick='recordDelete(\"$tableName\", \"$record->id\");'>Delete</button></td>";
$TR .= "</tr>";

array_push($existFields, $record->field);
}

$bgColor = '#c7ffcd';
if (strstr($tableName, 'browser')) {
$bgColor = '#c7ffcd';
$bgColor = '#5AC594';
} else if (strstr($tableName, 'add')) {
$bgColor = '#B497FB';
$bgColor = '#E27D71';
} else if (strstr($tableName, 'edit')) {
$bgColor = '#FFF90B';
$bgColor = '#F7BF65';
} else if (strstr($tableName, 'read')) {
$bgColor = '#5D98FB';
$bgColor = '#80B5D3';
}

$streamExistField = base64_encode(json_encode($existFields));
Expand Down
36 changes: 18 additions & 18 deletions src/Umi/PageBuilder/umiNestableBuilder_LTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function showDragDropTree($tableName, $showButton = false, $buttonExcepti
$this->relationOperationRuleList = $TRO->getRulesForConfirmation($tableId);

$html = '';
$html .= '<div class="dd dd-draghandle" id="nestableMenu">';
$html .= '<div class="dd" id="nestableMenu">';
$html .= $this->menuManagement($showButton, $buttonException);
$html .= '</div>';

Expand All @@ -43,7 +43,7 @@ public function showDragDropTree($tableName, $showButton = false, $buttonExcepti
public function showDragDropTreeByJson($jsonArr)
{
$html = '';
$html .= '<div class="dd dd-draghandle" id="nestableUser">';
$html .= '<div class="dd" id="nestableUser">';
$html .= $this->createUserTree($jsonArr);
$html .= '</div>';

Expand All @@ -67,9 +67,9 @@ private function createUserTree($jsonArr)
$html .= $LI =<<<UMI
<li class="dd-item dd2-item" data-id="$record->id">
<div class="dd-handle dd2-handle">
<i class="normal-icon ace-icon fa $record->icon_class bigger-130"></i>
<i class="normal-icon fa $record->icon_class"></i>
<i class="drag-icon ace-icon fa fa-arrows bigger-125"></i>
<i class="drag-icon fa fa-arrows"></i>
</div>
<div class="dd2-content">
$record->title
Expand Down Expand Up @@ -106,9 +106,9 @@ private function menuManagement($showButton = false, $buttonException = [], $men
$html .= $LI =<<<UMI
<li class="dd-item dd2-item" data-id="$itemId">
<div class="dd-handle dd2-handle">
<i class="normal-icon ace-icon fa $iconClass bigger-130"></i>
<i class="normal-icon fa $iconClass"></i>
<i class="drag-icon ace-icon fa fa-arrows bigger-125"></i>
<i class="drag-icon fa fa-arrows"></i>
</div>
<div class="dd2-content">
$title
Expand Down Expand Up @@ -140,45 +140,45 @@ private function breadButton($itemId, $menuId, $parameterField, $buttonException

#add
if (in_array('add', $buttonException)) {
$html .= '<a class="grey" href="#" style="cursor: not-allowed">
<i class="ace-icon fa fa-plus bigger-130"></i>
$html .= '<a class="fa-gray" href="#" style="cursor: not-allowed">
<i class="fa fa-plus"></i>
</a>';
} else {
$html .= '<a class="green" href="#" onclick="showAdding(\'' . $addUrl . '\')">';
$html .= ' <i class="ace-icon fa fa-plus bigger-130"></i>';
$html .= ' <i class="fa fa-plus"></i>';
$html .= '</a>';
}

#browser
if (in_array('browser', $buttonException)) {
$html .= '<a class="grey" href="#" style="cursor: not-allowed">
<i class="ace-icon fa fa-eye bigger-130"></i>
$html .= '<a class="fa-gray" href="#" style="cursor: not-allowed">
<i class="fa fa-eye"></i>
</a>';
} else {
$html .= '<a class="orange" href="#" onclick="showReading(\'' . $readUrl . '\')">
<i class="ace-icon fa fa-eye bigger-130"></i>
<i class="fa fa-eye"></i>
</a>';
}

#edit
if (in_array('edit', $buttonException)) {
$html .= '<a class="grey" href="#" style="cursor: not-allowed">
<i class="ace-icon fa fa-pencil bigger-130"></i>
$html .= '<a class="fa-gray" href="#" style="cursor: not-allowed">
<i class="fa fa-pencil"></i>
</a>';
} else {
$html .= '<a class="blue" href="#" onclick="showEditing(\'' . $editUrl . '\')">
<i class="ace-icon fa fa-pencil bigger-130"></i>
<i class="fa fa-pencil"></i>
</a>';
}

#delete
if (in_array('delete', $buttonException)) {
$html .= '<a class="grey" href="#" style="cursor: not-allowed">
<i class="ace-icon fa fa-trash-o bigger-130"></i>
$html .= '<a class="fa-gray" href="#" style="cursor: not-allowed">
<i class="fa fa-trash-o"></i>
</a>';
} else {
$html .= '<a class="red" href="#" onclick="showDeleting(\'' . $deleteUrl . '\')">';
$html .= ' <i class="ace-icon fa fa-trash-o bigger-130"></i>';
$html .= ' <i class="fa fa-trash-o"></i>';
$html .= '</a>';
}
$html .= '</div>';
Expand Down
5 changes: 5 additions & 0 deletions src/resources/assets/lte/js/jquery.nestable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ab04a4f

Please sign in to comment.