summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/management/commands/reporead.py11
-rw-r--r--devel/views.py2
-rw-r--r--main/fixtures/groups.json50
-rw-r--r--packages/templatetags/package_extras.py14
-rw-r--r--packages/views/__init__.py6
-rw-r--r--templates/base.html5
-rw-r--r--templates/packages/details.html4
-rw-r--r--templates/packages/files.html4
-rw-r--r--templates/packages/files_list.html (renamed from templates/packages/files-list.html)5
-rw-r--r--templates/public/developer_list.html2
10 files changed, 83 insertions, 20 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index bb7d1005..e226d3a0 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -374,10 +374,9 @@ def db_update(archname, reponame, pkgs, force=False):
timestamp = None
# for a force, we don't want to update the timestamp.
# for a non-force, we don't want to do anything at all.
- if pkg_same_version(pkg, dbpkg):
- if not force:
- continue
- else:
+ if not force and pkg_same_version(pkg, dbpkg):
+ continue
+ elif not force:
timestamp = datetime.utcnow()
# The odd select_for_update song and dance here are to ensure
@@ -386,7 +385,7 @@ def db_update(archname, reponame, pkgs, force=False):
with transaction.commit_on_success():
# TODO Django 1.4 select_for_update() will work once released
dbpkg = select_pkg_for_update(dbpkg)
- if pkg_same_version(pkg, dbpkg):
+ if not force and pkg_same_version(pkg, dbpkg):
logger.debug("Package %s was already updated", pkg.name)
continue
logger.info("Updating package %s", pkg.name)
@@ -413,7 +412,7 @@ def filesonly_update(archname, reponame, pkgs, force=False):
with transaction.commit_on_success():
if not dbpkg.files_last_update or not dbpkg.last_update:
pass
- elif dbpkg.files_last_update > dbpkg.last_update:
+ elif not force and dbpkg.files_last_update > dbpkg.last_update:
logger.debug("Files for %s are up to date", pkg.name)
continue
# TODO Django 1.4 select_for_update() will work once released
diff --git a/devel/views.py b/devel/views.py
index b9bd7cce..c888871d 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -123,7 +123,7 @@ class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
- exclude = ['allowed_repos', 'user']
+ exclude = ('allowed_repos', 'user', 'latin_name')
@login_required
@never_cache
diff --git a/main/fixtures/groups.json b/main/fixtures/groups.json
index 385e321d..0a3c966c 100644
--- a/main/fixtures/groups.json
+++ b/main/fixtures/groups.json
@@ -34,6 +34,36 @@
"delete_todolistpkg",
"main",
"todolistpkg"
+ ],
+ [
+ "add_news",
+ "news",
+ "news"
+ ],
+ [
+ "change_news",
+ "news",
+ "news"
+ ],
+ [
+ "add_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "change_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "add_signoffspecification",
+ "packages",
+ "signoffspecification"
+ ],
+ [
+ "change_signoffspecification",
+ "packages",
+ "signoffspecification"
]
]
}
@@ -350,6 +380,26 @@
"delete_todolistpkg",
"main",
"todolistpkg"
+ ],
+ [
+ "add_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "change_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "add_signoffspecification",
+ "packages",
+ "signoffspecification"
+ ],
+ [
+ "change_signoffspecification",
+ "packages",
+ "signoffspecification"
]
]
}
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index a2f2387e..a8a8bd0f 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -61,7 +61,7 @@ def multi_pkg_details(pkgs):
return ', '.join([pkg_details_link(pkg) for pkg in pkgs])
@register.simple_tag
-def userpkgs(user):
+def maintainer_link(user):
if user:
# TODO don't hardcode
title = escape('View packages maintained by ' + user.get_full_name())
@@ -85,6 +85,18 @@ def get_download_link(package):
return linkbase % parts
@register.simple_tag
+def packager_link(user):
+ if user:
+ # TODO don't hardcode
+ title = escape('View packages packaged by ' + user.get_full_name())
+ return '<a href="/packages/?packager=%s" title="%s">%s</a>' % (
+ user.username,
+ title,
+ user.get_full_name(),
+ )
+ return ''
+
+@register.simple_tag
def get_wiki_link(package):
url = "//wiki.parabolagnulinux.org/index.php"
data = {
diff --git a/packages/views/__init__.py b/packages/views/__init__.py
index bbfe7c9f..7a8dabd5 100644
--- a/packages/views/__init__.py
+++ b/packages/views/__init__.py
@@ -169,13 +169,17 @@ def files(request, name, repo, arch):
pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
fileslist = PackageFile.objects.filter(pkg=pkg).order_by('directory', 'filename')
+ dir_count = sum(1 for f in fileslist if f.is_directory)
+ files_count = len(fileslist) - dir_count
context = {
'pkg': pkg,
'files': fileslist,
+ 'files_count': files_count,
+ 'dir_count': dir_count,
}
template = 'packages/files.html'
if request.is_ajax():
- template = 'packages/files-list.html'
+ template = 'packages/files_list.html'
return direct_to_template(request, template, context)
def details_json(request, name, repo, arch):
diff --git a/templates/base.html b/templates/base.html
index 08881706..9f893eda 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,6 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!DOCTYPE html>
+<html lang="en">
<head>
<title>{% block title %}Parabola GNU/Linux-libre{% endblock %}</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 4570627f..d0e60ab2 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -132,7 +132,7 @@
{% with pkg.maintainers as maints %}
<td>{% if maints %}
{% for m in maints %}
- {% userpkgs m %}<br/>
+ {% maintainer_link m %}<br/>
{% endfor %}
{% else %}Orphan{% endif %}
</td>
@@ -145,7 +145,7 @@
<td>{{ pkg.installed_size|filesizeformat }}</td>
</tr><tr>
<th>Last Packager:</th>
- <td>{% with pkg.packager as pkgr %}{% if pkgr %}{% userpkgs pkgr %}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}</td>
+ <td>{% with pkg.packager as pkgr %}{% if pkgr %}{% packager_link pkgr %}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}</td>
</tr><tr>
<th>Signed:</th>
<td>{{ pkg.is_signed|yesno|capfirst }}</td>
diff --git a/templates/packages/files.html b/templates/packages/files.html
index 78a40def..8cf6738d 100644
--- a/templates/packages/files.html
+++ b/templates/packages/files.html
@@ -8,9 +8,9 @@
<h2>Package File List: {{ pkg.pkgname }} {{ pkg.full_version }}</h2>
<div id="metadata">
<p><a href="{{ pkg.get_absolute_url }}">Back to Package</a></p>
- {% include "packages/files-list.html" %}
+ <p>Package has {{ files_count }} file{{ files_count|pluralize }} and {{ dir_count }} director{{ dir_count|pluralize:"y,ies" }}.</p>
+ {% include "packages/files_list.html" %}
</div>
</div>
{% endblock %}
-
diff --git a/templates/packages/files-list.html b/templates/packages/files_list.html
index 95a85d24..156d8588 100644
--- a/templates/packages/files-list.html
+++ b/templates/packages/files_list.html
@@ -5,9 +5,8 @@ of the package; it may be out of date.</p>
{% if pkg.files_last_update %}
{% if files|length %}
<ul>
- {% for file in files %}
- <li>{{ file.directory }}{{ file.filename|default:'' }}</li>
- {% endfor %}
+{% for file in files %}
+<li>{{ file.directory }}{{ file.filename|default:'' }}</li>{% endfor %}
</ul>
{% else %}
<p class="message">Package has no files.</p>
diff --git a/templates/public/developer_list.html b/templates/public/developer_list.html
index 5aa4c6b2..83c62952 100644
--- a/templates/public/developer_list.html
+++ b/templates/public/developer_list.html
@@ -18,7 +18,7 @@
</td>
<td>
<a name="{{ dev.username }}"></a>
- <table class="bio bio-{{ dev.username }}" cellspacing="0">
+ <table class="bio bio-{{ dev.username }}">
<tr>
<th>Name:</th>
<td>{{ dev.get_full_name }}{% if prof.latin_name %} ({{ prof.latin_name}}){% endif %}</td>