123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- {% extends "socialnetwork/base.html" %}
- {% block title %}
- Your global stream
- {% endblock %}
- {% block header1 %}
- <div class="right">
- <a href="{% url 'logout' %}" class="btn waves-effect waves-teal lighten-3">LOGOUT</a>
- </div>
- {% endblock %}
- {% block header2 %}
- <div class="left">
- <a href="{% url 'edit_profile' %}" class="btn waves-effect waves-light red lighten-2">EDIT PROFILE</a>
- </div>
- <div class="right">
- <a href="{% url 'followerstream' %}" class="btn waves-light red lighten-2">FOLLOWER STREAM</a>
- </div>
- {% endblock %}
-
- {% block content %}
- <form action="{% url 'add_post' %}" method="post">
- <div class="container">
- <br>
- Welcome to your page, <span> {{user.username}}</span>!
- {%for error in errors %}
- <p style="color:red" class="center-align">
- <b>{{error}}</b>
- </p>
- {% endfor %}
- <div class="row">
- <br>
- <div class="card-panel col l12 offset-l9 m12 offset-m0 s8 z-depth z-depth-2" id="add-posts">
- {{addpost_form}}
- <button class="btn waves-effect waves-light red lighten-2" type="submit" name="action">SUBMIT
- <i class="mdi-content-send right"></i>
- </button>
- </div>
- </div>
- </div>
- {% csrf_token %}
- </form>
-
- <br><br>
- <p class="center-align"> This is your global stream: </p>
- <div class="container">
- <div class="row" id="attachhere">
- <input type="hidden" id="finalpost" name="finalpost" value="{{finalpost}}">
- {% for post in posts %}
- <form class="postsform" data-pid="{{post.id}}">
- <div class="card-panel col l12 offset-l9 m12 offset-m0 s8 z-depth-1" id="global-stream">
- {% for profile in profiles %}
- {% if post.user.id == profile.user.id %}
- {% if profile.picture_url %}
- <div class="left">
- <img src={{profile.picture_url}} alt="{{post.user.text}}" width="50px" height="auto">
- </div>
- {% else %}
- <div class="left">
- {% load staticfiles %}
- <img src={% static 'socialnetwork/default_avatar.jpg' %} width="50px" height="auto">
- }
- </div>
- {% endif %}
- {% endif %}
- {% endfor %}
- <div> <a href="{% url 'profile' post.user.id %}" + id>{{post.user}}</a></div>
- <div> {{post.date_time}} </div>
- <div> {{post.post_content}} </div>
- <input type="text" placeholder="Comment" id="comment" class="addcommenttext">
- <input type="submit" value="submit" class="addcommentpost" data-pid="{{post.id}}"> <br>
- <br>
- <br>
- <hr>
- <div class = "commentsection grey lighten-2" id="commentsection-{{post.id}}">
- {% for comment in comments %}
- {% if comment.comment_post.id == post.id %}
- <div class="row">
- {% if comment.comment_by.picture_url %}
- <div class="left">
- <img src={{comment.comment_by.picture_url}} width="30px" height="auto">
- </div>
- {% else %}
- <div class="left">
- {% load staticfiles %}
- <img src={% static 'socialnetwork/default_avatar.jpg' %} width="30px" height="auto">
- </div>
- {% endif %}
- <div> {{comment.comment_by.user}}
- <div class="right">{{comment.comment_datetime}}</div>
- </div>
- {{comment.comment_text}}
- </div>
- {% endif %}
- {% endfor %}
- </div>
- </div>
- {% csrf_token %}
- </form>
- {% endfor %}
- </div>
- </div>
-
-
- {% load staticfiles %}
- <script src="{% static 'js/jquery-2.1.3.min.js' %}"></script>
- <script src="{% static 'js/todo.js' %}" type="text/javascript"></script>
- {% endblock %}
|