Skip to content

Commit

Permalink
Configure the number of columns (#110)
Browse files Browse the repository at this point in the history
* start work on grid learning

* ability to configure number of columns
  • Loading branch information
bellrichm authored Jul 26, 2023
1 parent e013233 commit aad51fe
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bin/user/jas.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def logerr(msg):
logmsg(syslog.LOG_ERR, msg)


VERSION = "0.4.1-rc01b"
VERSION = "0.4.1-rc01c"

class JAS(SearchList):
""" Implement tags used by templates in the skin. """
Expand Down
2 changes: 1 addition & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import configobj
from weecfg.extension import ExtensionInstaller

VERSION = "0.4.1-rc01b"
VERSION = "0.4.1-rc01c"

EXTENSION_CONFIG = """
[StdReport]
Expand Down
4 changes: 2 additions & 2 deletions skins/jas/generators/body.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
<div class="row">
#end if
#end if
#set global section_global = $section
#if $section in $charts
#set global section_global = $section
#include 'sections/chart.inc'
#set global section_global = None
#else if $include_name is not None
#include $include_name
#else
#include 'sections/' + $section + '.inc'
#end if
#set global section_global = None
#if $layout != 'grid'
</div>
#end if
Expand Down
5 changes: 4 additions & 1 deletion skins/jas/sections/chart.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
## See the file LICENSE.txt for your rights.

#set id = $section_global + $page_name_global
<div class="col-12 col-xl-6 mb-4">
#set grid_cols = $getVar('$Extras.pages.' + $page + '.' + $section_global + '.grid_cols',
$getVar('$Extras.pages.' + $page + '.grid_cols',
$getVar('$Extras.grid_cols')))
<div class="$grid_cols">
<div class="card">
<div class="card-body text-center">
#set text_label = False
Expand Down
7 changes: 5 additions & 2 deletions skins/jas/sections/current.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Copyright (c) 2021-2022 Rich Bell <bellrichm@gmail.com>
## Copyright (c) 2021-2023 Rich Bell <bellrichm@gmail.com>
## See the file LICENSE.txt for your rights.

<div class="col-12 col-xl-6 mb-4">
#set grid_cols = $getVar('$Extras.pages.' + $page + '.' + $section_global + '.grid_cols',
$getVar('$Extras.pages.' + $page + '.grid_cols',
$getVar('$Extras.grid_cols')))
<div class="$grid_cols">
<div class="card">
<div class="card-body text-center">
#if $getVar('$Extras.current.observation', False)
Expand Down
7 changes: 5 additions & 2 deletions skins/jas/sections/minmax.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Copyright (c) 2021 Rich Bell <bellrichm@gmail.com>
## Copyright (c) 2021-2023 Rich Bell <bellrichm@gmail.com>
## See the file LICENSE.txt for your rights.

<div class="col-12 col-xl-6 mb-4">
#set grid_cols = $getVar('$Extras.pages.' + $page + '.' + $section_global + '.grid_cols',
$getVar('$Extras.pages.' + $page + '.grid_cols',
$getVar('$Extras.grid_cols')))
<div class="$grid_cols">
<div class="card">
<div class="card-body text-center">
<h5 class="card-title" text_label="minmax_title"></h5>
Expand Down
7 changes: 5 additions & 2 deletions skins/jas/sections/radar.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Copyright (c) 2021 Rich Bell <bellrichm@gmail.com>
## Copyright (c) 2021-2023 Rich Bell <bellrichm@gmail.com>
## See the file LICENSE.txt for your rights.

<div class="col-12 col-xl-6 mb-4">
#set grid_cols = $getVar('$Extras.pages.' + $page + '.' + $section_global + '.grid_cols',
$getVar('$Extras.pages.' + $page + '.grid_cols',
$getVar('$Extras.grid_cols')))
<div class="$grid_cols">
<div class="card">
<div class="card-body text-center">
<h5 class="card-title" text_label="radar_title"></h5>
Expand Down
7 changes: 5 additions & 2 deletions skins/jas/sections/thisdate.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Copyright (c) 2021-2022 Rich Bell <bellrichm@gmail.com>
## Copyright (c) 2021-2023 Rich Bell <bellrichm@gmail.com>
## See the file LICENSE.txt for your rights.

<div class="col-12 col-xl-6 mb-4">
#set grid_cols = $getVar('$Extras.pages.' + $page + '.' + $section_global + '.grid_cols',
$getVar('$Extras.pages.' + $page + '.grid_cols',
$getVar('$Extras.grid_cols')))
<div class="$grid_cols">
<div class="card">
<div class="card-body text-center">
<h5 class="card-title" text_label="thisdate_title"></h5>
Expand Down
1 change: 1 addition & 0 deletions skins/jas/skin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SKIN_VERSION = 0.3.2-rc01a
echarts_version = 5.3.3

navbar_collapse = 768
grid_cols = "col-12 col-xl-6 mb-4"

[[mqtt]]
enable = false
Expand Down

0 comments on commit aad51fe

Please sign in to comment.