euscanwww: Added account profile page

* Added an account profile page
* Added a button to favourite packages
* Implemented models to favourite categories, herds, maintainers but
  still to implement

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino
2012-06-12 15:27:28 +02:00
parent bd971a7da0
commit 11c234f7f7
14 changed files with 491 additions and 23 deletions

@ -37,12 +37,25 @@
<li><a href="{% url "overlays" %}">Overlays</a></li>
<li><a href="{% url "world" %}">Scan World</a></li>
<li><a href="{% url "statistics" %}">Statistics</a></li>
<!--
<li>---</li>
<li><a href="#">Login</a></li>
<li><a href="#">Register</a></li>
-->
{% if user.is_authenticated %}
<li><a href="{% url "accounts_index" %}">{{ user }}'s profile</a></li>
<ul class="submenu">
<li><a href="{% url "accounts_categories" %}">Categories</a></li>
<li><a href="{% url "accounts_herds" %}">Herds</a></li>
<li><a href="{% url "accounts_maintainers" %}">Maintainer profiles</a></li>
<li><a href="{% url "accounts_packages" %}">Packages</a></li>
</ul>
<li><a href="{% url "django.contrib.auth.views.logout" %}">Logout</a></li>
{% else %}
<li><a href="{% url "django.contrib.auth.views.login" %}?next={% url "accounts_index" %}">Login</a></li>
<li><a href="{% url "registration.views.register" %}">Register</a></li>
{% endif %}
<li>---</li>
{% block menu_feed %}
<li>
<img src="{{ STATIC_URL }}img/feed.png" alt="feed" />
@ -52,15 +65,6 @@
<li>---</li>
<li><a href="{% url "api" %}">API</a></li>
<li><a href="{% url "about" %}">About</a></li>
<li>---</li>
{% if user.is_authenticated %}
<li><a href="#"> Welcome {{ user }}</a></li>
<li><a href="{% url "django.contrib.auth.views.logout" %}">Logout</a></li>
{% else %}
<li><a href="{% url "django.contrib.auth.views.login" %}">Login</a></li>
<li><a href="{% url "registration.views.register" %}">Register</a></li>
{% endif %}
{% endblock %}
</ul>
</div>

@ -0,0 +1,11 @@
{% extends "_base.html" %}
{% load url from future %}
{% block title %}
{{ block.super }} - My categories
{% endblock %}
{% block content %}
<h2>Welcome {{ user }}</h2>
{% endblock %}

@ -0,0 +1,11 @@
{% extends "_base.html" %}
{% load url from future %}
{% block title %}
{{ block.super }} - My herds
{% endblock %}
{% block content %}
<h2>Welcome {{ user }}</h2>
{% endblock %}

@ -0,0 +1,11 @@
{% extends "_base.html" %}
{% load url from future %}
{% block title %}
{{ block.super }} - Welcome {{ user }}
{% endblock %}
{% block content %}
<h2>Welcome {{ user }}</h2>
{% endblock %}

@ -0,0 +1,11 @@
{% extends "_base.html" %}
{% load url from future %}
{% block title %}
{{ block.super }} - My maintainer profiles
{% endblock %}
{% block content %}
<h2>Welcome {{ user }}</h2>
{% endblock %}

@ -0,0 +1,16 @@
{% extends "euscan/_datatable.html" %}
{% load url from future %}
{% load packages %}
{% block title %}
{{ block.super }} - My packages
{% endblock %}
{% block content %}
<h2>My Packages</h2>
{% packages packages %}
{% endblock %}

@ -27,10 +27,13 @@
<h2>
{{ package.category }}/{{ package.name }}
{% if user.is_superuser %}
{% if user.is_authenticated %}
<button class="refresh-button" data-package="{{ package.category }}/{{ package.name }}">
Refresh
</button>
<button class="favourite-button" data-url="{% url "favourite_package" package.category package.name %}">
Add to favourites
</button>
{% endif %}
</h2>
<dl>
@ -145,6 +148,12 @@
alert("Submitted!");
});
});
$(".favourite-button").click(function() {
$.post($(this).data("url"), function() {
alert("Favourited!");
});
});
</script>
{% endblock %}