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

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}