Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiding regular hours by default #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion ocfweb/docs/templates/docs/lab.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ <h2 id="hours">Hours</h2>
</div>


<h3>Regular Weekly Hours</h3>
<h3>Regular Weekly Hours</h3>
<button class = "btn btn-primary" id = "weekly_hours_btn" onclick="toggle_weekly_hours()" style="opacity:0.3;">Show</button>
<div id = "weekly_hours" style="display:none;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird spacing around some of the = signs

<p>The regular OCF hours are:</p>
<div class="row">
<div class="col-sm-8">
Expand All @@ -86,6 +88,7 @@ <h3>Regular Weekly Hours</h3>
</table>
</div>
</div>
</div>

{% if holidays %}
<h3 id="holidays">{{semester}} Holidays</h3>
Expand Down Expand Up @@ -131,4 +134,19 @@ <h4 id="walkthrough">Having trouble finding the entrance?</h4>
</video>
</div>
</div>

<script>
function toggle_weekly_hours() {
var change = document.getElementById("weekly_hours_btn");
if (change.innerHTML == "Show")
{
change.innerHTML = "Hide";
$("#weekly_hours").show();
}
else {
change.innerHTML = "Show";
$("#weekly_hours").hide();
}
}
</script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use something from Bootstrap instead of reinventing it ourselves?

https://getbootstrap.com/docs/3.3/javascript/#collapse-example looks like basically what you want. Plus we get nice transitions this way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(to clarify, we already have all the bootstrap css/js, so it should be as simple as adding the right classes and hooking things up; the example there should help)

{% endblock %}