Use settings to control youtube live conference

This commit is contained in:
Zakary Timson 2018-01-23 21:10:16 -05:00
parent 7cdd27119c
commit d2a3fcce63
3 changed files with 24 additions and 18 deletions

View File

@ -147,3 +147,5 @@ STATIC_URL = '/static/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
YOUTUBE_CONFERENCE = 'https://www.youtube.com/embed/m2YpX4Fma2c'

View File

@ -4,8 +4,10 @@
{% block head %}
<script>
$(function() {
// Show modal for live youtube confrence
// $('#liveModal').modal('show')''
// Show modal for live youtube conference
{% if youtube %}
$('#liveModal').modal('show');
{% endif %}
$('#top').click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
@ -218,22 +220,24 @@
</a>
</div>
<div id="liveModal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel"><i class="fa fa-circle text-danger"></i> Live Conference</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<iframe width="100%" height="400px" src="" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
{% if youtube %}
<div id="liveModal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel"><i class="fa fa-circle text-danger"></i> Live Conference</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<iframe width="100%" height="400px" src="{{ youtube }}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}

View File

@ -14,7 +14,7 @@ from OACPL import settings
def index(request):
attorneys = Attorney.objects.filter(front_page=True).order_by('order')
return render(request, 'index.html', {'attorneys': attorneys, 'contact': settings.EMAIL_CONTACT})
return render(request, 'index.html', {'attorneys': attorneys, 'contact': settings.EMAIL_CONTACT, 'youtube': settings.YOUTUBE_CONFERENCE})
def contact(request):