Skip to content

Commit

Permalink
LTE UI
Browse files Browse the repository at this point in the history
finish
  • Loading branch information
taoyu65 committed Aug 26, 2017
1 parent 21bb442 commit 015fa5b
Show file tree
Hide file tree
Showing 26 changed files with 5,766 additions and 2,111 deletions.
2 changes: 1 addition & 1 deletion src/Config/umiEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
'table_id', 'tab_title', 'order', 'created_at', 'updated_at'
],
'umi_table_relation_operation'=> [
'rule_name', 'customer_rule_name', 'operation_type', 'active_table_id', 'active_table_field', 'response_table_id', 'response_table_field', 'check_value', 'check_operation', 'is_extra_operation', 'details', 'created_at', 'updated_at'
'rule_name', 'custom_rule_name', 'operation_type', 'active_table_id', 'active_table_field', 'response_table_id', 'response_table_field', 'check_value', 'check_operation', 'is_extra_operation', 'details', 'created_at', 'updated_at'
],
'umi_tables' => [
'table_name', 'type', 'created_at', 'updated_at'
Expand Down
123 changes: 57 additions & 66 deletions src/Umi/PageBuilder/umiDataTableBuilder_LTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class umiDataTableBuilder_LTE implements dataTableInterface
private $tableName;

#按钮样式 style of button
protected $BtnCssDelete = 'btn btn-sm btn-danger';
protected $BtnCssNew = 'btn btn-sm btn-success';
protected $BtnCssSmallEdit = 'btn btn-xs btn-info';
protected $BtnCssSmallRead = 'btn btn-xs btn-warning';
protected $BtnCssSmallDelete = 'btn btn-xs btn-danger';
protected $BtnCssDelete = 'btn btn-danger btn-flat';
protected $BtnCssNew = 'btn bg-olive btn-flat';
protected $BtnCssSmallEdit = 'btn btn-sm btn-primary btn-flat';
protected $BtnCssSmallRead = 'btn btn-sm btn-warning btn-flat';
protected $BtnCssSmallDelete = 'btn btn-sm btn-danger btn-flat';

#默认数据表主键为id 可以通过继承修改
#default data table's primary key is id, can be changed by inheriting this class
Expand Down Expand Up @@ -71,14 +71,14 @@ public function __construct()
public function tableHeadAlert()
{
$html = <<<UMI
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">
<i class="ace-icon fa fa-times"></i>
</button>
<strong>This is Table's head!</strong>
This alert needs your attention, but it's not super important.
<br />
</div>
<div class="alert bg-olive">
<button type="button" class="close" data-dismiss="alert">
<i class="fa fa-times"></i>
</button>
<strong>This is Table's head!</strong>
This alert needs your attention, but it's not super important.
<br />
</div>
UMI;
return $html;
}
Expand Down Expand Up @@ -229,26 +229,17 @@ public function tableBody()
}
}
$html = <<<UMI
<div class="row">
<div class="col-xs-12">
<table id="dynamic-table" class="table table-striped table-bordered table-hover">
<thead>
<div class="box-body bg-gray-light ">
<div class="row">
<div class="col-sm-12">
<table id="dynamic-table" class="table table-hover">
<tr>
<!--<th class="center">
<label class="pos-rel">
<input type="checkbox" class="ace" />
<span class="lbl"></span>
</label>
</th>-->
$tHeadHtml
<th></th>
</tr>
</thead>
<tbody>
$trBodyHtml
</tbody>
</table>
</table>
</div>
</div>
</div>
UMI;
Expand All @@ -259,23 +250,23 @@ public function tableBody()
public function tableFoot()
{
$html = <<< UMI
<div class="alert alert-block alert-success">
<div class="alert bg-gray-light">
<button type="button" class="close" data-dismiss="alert">
<i class="ace-icon fa fa-times"></i>
<i class="fa fa-times"></i>
</button>
<p>
<strong>
<i class="ace-icon fa fa-check"></i>
<strong class="text-primary">
<i class="fa fa-check"></i>
This is Table's Foot
</strong>
You can customize this footer.<br>
Footer, Header, Body of Table can be different by extending a new class for the a new administrator
</p>
<p>
<button class="btn btn-sm btn-success">Do This</button>
<button class="btn btn-sm btn-info">Or This One</button>
<button class="btn btn-primary btn-flat">Do This</button>
<button class="btn btn-info btn-flat">Or This One</button>
</p>
</div>
UMI;
Expand Down Expand Up @@ -360,37 +351,37 @@ private function breadButtonHtml($recordId, $activeFieldValue)
$buttonSmallEdit = $this->ButtonSmallEdit($recordId, $activeFieldValue);
$buttonSmallRead = $this->ButtonSmallRead($recordId, $activeFieldValue);
$buttonSmallDelete = $this->ButtonSmallDelete($recordId, $activeFieldValue);
$linkHideEdit = $this->LinkHideEdit($recordId, $activeFieldValue);
/*$linkHideEdit = $this->LinkHideEdit($recordId, $activeFieldValue);
$linkHideDelete = $this->LinkHideDelete($recordId, $activeFieldValue);
$linkHideRead = $this->LinkHideRead($recordId, $activeFieldValue);
$linkHideRead = $this->LinkHideRead($recordId, $activeFieldValue);*/

$html = <<<UMI
<td>
<div class="hidden-sm hidden-xs btn-group">
$buttonSmallEdit
$buttonSmallRead
<div class="hidden-sm hidden-xs">
$buttonSmallEdit
$buttonSmallDelete
</div>
$buttonSmallRead
<div class="hidden-md hidden-lg">
<div class="inline pos-rel">
<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
</button>
$buttonSmallDelete
</div>
UMI;
/*<div class="hidden-md hidden-lg">
<div class="inline pos-rel">
<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
</button>
<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
$linkHideRead
<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
$linkHideRead
$linkHideEdit
$linkHideDelete
</ul>
</div>
</div>
</td>
UMI;
</ul>
</div>
</div>
</td>*/

return $html;
}

Expand All @@ -409,7 +400,7 @@ private function ButtonAddHtml($disable = '')
$addUrl = url('adding'). "/$this->tableName";
$html = <<<UMI
<button class="$this->BtnCssNew $disable" $disable type="button" onclick="showAdding('$addUrl');">
<i class="ace-icon fa fa-plus"></i>
<i class="fa fa-plus btn-flat"></i>
New
</button>
UMI;
Expand All @@ -430,9 +421,9 @@ private function ButtonDeleteHtml($disable = '')
{
$html = <<<UMI
<button class="$this->BtnCssDelete $disable" $disable>
<i class="ace-icon fa fa-trash-o"></i>
<i class="fa fa-trash-o"></i>
Delete
</button>
</button>&nbsp;
UMI;
return $html;
}
Expand All @@ -456,8 +447,8 @@ private function ButtonSmallEditHtml($recordId, $activeFieldValue, $disable = ''

$html = <<<UMI
<button class="$this->BtnCssSmallEdit $disable" $disable onclick="showEditing('$editUrl');">
<i class="ace-icon fa fa-pencil bigger-120"></i>
</button>
<i class="fa fa-pencil"></i>
</button>&nbsp;
UMI;
return $html;
}
Expand All @@ -479,8 +470,8 @@ private function ButtonSmallReadHtml($recordId, $activeFieldValue, $disable = ''

$html = <<<UMI
<button class="$this->BtnCssSmallRead $disable" $disable onclick="showReading('$readUrl');">
<i class="ace-icon fa fa-eye bigger-120"></i>
</button>
<i class="fa fa-eye"></i>
</button>&nbsp;
UMI;
return $html;
}
Expand All @@ -505,8 +496,8 @@ private function ButtonSmallDeleteHtml($recordId, $activeFieldValue, $disable =

$html = <<<UMI
<button class="$this->BtnCssSmallDelete $disable" $disable onclick="showDeleting('$deleteUrl');">
<i class="ace-icon fa fa-trash-o bigger-120"></i>
</button>
<i class="fa fa-trash-o"></i>
</button>&nbsp;
UMI;
return $html;
}
Expand Down Expand Up @@ -643,15 +634,15 @@ private function LinkHideDeleteHtml($recordId, $activeFieldValue, $disable = '')
*/
private function wrongMessage($message, $url = '')
{
$showingButton = $url === '' ? '' : '<p><button class="btn btn-sm btn-success">Go Set Up</button> <button class="btn btn-sm">Not Now</button></p>';
$showingButton = $url === '' ? '' : '<p><button class="btn btn-primary btn-flat">Go Set Up</button> <button class="btn btn-primary btn-flat">Not Now</button></p>';

$html = <<<UMI
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">
<i class="ace-icon fa fa-times"></i>
<i class="fa fa-times"></i>
</button>
<strong>
<i class="ace-icon fa fa-times"></i>
<i class="fa fa-times"></i>
Oh whoops!
</strong>
$message
Expand Down
18 changes: 7 additions & 11 deletions src/Umi/PageBuilder/umiFieldDisplayBuilder_LTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function showExistRecords($tableName, $tableId)
}
$url = url('editing') . "/$tableName/$record->id";
$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 .= "<button type='button' class='btn btn-danger btn-flat' onclick='recordDelete(\"$tableName\", \"$record->id\");'>Delete</button></td>";
$TR .= "</tr>";

array_push($existFields, $record->field);
Expand All @@ -57,15 +57,11 @@ public function showExistRecords($tableName, $tableId)

$html = <<<UMI
<input type="hidden" id="existFields" value="$streamExistField">
<table id="simple-table" class="table table-bordered table-hover">
<thead>
<tr>
$TH
</tr>
</thead>
<tbody>
$TR
</tbody>
<table id="simple-table" class="table table-hover">
<tr>
$TH
</tr>
$TR
</table>
<script>
Expand All @@ -77,7 +73,7 @@ public function showExistRecords($tableName, $tableId)
$(this).removeAttr('style');
});
//});
</script>
</script>
UMI;
return $html;
}
Expand Down
42 changes: 19 additions & 23 deletions src/Umi/PageBuilder/umiTableBreadBuilder_LTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ private function rowForEditAdd($record, $defaultValue)

$html =<<<UMI
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2 no-padding-right" for="$name">$title</label>
<div class="col-xs-12 col-sm-4">
<div class="clearfix">
<span >$input</span>
</div>
<label class="control-label col-sm-2" for="$name">$title</label>
<div class="col-sm-4">
<span >$input</span>
</div>
$popover
</div>
Expand All @@ -121,11 +119,9 @@ private function rowForRead($record, $defaultValue)

$html =<<<UMI
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2 no-padding-right" for="$name">$title</label>
<div class="col-xs-12 col-sm-4">
<div class="clearfix">
<span >$input</span>
</div>
<label class="control-label col-sm-2" for="$name">$title</label>
<div class="col-sm-4">
<span >$input</span>
</div>
</div>
Expand All @@ -140,7 +136,7 @@ private function popoverInfo($title, $content)
return '';

$html =<<<UMI
<i class="fa fa-question-circle fa-lg popover-info blue" aria-hidden="true" data-rel="popover"
<i class="fa fa-question-circle fa-lg popover-info fa-primary" aria-hidden="true" data-rel="popover"
data-trigger="hover" style="transform: translate(0,4px);" data-placement="auto right"
title="$title"
data-content="$content"></i>
Expand All @@ -161,9 +157,9 @@ private function buttons($buttonType)
private function buttonCloseForRead()
{
$html = <<<UMI
<button class="btn btn-grey btn-sm btn-next" type="button" id="cls">
<button class="btn btn-danger btn-flat" type="button" id="cls">
Close
<i class="ace-icon fa fa-close"></i>
<i class="fa fa-close"></i>
</button>
UMI;
return $html;
Expand All @@ -172,14 +168,14 @@ private function buttonCloseForRead()
private function buttonEdit()
{
$html = <<<UMI
<button class="btn btn-info btn-sm btn-next" type="submit" id="submitBtn">
<button class="btn bg-olive btn-flat" type="submit" id="submitBtn">
Update
<i class="ace-icon fa fa-refresh"></i>
<i class="fa fa-refresh"></i>
</button>
&nbsp;&nbsp;
<button class="btn btn-grey btn-sm btn-next" type="button" id="cls">
<button class="btn btn-danger btn-flat" type="button" id="cls">
Close
<i class="ace-icon fa fa-close"></i>
<i class="fa fa-close"></i>
</button>
UMI;
return $html;
Expand All @@ -188,14 +184,14 @@ private function buttonEdit()
private function buttonAdd()
{
$html = <<<UMI
<button class="btn btn-success btn-sm btn-next" type="submit" id="submitBtn">
<button class="btn bg-olive btn-flat" type="submit" id="submitBtn">
Add
<i class="ace-icon fa fa-plus"></i>
<i class="fa fa-plus"></i>
</button>
&nbsp;&nbsp;
<button class="btn btn-primary btn-sm btn-next" type="button" id="cls">
<button class="btn btn-danger btn-flat" type="button" id="cls">
Close
<i class="ace-icon fa fa-close"></i>
<i class="fa fa-close"></i>
</button>
UMI;
return $html;
Expand All @@ -207,8 +203,8 @@ private function showingNoRecords()
<div class="alert alert-danger">
You have not set up fields that will be showing here
<br /><br /><p>
<button class="btn btn-sm btn-success" type="button">Go Set Up</button>
<button class="btn btn-sm btn-info" id="cls" type="button">Close</button>
<button class="btn btn-primary btn-flat" type="button">Go Set Up</button>
<button class="btn btn-danger btn-flat" id="cls" type="button">Close</button>
</p>
</div>
UMI;
Expand Down
Loading

0 comments on commit 015fa5b

Please sign in to comment.