summaryrefslogtreecommitdiff
path: root/static/website/templates
diff options
context:
space:
mode:
authorJayaram Pai2013-12-11 15:31:24 +0530
committerJayaram Pai2013-12-11 15:31:24 +0530
commit3a680b5d2442268ab117c0f98f21a039d4544bd8 (patch)
treead3b7e40a99cea53d63d0dc9e5fe216178dff7b9 /static/website/templates
parent0dd964ec05401809a408ab55d5517d3b2fba3a85 (diff)
downloadFOSSEE-Forum-3a680b5d2442268ab117c0f98f21a039d4544bd8.tar.gz
FOSSEE-Forum-3a680b5d2442268ab117c0f98f21a039d4544bd8.tar.bz2
FOSSEE-Forum-3a680b5d2442268ab117c0f98f21a039d4544bd8.zip
base one
Diffstat (limited to 'static/website/templates')
-rw-r--r--static/website/templates/base.html14
-rw-r--r--static/website/templates/get-question.html23
-rw-r--r--static/website/templates/index.html30
-rw-r--r--static/website/templates/notifications.html33
-rw-r--r--static/website/templates/notify.html7
-rw-r--r--static/website/templates/user-questions.html36
-rw-r--r--static/website/templates/user-replies.html36
7 files changed, 157 insertions, 22 deletions
diff --git a/static/website/templates/base.html b/static/website/templates/base.html
index 5e397e8..c71e3ef 100644
--- a/static/website/templates/base.html
+++ b/static/website/templates/base.html
@@ -39,9 +39,17 @@
{{ user }}<b class="caret"></b>
</a>
<ul class="dropdown-menu">
- <li><a href="#">My Questions</a></li>
- <li><a href="#">My Replies</a></li>
- <li><a href="#">Notifications</a></li>
+ <li><a href="{% url 'website:user_questions' user.id %}">My Questions</a></li>
+ <li><a href="{% url 'website:user_replies' user.id %}">My Replies</a></li>
+ <li>
+ <a href="{% url 'website:user_notifications' user.id %}">
+ Notifications
+ <span class="badge" style="background:#a26dc8; color:#ffffff;">
+ {% load notify %}
+ {% notification_count user.id %}
+ </span>
+ </a>
+ </li>
<li class="divider"></li>
<li><a href="{% url 'user_logout' %}">Logout</a></li>
</ul>
diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html
index 5e68aed..bd63d02 100644
--- a/static/website/templates/get-question.html
+++ b/static/website/templates/get-question.html
@@ -2,13 +2,13 @@
{% load static %}
{% load widget_tweaks %}
{% block content %}
-<div class="question">
+<div class="question {% ifequal question.user|stringformat:'s' user|stringformat:'s' %}editable{% endifequal %}">
<div class="title">
<a href=""> {{ question.title }} </a>
</div>
<div id="questionNicPanel"></div>
- <div id="questionInstance" class="body">
+ <div id="{% ifequal question.user|stringformat:'s' user|stringformat:'s' %}questionInstance{% endifequal %}" class="body">
{{ question.body|safe }}
</div>
<br>
@@ -48,7 +48,7 @@
<span class="modify">
{% ifequal question.uid|stringformat:'s' user.id|stringformat:'s' %}
<a class="edit btn btn-xs btn-info" href="#">Edit</a>
- <a id="save-{{ question.id }}" class="save btn btn-xs btn-success" href="#">Save</a>
+ <a class="save btn btn-xs btn-success" data-qid="{{ question.id }}" href="#">Save</a>
{% endifequal %}
</span>
@@ -65,7 +65,7 @@
</div>
{% for reply in replies %}
- <div class="reply {% ifequal reply.uid|stringformat:'s' user.id|stringformat:'s' %}editable{% endifequal %}">
+ <div class="reply {% ifequal reply.uid|stringformat:'s' user.id|stringformat:'s' %}editable{% endifequal %}" id="reply{{reply.id}}">
<div class="body" id="body{{ reply.id }}">
{{ reply.body|safe }}
@@ -78,7 +78,7 @@
{% ifequal reply.uid|stringformat:'s' user.id|stringformat:'s' %}
<span class="modify" style="display:block">
<a class="edit btn btn-xs btn-info vs" href="#body{{ reply.id}}" data-target="body{{ reply.id }}">Edit</a>
- <a id="save-{{ question.id }}" class="save btn btn-xs btn-success vs" href="#" data-target="body{{ reply.id }}">Save</a>
+ <a class="save btn btn-xs btn-success vs" data-target="body{{ reply.id }}" data-rid="{{ reply.id }}" href="#">Save</a>
</span>
{% endifequal %}
</div> <!-- /.reply -->
@@ -111,16 +111,5 @@
{% endblock %}
{% block javascript %}
- {% if user.is_authenticated %}
- {% ifequal question.user|stringformat:"s" user|stringformat:"s" %}
- <script src="{% static 'website/js/thread-user.js' %}"></script>
- {% else %}
- <script src="{% static 'website/js/thread-user.js' %}"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".question .body").removeAttr("id");
- });
- </script>
- {% endifequal %}
- {% endif %}
+ <script src="{% static 'website/js/thread-user.js' %}"></script>
{% endblock %}
diff --git a/static/website/templates/index.html b/static/website/templates/index.html
index 43d98f0..ef840bc 100644
--- a/static/website/templates/index.html
+++ b/static/website/templates/index.html
@@ -1,5 +1,6 @@
{% extends 'website/templates/base.html' %}
{% block content %}
+{% load count_tags %}
<h4><u>Recent Questions</u></h4>
{% for question in questions %}
<div class="question">
@@ -39,9 +40,34 @@
</small>
</span>
- <span class="user">
- {{ question.user }}
+ <span class="meta">
+ <small>
+ <i>
+ {{ question.date_created }}
+ </i>
+ </small>
+
+ <span class="user">
+ {{ question.user }}
+ </span>
</span>
</div> <!-- /.question -->
{% endfor %}
+
+ {% if total > 10 %}
+ <ul class="pagination pull-right">
+ {% for i in total|get_range:"0,10" %}
+ <li>
+ <a href="{% url 'website:home' %}?marker={{ i }}">
+ {% if i == marker %}
+ <strong>{{ i|div:"10"|inc }}</strong>
+ {% else %}
+ {{ i|div:"10"|inc }}
+ {% endif %}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
{% endblock %}
diff --git a/static/website/templates/notifications.html b/static/website/templates/notifications.html
new file mode 100644
index 0000000..aa3adce
--- /dev/null
+++ b/static/website/templates/notifications.html
@@ -0,0 +1,33 @@
+{% extends 'website/templates/base.html' %}
+{% load notify %}
+{% block content%}
+ <h4 class="pull-left">Notifications</h4>
+ <a class="btn btn-xs btn-warning pull-right" href="{% url "website:clear_notifications" %}" style="margin-top: 7px;">
+ Clear All
+ </a>
+ <div class="clearfix"></div>
+ {% for notification in notifications %}
+ {% get_notification notification.id %}
+ {% endfor %}
+{% endblock %}
+
+{% block javascript %}
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $(".remove").click(function() {
+ $(this).parent(".notification").slideUp();
+ var notification_id = $(this).data("nid");
+ $.ajax({
+ url: "/ajax-notification-remove/",
+ type: "POST",
+ data: {
+ notification_id: notification_id
+ },
+ success: function(data) {
+ console.log(data);
+ }
+ });
+ });
+ });
+ </script>
+{% endblock %}
diff --git a/static/website/templates/notify.html b/static/website/templates/notify.html
new file mode 100644
index 0000000..7251f1b
--- /dev/null
+++ b/static/website/templates/notify.html
@@ -0,0 +1,7 @@
+<div class="notification">
+ <a href=""><strong>{{ reply.user }}</strong> replies to <strong>{{ question.title }}</strong></a> /
+ {{ reply.body|safe }}
+ <a class="remove" data-nid="{{ notification.id }}" href="#">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ </a>
+</div> <!-- /.notification -->
diff --git a/static/website/templates/user-questions.html b/static/website/templates/user-questions.html
new file mode 100644
index 0000000..e3d2ab6
--- /dev/null
+++ b/static/website/templates/user-questions.html
@@ -0,0 +1,36 @@
+{% extends 'website/templates/base.html' %}
+{% load count_tags %}
+{% block content %}
+ <h4>My Questions</h4>
+ {% for question in questions %}
+ <div class="my-question">
+ <span class="title">
+ {{ question.title }}
+ </span>
+ <br>
+ <span class="date">
+ <small>
+ Asked on:
+ {{ question.date_created }}
+ </small>
+ </span>
+ </div>
+ {% endfor %}
+
+ {% if total > 10 %}
+ <ul class="pagination pull-right">
+ {% for i in total|get_range:"0,10" %}
+ <li>
+ <a href="{% url 'website:user_questions' user.id %}?marker={{ i }}">
+ {% if i == marker %}
+ <strong>{{ i|div:"10"|inc }}</strong>
+ {% else %}
+ {{ i|div:"10"|inc }}
+ {% endif %}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
+{% endblock %}
diff --git a/static/website/templates/user-replies.html b/static/website/templates/user-replies.html
new file mode 100644
index 0000000..c31b854
--- /dev/null
+++ b/static/website/templates/user-replies.html
@@ -0,0 +1,36 @@
+{% extends 'website/templates/base.html' %}
+{% load count_tags %}
+{% block content %}
+ <h4>My Replies</h4>
+ {% for reply in replies%}
+ <div class="my-reply">
+ <span class="body">
+ {{ reply.body|safe }}
+ </span>
+ <br>
+ <span class="date">
+ <small>
+ Replied on:
+ {{ reply.date_created }}
+ </small>
+ </span>
+ </div>
+ {% endfor %}
+
+ {% if total > 10 %}
+ <ul class="pagination pull-right">
+ {% for i in total|get_range:"0,10" %}
+ <li>
+ <a href="{% url 'website:user_replies' user.id %}?marker={{ i }}">
+ {% if i == marker %}
+ <strong>{{ i|div:"10"|inc }}</strong>
+ {% else %}
+ {{ i|div:"10"|inc }}
+ {% endif %}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
+{% endblock %}