Browse Source

fix carousel for users

tr4ck3ur 2 years ago
parent
commit
127c45763e
1 changed files with 37 additions and 3 deletions
  1. 37 3
      jm2l/templates/helpers.mako

+ 37 - 3
jm2l/templates/helpers.mako

@@ -485,11 +485,11 @@ TabJs = {'select':[], 'desc':[]}
485 485
 <%def name="show_pictures(uprofil)"> \
486 486
 <div class="profile-icon pull-right">
487 487
     <% photos = uprofil.PhotosLinks %>
488
-    <div id="MyPictureCarousel" class="carousel slide">
488
+    <div id="MyPictureCarousel-${uprofil.uid}" class="carousel slide">
489 489
         % if len(photos)>1:
490 490
         <!-- Carousel nav -->
491
-        <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
492
-        <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
491
+        <a class="Ucarousel-control left" href="#MyPictureCarousel-${uprofil.uid}" data-slide="prev">&lsaquo;</a>
492
+        <a class="Ucarousel-control right" href="#MyPictureCarousel-${uprofil.uid}" data-slide="next">&rsaquo;</a>
493 493
         % endif
494 494
         <!-- Carousel items -->
495 495
         <div class="carousel-inner" style="height: 220px;">
@@ -552,6 +552,39 @@ TabJs = {'select':[], 'desc':[]}
552 552
 </div>
553 553
 </%def> \
554 554
 ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
555
+##                Wrapper pour les photos de l'année
556
+## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
557
+<%def name="show_photos(photos)"> \
558
+<div class="profile-icon pull-right">
559
+    <div id="PhotoCarousel" class="carousel slide">
560
+        % if photos and len(photos)>1:
561
+        <!-- Carousel nav -->
562
+        <a class="Ucarousel-control left" href="#PhotoCarousel" data-slide="prev">&lsaquo;</a>
563
+        <a class="Ucarousel-control right" href="#PhotoCarousel" data-slide="next">&rsaquo;</a>
564
+        % endif
565
+        <!-- Carousel items -->
566
+        <div class="carousel-inner" style="height: 220px;">
567
+        % if photos and len(photos):
568
+            % for num, link in enumerate(photos):
569
+            <div class="${['','active '][num==0]}item" id="UserPic${num}">
570
+                <div style="margin:auto;">
571
+                    <img src="${link}" class="img-polaroid" style="max-heights:205px;max-widths:235px;" alt="Photo" />
572
+                </div>
573
+            </div>
574
+            % endfor
575
+        % else:
576
+##            <div class="active item" id="UserPic0">
577
+##                <div style="margin:auto;widths:170px;">
578
+##                    <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.nom} ${uprofil.prenom}" style="max-heights:205px;"  />
579
+##                </div>
580
+##            </div>
581
+        % endif
582
+        </div>
583
+    </div>
584
+</div>
585
+</%def> \
586
+
587
+## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
555 588
 ##          Wrapper pour les échanges utilisateurs
556 589
 ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
557 590
 <%def name="show_exchange(Exchange, Asker, Provider)"> \
@@ -701,3 +734,4 @@ TabJs = {'select':[], 'desc':[]}
701 734
     </table>
702 735
 </div>
703 736
 </%def> \
737
+