-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from omalley1/master
Looks good to me.
- Loading branch information
Showing
3 changed files
with
89 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<div class="slide" id="landing-slide"> | ||
<!-- Clock Widget --> | ||
<div class="panel2" id="time"> | ||
<div class="icon"> | ||
<div id="clock"> | ||
</div> | ||
</div> | ||
<div class="widget-content2"> | ||
<h1>N/A</h1></br> | ||
<h2>N/A</h2> | ||
</div> | ||
</div> | ||
<!-- End Clock Widget --> | ||
|
||
<!-- Weather Widget--> | ||
<div class="panel2" id="weather"> | ||
<div class="icon"> | ||
<img src="{{ STATIC_URL }}img/no_icon.png"></img> | ||
</div> | ||
<div class="widget-content2"> | ||
<h1 class="temp">N/A</h1><br /> | ||
<h2 class="description">Unavailable</h2> | ||
</div> | ||
</div> | ||
<!-- End Weather Widget--> | ||
|
||
<!-- Nextbus Widget --> | ||
<div class="panel2" id="nextbus"> | ||
<div class="icon"> | ||
<img src="{{ STATIC_URL }}img/bus.png"></img> | ||
</div> | ||
<div class="widget-content2"> | ||
<h1 class="next">N/A</h1><br /> | ||
<h2><span class="second">N/A</span> <span class="third">N/A</span></h2> | ||
</div> | ||
</div> | ||
<!-- End Nextbus Widget--> | ||
|
||
<!-- Events Widget --> | ||
<div class="panel3" id="events"> | ||
<div class="icon"> | ||
<img src="{{ STATIC_URL }}img/events.png"></img> | ||
</div> | ||
<div class="widget-content3"> | ||
<h2 class="title">Unavailable</h2><br/> | ||
<h2 class="time">N/A</h2> | ||
</div> | ||
</div> | ||
<!-- End Events Widget --> | ||
|
||
<!-- News Widget --> | ||
<div class="panel3" id="news"> | ||
<div class="icon"> | ||
<img src="{{ STATIC_URL }}img/BBC.png"></img> | ||
</div> | ||
<div class="widget-content3"> | ||
<h2 class="title">Unavailable</h2> | ||
</div> | ||
</div> | ||
<!-- End News Widget --> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
from django.template import RequestContext | ||
from django.shortcuts import render_to_response | ||
from django.shortcuts import render_to_response, render | ||
import requests | ||
|
||
def home(request): | ||
return render_to_response('index.html', context_instance = RequestContext(request)) | ||
class Slide(): | ||
def __init__(self, slide_type, path="NA"): | ||
# slide_type is of WIDGET or POSTER | ||
self.stype = slide_type | ||
self.path = path | ||
|
||
slides = [] | ||
img_urls = requests.get("https://adat.scripts.mit.edu:444/www/dev/simmons/display/dashboard.php").json() | ||
|
||
# naively insert a widget slide after every 2 images | ||
for i in range(len(img_urls)): | ||
if i % 2: | ||
slides.append(Slide("WIDGET")) | ||
slides.append(Slide("POSTER", img_urls[i])) | ||
|
||
return render(request, "index.html", {"slides": slides}) | ||
|
||
def sevenk(request): | ||
return render_to_response('sevenk.html', context_instance = RequestContext(request)) |