Browse Source

Fix sidebars on mobile, responsive table

Vova Tkach 6 years ago
parent
commit
2bfd5b0fd2

+ 8 - 10
assets/cp.styles.css

@@ -136,16 +136,8 @@ body.cp .wrap .content {
 	vertical-align: top;
 }
 
-body.cp .wrap .sidebar {
-	display: none;
-}
-
-body.cp.cp-sidebar-left .wrap .sidebar.sidebar-left {
-	display: table-cell;
-}
-
-body.cp.cp-sidebar-right .wrap .sidebar.sidebar-right {
-	display: table-cell;
+body.cp .wrap .sidebar.sidebar-right {
+	display: none!important;
 }
 
 body.cp .wrap .sidebar-right .padd,
@@ -382,6 +374,12 @@ body.cp .wrap .sidebar.sidebar-left ul.nav li.nav-item svg.sicon {
 }
 
 /* Mobile fixes */
+@media (min-width: 992px) {
+	body.cp.cp-sidebar-right .wrap .sidebar.sidebar-right.d-lg-table-cell {
+		display: table-cell!important;
+	}
+}
+
 @media (max-width: 575px) {
 	/* Less then 576px */
 	body.cp {

File diff suppressed because it is too large
+ 0 - 0
assets/cp.styles.css.go


+ 1 - 1
consts/consts.go

@@ -5,7 +5,7 @@ import (
 )
 
 const ServerVersion = "1.0.0"
-const AssetsVersion = "9"
+const AssetsVersion = "10"
 const AssetsPath = "assets"
 const DirIndexFile = "index.html"
 

+ 4 - 3
engine/builder/data_table.go

@@ -13,6 +13,7 @@ type DataTableRow struct {
 	DBField     string
 	DBExp       string
 	NameInTable string
+	Classes     string
 	CallBack    func(values *[]string) string
 }
 
@@ -47,7 +48,7 @@ func DataTable(wrap *wrapper.Wrapper, table string, order_by string, order_way s
 	sql := "SELECT"
 	for i, column := range *data {
 		if column.NameInTable != "" {
-			result += `<th scope="col" class="col_` + column.DBField + `">` + html.EscapeString(column.NameInTable) + `</th>`
+			result += `<th scope="col" class="col_` + column.DBField + ` ` + column.Classes + `">` + html.EscapeString(column.NameInTable) + `</th>`
 		}
 		if column.DBExp == "" {
 			sql += " `" + column.DBField + "`"
@@ -80,9 +81,9 @@ func DataTable(wrap *wrapper.Wrapper, table string, order_by string, order_way s
 					for i, val := range values {
 						if (*data)[i].NameInTable != "" {
 							if (*data)[i].CallBack == nil {
-								result += `<td class="col_` + (*data)[i].DBField + `">` + html.EscapeString(string(val)) + `</td>`
+								result += `<td class="col_` + (*data)[i].DBField + ` ` + (*data)[i].Classes + `">` + html.EscapeString(string(val)) + `</td>`
 							} else {
-								result += `<td class="col_` + (*data)[i].DBField + `">` + (*data)[i].CallBack(&values) + `</td>`
+								result += `<td class="col_` + (*data)[i].DBField + ` ` + (*data)[i].Classes + `">` + (*data)[i].CallBack(&values) + `</td>`
 							}
 						}
 					}

+ 2 - 0
modules/module_index.go

@@ -115,6 +115,7 @@ func (this *Modules) RegisterModule_Index() *Module {
 					DBField:     "datetime",
 					DBExp:       "UNIX_TIMESTAMP(`datetime`)",
 					NameInTable: "Date / Time",
+					Classes:     "d-none d-sm-table-cell",
 					CallBack: func(values *[]string) string {
 						t := int64(utils.StrToInt((*values)[3]))
 						return `<div>` + utils.UnixTimestampToFormat(t, "02.01.2006") + `</div>` +
@@ -124,6 +125,7 @@ func (this *Modules) RegisterModule_Index() *Module {
 				{
 					DBField:     "active",
 					NameInTable: "Active",
+					Classes:     "d-none d-sm-table-cell",
 					CallBack: func(values *[]string) string {
 						return builder.CheckBox(utils.StrToInt((*values)[4]))
 					},

+ 2 - 0
modules/module_users.go

@@ -58,6 +58,7 @@ func (this *Modules) RegisterModule_Users() *Module {
 				{
 					DBField:     "active",
 					NameInTable: "Active",
+					Classes:     "d-none d-sm-table-cell",
 					CallBack: func(values *[]string) string {
 						return builder.CheckBox(utils.StrToInt((*values)[4]))
 					},
@@ -65,6 +66,7 @@ func (this *Modules) RegisterModule_Users() *Module {
 				{
 					DBField:     "admin",
 					NameInTable: "Admin",
+					Classes:     "d-none d-sm-table-cell",
 					CallBack: func(values *[]string) string {
 						return builder.CheckBox(utils.StrToInt((*values)[5]))
 					},

Some files were not shown because too many files changed in this diff