When random-thumbnail image is clicked, modal dialog is shown
This commit is contained in:
parent
15e7c8c72c
commit
cb3bb2ffe3
|
@ -9,13 +9,47 @@
|
||||||
<script src="{{ STATIC_URL }}js/jquery-1.8.2.min.js"></script>
|
<script src="{{ STATIC_URL }}js/jquery-1.8.2.min.js"></script>
|
||||||
<script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
|
<script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
|
||||||
<title>{% block page_title %}Collec' de cart'{% endblock %}</title>
|
<title>{% block page_title %}Collec' de cart'{% endblock %}</title>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
// When DOM is ready, select the container element and call the jQCloud method, passing the array of words as the first argument.
|
||||||
|
$("a.thumbnail, a.randomized").click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
$('#modalDisplay').modal();
|
||||||
|
|
||||||
|
var request = $.ajax({
|
||||||
|
url: $(this).attr('href'),
|
||||||
|
type: 'GET',
|
||||||
|
dataType: 'html'
|
||||||
|
});
|
||||||
|
|
||||||
|
request.done(function(result) {
|
||||||
|
$('#modalDisplay').html(result);
|
||||||
|
});
|
||||||
|
|
||||||
|
request.fail(function(jqxhr, textStatus) {
|
||||||
|
$('#modalDisplay').html('La requête a foiré: ' + textStatus);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('legend').click(function(){
|
||||||
|
$(this).parent().find('.content').slideToggle("slow");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<div id="modalDisplay" class="modal large hide fade">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<header>
|
<header>
|
||||||
<div style="padding-bottom: 1em;">
|
<div style="padding-bottom: 1em;">
|
||||||
{% random_pics %}<!--<a href="/"><img src="{{STATIC_URL}}img/header.png" alt="Ma collection de télécartes" /></a>-->
|
{% random_pics %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ul class="nav nav-pills menu">
|
<ul class="nav nav-pills menu">
|
||||||
|
|
|
@ -1,40 +1,5 @@
|
||||||
{% load image_tags %}
|
{% load image_tags %}
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
// When DOM is ready, select the container element and call the jQCloud method, passing the array of words as the first argument.
|
|
||||||
$("a.thumbnail").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
$('#modalDisplay').modal();
|
|
||||||
|
|
||||||
var request = $.ajax({
|
|
||||||
url: $(this).attr('href'),
|
|
||||||
type: 'GET',
|
|
||||||
dataType: 'html'
|
|
||||||
});
|
|
||||||
|
|
||||||
request.done(function(result) {
|
|
||||||
$('#modalDisplay').html(result);
|
|
||||||
});
|
|
||||||
|
|
||||||
request.fail(function(jqxhr, textStatus) {
|
|
||||||
$('#modalDisplay').html('La requête a foiré: ' + textStatus);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('legend').click(function(){
|
|
||||||
$(this).parent().find('.content').slideToggle("slow");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="modalDisplay" class="modal large hide fade">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="thumbnails">
|
<ul class="thumbnails">
|
||||||
{% for card in cards_list %}
|
{% for card in cards_list %}
|
||||||
<li class="span2">
|
<li class="span2">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div style="margin: auto; width: 85%:">
|
<div style="margin: auto; width: 85%:">
|
||||||
{% for card in random_pics %}
|
{% for card in random_pics %}
|
||||||
{% if card.image %}
|
{% if card.image %}
|
||||||
<a href="{% url card-details card.id %}"><img src="{{card|tiny}}" alt="" /></a>
|
<a class="randomized" href="{% url card-details card.id %}"><img src="{{card|tiny}}" alt="" /></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue