Commits

hugo tomanguilla committed c0a6021

Agrgando campos

  • Participants
  • Parent commits 0e99c2d

Comments (0)

Files changed (1)

templates/site/product.html

               </div>
               <div class="clear"></div>
             </div>
-            <div class="clear"></div>{% if user %}
+            <div class="clear"></div>
+            {% if user %}
             {% if not is_owner %} 
             <div style="display: block" class="single">
-              <div class="user-conversacion">{% for item in [1,2,3] %}
+              <div class="user-conversacion">{% for item in comments %}
                 <div class="box-user">
                   <div class="box-user-data">           <img src="../static/images/site/product-user.png" class="box-user-img"/>
-                    <div class="box-user-name">{{user.name}} Said:</div>
+                    <div class="box-user-name">{{item.user}} Said:</div>
                   </div>
-                  <div class="box-txt">Reference site about Lorem Ipsum, giving information on its origin. Giving information on its origin.</div>
+                  <div class="box-txt">{{item.text}}</div>
                   <div class="clear"> </div>
                 </div>{% endfor %}
                 <form action="" method="post" class="box-comment">{{ xsrf }}
                   <input type="submit" value="SEND" class="submit"/>
                 </form>
               </div>
-            </div>{% else %}
+            </div>
+            {% else %}
             <div class="tit-converacion">CONVERSATIONS</div>
-            <div class="notification">You have 5 new messages        </div>
+            <div class="notification">You have {{tot_unread_comments}} new messages </div>
             <div id="comments-user">  
               <!-- CON USUARIO 1-->
-              <div class="comment-tit accordion-trigger"><img src="{{ handler.static_url('images/site/product-user2.png') }}" class="com-user"/><span class="com-name">Username Y</span><span class="com-num">3       </span></div>
+
+
+            {% for item in conversations %}
+              <div class="comment-tit accordion-trigger"><img src="{{ handler.static_url('images/site/product-user2.png') }}" class="com-user"/><span class="com-name">{{item.user}}</span><span class="com-num">{{item.unread_comments}}</span></div>
               <div class="comment-box accordion-content">
                 <div class="comment">
+
+                  {% for c in item.comments %}
                   <div class="com-user"><img src="{{ handler.static_url('images/site/product-user2-1.png') }}"/>
-                    <div class="com-user-txt">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</div>
-                  </div>
-                  <div class="com-user"><img src="{{ handler.static_url('images/site/product-user-1.png') }}"/>
-                    <div class="com-user-txt">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
-                  </div>
-                  <div class="com-user"><img src="{{ handler.static_url('images/site/product-user2-1.png') }}"/>
-                    <div class="com-user-txt">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
-                  </div>
-                  <div class="com-user"><img src="{{ handler.static_url('images/site/product-user-1.png') }}"/>
-                    <div class="com-user-txt">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
+                    <div class="com-user-txt">{{c.text}}</div>
                   </div>
+                  {% endfor %}
+
                   <div class="com-write">
                     <textarea placeholder="Send a message to this user." name="comment" class="textarea"></textarea>
                     <input type="submit" value="Send" class="submit"/>
                     <div class="clear"></div>
                   </div>
+
                 </div>
               </div>
+            {% endfor %}
+
+
+
               <!-- CON USUARIO 2-->
               <div class="comment-tit accordion-trigger"><img src="{{ handler.static_url('images/site/product-user3.png') }}" class="com-user"/><span class="com-name">Username X</span><span class="com-num">2            </span></div>
               <div class="comment-box accordion-content">