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
b974e25e
Commit
b974e25e
authored
Mar 13, 2020
by
Alan Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hiding controls for energy reports as appropriate.
parent
dad1199b
Changes
3
Show 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 @
b974e25e
...
...
@@ -56,11 +56,20 @@ 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.
...
...
@@ -69,6 +78,11 @@ update_report_list = ->
# 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
report_info
=
$
(
this
).
attr
(
"href"
).
substring
(
1
)
...
...
@@ -121,3 +135,8 @@ $ ->
$
(
"#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 @
b974e25e
...
...
@@ -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
();
}
};
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 @
b974e25e
...
...
@@ -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
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"
>
</div>
<div
class=
"row mx-2"
>
<iframe
id=
"report-content"
src=
""
width=
"100%"
height=
"750px"
></iframe>
</div>
</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