Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue #2 #16

Merged
merged 4 commits into from

1 participant

This page is out of date. Refresh to see the latest.
View
39 articles/templates/article.html
@@ -43,8 +43,45 @@ <h1 class="page-header">{{ article_entity.article.title }} <small>{{ article_ent
<p> {{ para }} </p>
{% endfor %}
- <hr>
+ <hr />
+ <div id="album">
+ <div class="row">
+ {% for pic in pictures %}
+ <div class="col-sm-3">
+ <a class="fancybox" href="{{ pic.image }}"><img src="{{ pic.image }}" class="img-responsive" /></a>
+ <br />
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ <hr />
</div>
+
+ </div>
+ <style type="text/css">
+ .hidden{
+ display: none;
+ }
+ </style>
+ <div id="js">
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $(".fancybox").fancybox();
+ });
+ </script>
+ <script type="text/javascript">
+ $(document).ready(
+ fancy()
+ );
+ function fancy() {
+ $(".fancybox")
+ .attr('rel', 'gallery')
+ .fancybox({
+ padding : 0
+ });
+ }
+ </script>
+ </div>
</div><!-- /.container -->
{% endblock %}
View
9 articles/views.py
@@ -3,7 +3,7 @@
from django.http import HttpResponse
from django.template import Context, loader
-from articles.models import Article, ArticleEntity
+from articles.models import Article, ArticleEntity, Gallery, InGallery, Picture
def index(request):
t = loader.get_template('article_list.html')
@@ -30,4 +30,9 @@ def social(request):
def get_article(request, article_id):
art = get_object_or_404(Article, pk=article_id)
- return render(request, 'article.html', {'article_entity': ArticleEntity(art)})
+ gal_id = art.gallery.id
+ in_gals = InGallery.objects.filter(gallery=gal_id)
+ pics = set()
+ for in_gal in in_gals:
+ pics.add(in_gal.image)
+ return render(request, 'article.html', {'article_entity': ArticleEntity(art), 'pictures': pics})
View
BIN  db.sqlite3
Binary file not shown
View
16 templates/base.html
@@ -12,13 +12,21 @@
<!-- Bootstrap core CSS -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
-
+<link href="http://yandex.st/jquery/fancybox/1.3.4/jquery.fancybox.min.css" rel="stylesheet" />
+
<!-- custom CSS -->
<link href="//www.users.miamioh.edu/rogerskw/thetatau/thetatau-miami.css" rel="stylesheet">
<!-- Favicon -->
<link rel="shortcut icon" href="//www.users.miamioh.edu/rogerskw/thetatau/favicon.ico" type="image/x-icon">
<link rel="icon" href="//www.users.miamioh.edu/rogerskw/thetatau/favicon.ico" type="image/x-icon">
+
+<!-- JavaScript -->
+<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
+<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
+<script src="//www.users.miamioh.edu/rogerskw/thetatau/js/modern-business.js"></script>
+<script type="text/javascript" src="http://yandex.st/jquery/fancybox/1.3.4/jquery.fancybox.min.js"></script>
+<!-- End JavaScript -->
</head>
<body>
@@ -115,12 +123,6 @@
</div>
<!-- /.container -->
{% endblock %}
-
- <!-- JavaScript -->
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
- <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
- <script src="//www.users.miamioh.edu/rogerskw/thetatau/js/modern-business.js"></script>
- <!-- End JavaScript -->
</body>
</html>
Something went wrong with that request. Please try again.