This file contains hidden or 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
<div class="item"> | |
<ul> | |
<li class = "big_title"><b>More Information: <a href = "{% url 'cafe' cafe.url %}">{{cafe.cafe}}</a></li> | |
</ul> | |
</div> |
This file contains hidden or 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
url(r'^cafe/(?P<location>[a-z0-9\-]+)/$', views.cafe, name='cafe'), |
This file contains hidden or 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
def cafe(request, location): | |
city = City.objects.get(cafe__url=location) | |
exhibits = CafeExhibit.objects.filter(cafeName__url=location) | |
cafe = Cafe.objects.get(url=location) | |
Context = {'exhibits':exhibits,'cafe':cafe, 'city':city} | |
return render(request,'jewish_cafes/cafe.html', Context) |
This file contains hidden or 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
<div align="center"> | |
<img class="cafe_thumbnail" src="/media/{{cafe.file_up}}"/> | |
</div> |
This file contains hidden or 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
class Cafe(models.Model): | |
cafe = models.TextField() | |
<!--Below is where the image upload is located in the model--> | |
file_up = models.FileField(blank=True) | |
url = AutoSlugField(populate_from='cafe', editable=True,unique=True, blank=True) | |
cityName = models.ForeignKey(City) | |
established = models.CharField(max_length=10, blank=True) | |
latitude = models.DecimalField(max_digits= 7, decimal_places=4) |
This file contains hidden or 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
from django.contrib import admin | |
from django.contrib.auth.models import User | |
from django.contrib.auth.admin import UserAdmin | |
from django.contrib.admin import AdminSite | |
from .models import Map, City, Cafe, Person, Item, CafeExhibit | |
admin.site.register(Map) | |
admin.site.register(City) | |
admin.site.register(Cafe, CafeAdmin) |
This file contains hidden or 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
<!--Use the 'if' statement to call the class in the model you'd like to display--> | |
{% if cafes %} | |
<!--Use the 'for' statement to iterate through the model--> | |
{% for cafe in cafes %} | |
<div class = "col-xs-12"> | |
<!--This line of code creates multiple rows.--> | |
<div class="{% cycle 'row1' 'row2' %}"> | |
<div class="item"> | |
<div align="center"> | |
<img class="cafe_thumbnail" src="/media/{{cafe.file_up}}"/> |
This file contains hidden or 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
<div class="{% cycle 'row1' 'row2' %}"> | |
#Put the code you want to iterate through here | |
</div> |
This file contains hidden or 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
{% block content %} | |
<!--The line below calls the class where my gallery images are located--> | |
{% if exhibit %} | |
<div class= "container_special"> | |
<!--The forloop counter tells the gallery code which slide to start with. If you want the first one then start with '0' like below--> | |
<div id="carousel-generic" class="carousel slide" data-ride="carousel" data-interval="0" data-slide-to="{{forloop.counter0}}"> | |
<!-- Wrapper for slides --> | |
<div class="carousel-inner" role="listbox"> | |
<!--These lines tell the items in exhibit to be active until they run out of content i.e. images--> | |
{% for item in items %} |
This file contains hidden or 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
{% load staticfiles %} | |
{% block content %} | |
<div class="spacer2"></div> | |
<div class="container_special"> | |
<div class="jumbotron specialjum"> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<link href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" media="screen, print" rel="stylesheet"> | |
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
<body> | |
<!--This is the open street map that's being used from Leaflet--> |