Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
B
bmon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
energy
bmon
Commits
0b88e57f
Commit
0b88e57f
authored
Mar 13, 2020
by
Alan Mitchell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'essential'
parents
1e33f8a0
b974e25e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
20 deletions
+53
-20
bmsapp/static/bmsapp/scripts/energy-reports.coffee
bmsapp/static/bmsapp/scripts/energy-reports.coffee
+24
-5
bmsapp/static/bmsapp/scripts/energy-reports.js
bmsapp/static/bmsapp/scripts/energy-reports.js
+17
-3
bmsapp/templates/bmsapp/energy-reports.html
bmsapp/templates/bmsapp/energy-reports.html
+12
-12
No files found.
bmsapp/static/bmsapp/scripts/energy-reports.coffee
View file @
0b88e57f
...
...
@@ -56,18 +56,32 @@ update_report_list = ->
$
(
"#report-tab-list"
).
append
html
# Add building reports if this building is in the list
# Track # of reports.
rpt_count
=
0
if
_bldg_reports
[
bldg
]
?
add_report
(
rpt
,
"B"
)
for
rpt
in
_bldg_reports
[
bldg
]
rpt_count
+=
1
# Add Organization reports if this building is in the list
if
_org_reports
[
org
]
?
add_report
(
rpt
,
"O"
)
for
rpt
in
_org_reports
[
org
]
rpt_count
+=
1
if
rpt_count
>
0
$
(
"#report-tabs"
).
show
()
$
(
"#iframe-related"
).
show
()
# add a handler for the click event on all of the a links associated
# with the tabs.
$
(
"#report-tab-list a"
).
click
load_report
# add a handler for the click event on all of the a links associated
# with the tabs.
$
(
"#report-tab-list a"
).
click
load_report
# Select the first tab
$
(
"#report-tab-list a:first"
).
addClass
(
"active"
).
click
()
# Select the first tab
$
(
"#report-tab-list a:first"
).
addClass
(
"active"
).
click
()
else
# No reports, so hide tabs and iFrame
$
(
"#report-tabs"
).
hide
()
$
(
"#iframe-related"
).
hide
()
load_report
=
->
# href attribute contains info about where the report is located
...
...
@@ -120,4 +134,9 @@ $ ->
$
(
"#select_org"
).
change
update_bldg_list
$
(
"#select_org"
).
change
update_report_list
$
(
"#select_bldg"
).
change
update_report_list
else
$
(
"#bldg-selection"
).
hide
()
$
(
"#report-tabs"
).
hide
()
$
(
"#iframe-related"
).
hide
()
\ No newline at end of file
bmsapp/static/bmsapp/scripts/energy-reports.js
View file @
0b88e57f
...
...
@@ -31,7 +31,7 @@
};
update_report_list
=
function
()
{
var
add_report
,
bldg
,
i
,
j
,
len
,
len1
,
org
,
ref
,
ref1
,
rpt
;
var
add_report
,
bldg
,
i
,
j
,
len
,
len1
,
org
,
ref
,
ref1
,
rpt
,
rpt_count
;
org
=
$
(
"
#select_org
"
).
val
();
bldg
=
$
(
"
#select_bldg
"
).
val
();
$
(
"
#report-tab-list
"
).
empty
();
...
...
@@ -40,12 +40,14 @@
html
=
"
<li class=
\"
nav-item
\"
>
\n
<a class=
\"
nav-link
\"
data-toggle=
\"
tab
\"
href=
\"
#
"
+
rpt_type
+
"
-
"
+
rpt
.
file_name
+
"
\"
role=
\"
tab
\"
>
"
+
rpt
.
title
+
"
</a>
\n
</li>
"
;
return
$
(
"
#report-tab-list
"
).
append
(
html
);
};
rpt_count
=
0
;
if
(
_bldg_reports
[
bldg
]
!=
null
)
{
ref
=
_bldg_reports
[
bldg
];
for
(
i
=
0
,
len
=
ref
.
length
;
i
<
len
;
i
++
)
{
rpt
=
ref
[
i
];
add_report
(
rpt
,
"
B
"
);
}
rpt_count
+=
1
;
}
if
(
_org_reports
[
org
]
!=
null
)
{
ref1
=
_org_reports
[
org
];
...
...
@@ -53,9 +55,17 @@
rpt
=
ref1
[
j
];
add_report
(
rpt
,
"
O
"
);
}
rpt_count
+=
1
;
}
if
(
rpt_count
>
0
)
{
$
(
"
#report-tabs
"
).
show
();
$
(
"
#iframe-related
"
).
show
();
$
(
"
#report-tab-list a
"
).
click
(
load_report
);
return
$
(
"
#report-tab-list a:first
"
).
addClass
(
"
active
"
).
click
();
}
else
{
$
(
"
#report-tabs
"
).
hide
();
return
$
(
"
#iframe-related
"
).
hide
();
}
$
(
"
#report-tab-list a
"
).
click
(
load_report
);
return
$
(
"
#report-tab-list a:first
"
).
addClass
(
"
active
"
).
click
();
};
load_report
=
function
()
{
...
...
@@ -105,6 +115,10 @@
$
(
"
#select_org
"
).
change
(
update_bldg_list
);
$
(
"
#select_org
"
).
change
(
update_report_list
);
return
$
(
"
#select_bldg
"
).
change
(
update_report_list
);
}
else
{
$
(
"
#bldg-selection
"
).
hide
();
$
(
"
#report-tabs
"
).
hide
();
return
$
(
"
#iframe-related
"
).
hide
();
}
});
...
...
bmsapp/templates/bmsapp/energy-reports.html
View file @
0b88e57f
...
...
@@ -22,9 +22,7 @@
<h5><i>
{{ error_message }}
</i></h5>
<div
id=
"debug-out"
></div>
<div
class=
"row mx-1"
>
<div
id=
"bldg-selection"
class=
"row mx-1"
>
<form
class=
"form-inline"
>
<label
class=
"mr-2"
for=
"select_bldg"
id=
"label_bldg"
"
>
Facility:
</label>
<select
class=
"form-control"
id=
"select_bldg"
name=
"select_bldg"
>
...
...
@@ -34,7 +32,7 @@
<hr/>
<div
class=
"row mx-1 mt-3"
>
<div
id=
"report-tabs"
class=
"row mx-1 mt-3"
>
<ul
id=
"report-tab-list"
class=
"nav nav-tabs flex-wrap"
role=
"tablist"
>
</ul>
</div>
...
...
@@ -42,15 +40,17 @@
{% endblock %}
{% block fullwidth %}
<div
class=
"row mt-3 mx-2"
>
<div
class=
"col"
>
<a
id=
"print-link"
href=
""
class=
"float-right"
target=
"_blank"
>
Click Here for Printable Report View
</a>
<div
id=
"iframe-related"
>
<div
class=
"row mt-3 mx-2"
>
<div
class=
"col"
>
<a
id=
"print-link"
href=
""
class=
"float-right"
target=
"_blank"
>
Click Here for Printable Report View
</a>
</div>
</div>
<div
class=
"row mx-2"
>
<iframe
id=
"report-content"
src=
""
width=
"100%"
height=
"750px"
></iframe>
</div>
</div>
<div
class=
"row mx-2"
>
<iframe
id=
"report-content"
src=
""
width=
"100%"
height=
"750px"
></iframe>
</div>
{% endblock %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment