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_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/' MEDIA_URL = '/media/'
YOUTUBE_CONFERENCE = 'https://www.youtube.com/embed/m2YpX4Fma2c'

View File

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

View File

@ -14,7 +14,7 @@ from OACPL import settings
def index(request): def index(request):
attorneys = Attorney.objects.filter(front_page=True).order_by('order') 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): def contact(request):