From 797185faed0555efb88a1e6a18e447548a9935fd Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 19 Sep 2011 08:44:22 -0500 Subject: Add some dev dashboard info regarding signed package count This adds a column similar to the flagged package count for the number of signed packages in a given architecture or repository. It is up to the user to do some simple math to figure out the number of unsigned packages. Also, add 'signed' as a hidden search field option similar to what we did for packager. Signed-off-by: Dan McGee --- templates/devel/index.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'templates') diff --git a/templates/devel/index.html b/templates/devel/index.html index 0c818d36..b2da70cf 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -135,6 +135,7 @@

Stats by Architecture

Arch # Packages # Flagged + # Signed @@ -147,6 +148,8 @@

Stats by Architecture

{{ arch.packages.flagged.count }} packages + + {{ arch.packages.signed.count }} packages {% endfor %} @@ -165,6 +168,7 @@

Stats by Repository

Repository # Packages # Flagged + # Signed @@ -177,6 +181,7 @@

Stats by Repository

{{ repo.packages.flagged.count }} packages + {{ repo.packages.signed.count }} packages {% endfor %} -- cgit v1.2.3-54-g00ecf From d5063bd1d2cae79df7ce6e826c7413fed61ff9db Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 5 Oct 2011 15:45:44 -0500 Subject: Add package visualizations page Why the hell not? Have fun clicking all the pretty buttons. Signed-off-by: Dan McGee --- media/archweb.css | 27 ++++++++++ media/visualize.js | 112 +++++++++++++++++++++++++++++++++++++++++ settings.py | 1 + templates/public/index.html | 8 +-- templates/visualize/index.html | 43 ++++++++++++++++ urls.py | 1 + visualize/__init__.py | 0 visualize/models.py | 0 visualize/tests.py | 0 visualize/urls.py | 9 ++++ visualize/views.py | 59 ++++++++++++++++++++++ 11 files changed, 256 insertions(+), 4 deletions(-) create mode 100644 media/visualize.js create mode 100644 templates/visualize/index.html create mode 100644 visualize/__init__.py create mode 100644 visualize/models.py create mode 100644 visualize/tests.py create mode 100644 visualize/urls.py create mode 100644 visualize/views.py (limited to 'templates') diff --git a/media/archweb.css b/media/archweb.css index 0cadd7a7..eb0f0ca1 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -948,3 +948,30 @@ ul.admin-actions { #archnavbar.anb-download ul li#anb-download a { color: white !important; } + +/* visualizations page */ +.visualize-buttons { + margin: 0.5em 0.33em; +} + + .visualize-buttons button.active { + depressed: true; + } + +.visualize-chart { + position: relative; + height: 500px; + margin: 0.33em; +} + +#visualize-archrepo .treemap-cell { + border: solid 1px white; + overflow: hidden; + position: absolute; +} + + #visualize-archrepo .treemap-cell span { + padding: 3px; + font-size: 0.85em; + line-height: 1em; + } diff --git a/media/visualize.js b/media/visualize.js new file mode 100644 index 00000000..c1ea598b --- /dev/null +++ b/media/visualize.js @@ -0,0 +1,112 @@ +function packages_treemap(chart_id, orderings, default_order) { + var jq_div = $(chart_id), + color = d3.scale.category20(); + key_func = function(d) { return d.key; }, + value_package_count = function(d) { return d.count; }; + + var treemap = d3.layout.treemap() + .size([jq_div.width(), jq_div.height()]) + /*.sticky(true)*/ + .value(value_package_count) + .sort(function(a, b) { return a.key < b.key; }) + .children(function(d) { return d.data; }); + + var cell_html = function(d) { + if (d.children) { + return ""; + } + return "" + d.name + ": " + treemap.value()(d) + ""; + }; + + var d3_div = d3.select(jq_div.get(0)); + + var prop_px = function(prop, offset) { + return function(d) { + var dist = d[prop] + offset; + if (dist > 0) return dist + "px"; + else return "0px"; + }; + }; + + var cell = function() { + /* the -1 offset comes from the border width we use in the CSS */ + this.style("left", prop_px("x", 0)).style("top", prop_px("y", 0)) + .style("width", prop_px("dx", -1)).style("height", prop_px("dy", -1)); + }; + + var fetch_for_ordering = function(order) { + d3.json(order.url, function(json) { + var nodes = d3_div.data([json]).selectAll("div").data(treemap.nodes, key_func); + /* start out new nodes in the center of the picture area */ + var w_center = jq_div.width() / 2; + var h_center = jq_div.height() / 2; + nodes.enter().append("div") + .attr("class", "treemap-cell") + .attr("title", function(d) { return d.name; }) + .style("left", w_center + "px").style("top", h_center + "px") + .style("width", "0px").style("height", "0px") + .style("display", function(d) { return d.children ? "none" : null; }) + .html(cell_html); + nodes.transition().duration(1500) + .style("background-color", function(d) { return d.children ? null : color(d[order.color_attr]); }) + .call(cell); + nodes.exit().transition().duration(1500).remove(); + }); + }; + + /* start the callback for the default order */ + fetch_for_ordering(orderings[default_order]); + + var make_scale_button = function(name, valuefunc) { + var button_id = chart_id + "-" + name; + /* upon button click, attach new value function and redraw all boxes + * accordingly */ + d3.select(button_id).on("click", function() { + d3_div.selectAll("div") + .data(treemap.value(valuefunc), key_func) + .html(cell_html) + .transition().duration(1500).call(cell); + + /* drop off the '#' sign to convert id to a class prefix */ + d3.selectAll("." + chart_id.substring(1) + "-scaleby") + .classed("active", false); + d3.select(button_id).classed("active", true); + }); + }; + + /* each scale button tweaks our value, e.g. net size function */ + make_scale_button("count", value_package_count); + make_scale_button("flagged", function(d) { return d.flagged; }); + make_scale_button("csize", function(d) { return d.csize; }); + make_scale_button("isize", function(d) { return d.isize; }); + + var make_group_button = function(name, order) { + var button_id = chart_id + "-" + name; + d3.select(button_id).on("click", function() { + fetch_for_ordering(order); + + /* drop off the '#' sign to convert id to a class prefix */ + d3.selectAll("." + chart_id.substring(1) + "-groupby") + .classed("active", false); + d3.select(button_id).classed("active", true); + }); + }; + + $.each(orderings, function(k, v) { + make_group_button(k, v); + }); + + var resize_timeout = null; + var real_resize = function() { + resize_timeout = null; + d3_div.selectAll("div") + .data(treemap.size([jq_div.width(), jq_div.height()]), key_func) + .call(cell); + }; + $(window).resize(function() { + if (resize_timeout) { + clearTimeout(resize_timeout); + } + resize_timeout = setTimeout(real_resize, 200); + }); +} diff --git a/settings.py b/settings.py index 18437098..51f9fcf6 100644 --- a/settings.py +++ b/settings.py @@ -109,6 +109,7 @@ 'public', 'south', # database migration support 'releng', + 'visualize', ) PGP_SERVER = 'pgp.mit.edu:11371' diff --git a/templates/public/index.html b/templates/public/index.html index bea19e0f..b63876ac 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -26,10 +26,10 @@

A simple, lightweight distribution

Our strong community is diverse and helpful, and we pride ourselves on the range of skillsets and uses for Arch that stem from it. Please - check out our forums + check out our forums and mailing lists - to get your feet wet. Also glance through our wiki if you want to learn more about Arch.

@@ -174,8 +174,8 @@

Development

title="View/search the package repository database">Packages
  • Package Groups
  • -
  • Bug Tracker
  • +
  • Visualizations
  • SVN Repositories
  • + +

    Visualizations of Packaging Data

    + +

    Package Treemap

    + +
    +
    + Scale Using: + + + + +
    +
    + Group By: + + +
    +
    +
    + + +{% load cdn %}{% jquery %} + + + + + +{% endblock %} diff --git a/urls.py b/urls.py index c9faf165..cdae51bf 100644 --- a/urls.py +++ b/urls.py @@ -76,6 +76,7 @@ (r'^packages/', include('packages.urls')), (r'^releng/', include('releng.urls')), (r'^todo/', include('todolists.urls')), + (r'^visualize/', include('visualize.urls')), (r'^opensearch/packages/$', 'packages.views.opensearch', {}, 'opensearch-packages'), (r'^todolists/$','todolists.views.public_list'), diff --git a/visualize/__init__.py b/visualize/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/visualize/models.py b/visualize/models.py new file mode 100644 index 00000000..e69de29b diff --git a/visualize/tests.py b/visualize/tests.py new file mode 100644 index 00000000..e69de29b diff --git a/visualize/urls.py b/visualize/urls.py new file mode 100644 index 00000000..57ee0626 --- /dev/null +++ b/visualize/urls.py @@ -0,0 +1,9 @@ +from django.conf.urls.defaults import patterns + +urlpatterns = patterns('visualize.views', + (r'^$', 'index', {}, 'visualize-index'), + (r'^by_arch/$', 'by_arch', {}, 'visualize-byarch'), + (r'^by_repo/$', 'by_repo', {}, 'visualize-byrepo'), +) + +# vim: set ts=4 sw=4 et: diff --git a/visualize/views.py b/visualize/views.py new file mode 100644 index 00000000..68f5d4a5 --- /dev/null +++ b/visualize/views.py @@ -0,0 +1,59 @@ +from django.db.models import Count, Sum +from django.http import HttpResponse +from django.utils import simplejson +from django.views.decorators.cache import cache_page +from django.views.generic.simple import direct_to_template + +from main.models import Package, Arch, Repo + +def index(request): + return direct_to_template(request, 'visualize/index.html', {}) + +def arch_repo_data(): + qs = Package.objects.select_related().values( + 'arch__name', 'repo__name').annotate( + count=Count('pk'), csize=Sum('compressed_size'), + isize=Sum('installed_size'), + flagged=Count('flag_date')).order_by() + arches = Arch.objects.values_list('name', flat=True) + repos = Repo.objects.values_list('name', flat=True) + + # now transform these results into two mappings: one ordered (repo, arch), + # and one ordered (arch, repo). + arch_groups = dict((a, { 'name': a, 'key': ':%s' % a, 'arch': a, 'repo': None, 'data': [] }) for a in arches) + repo_groups = dict((r, { 'name': r, 'key': '%s:' % r, 'arch': None, 'repo': r, 'data': [] }) for r in repos) + for row in qs: + arch = row['arch__name'] + repo = row['repo__name'] + values = { + 'arch': arch, + 'repo': repo, + 'name': '%s (%s)' % (repo, arch), + 'key': '%s:%s' % (repo, arch), + 'csize': row['csize'], + 'isize': row['isize'], + 'count': row['count'], + 'flagged': row['flagged'], + } + arch_groups[arch]['data'].append(values) + repo_groups[repo]['data'].append(values) + + data = { + 'by_arch': { 'name': 'Architectures', 'data': arch_groups.values() }, + 'by_repo': { 'name': 'Repositories', 'data': repo_groups.values() }, + } + return data + +@cache_page(1800) +def by_arch(request): + data = arch_repo_data() + to_json = simplejson.dumps(data['by_arch'], ensure_ascii=False) + return HttpResponse(to_json, mimetype='application/json') + +@cache_page(1800) +def by_repo(request): + data = arch_repo_data() + to_json = simplejson.dumps(data['by_repo'], ensure_ascii=False) + return HttpResponse(to_json, mimetype='application/json') + +# vim: set ts=4 sw=4 et: -- cgit v1.2.3-54-g00ecf From 1cde4d45da91abae2525785c4d93e9ec648ec416 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 12 Oct 2011 09:08:28 -0500 Subject: Fix invalid markup on dev dashboard Signed-off-by: Dan McGee --- templates/devel/index.html | 1 - 1 file changed, 1 deletion(-) (limited to 'templates') diff --git a/templates/devel/index.html b/templates/devel/index.html index b2da70cf..d3f7ec3b 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -78,7 +78,6 @@

    Package Todo Lists

    Package Count Incomplete Count - {% for todo in todos %} -- cgit v1.2.3-54-g00ecf From fa38fa74d4d4186647b6e8f5c0e9661ad65d2957 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 18 Oct 2011 10:55:06 -0500 Subject: Add architecture to package details and files page titles And remove the not totally necessary "Package Details" text as that seems like a reasonable assumption for the base page. Signed-off-by: Dan McGee --- templates/packages/details.html | 2 +- templates/packages/files.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/packages/details.html b/templates/packages/details.html index 1016b43a..2998592f 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -2,7 +2,7 @@ {% load cache %} {% load package_extras %} -{% block title %}Arch Linux - {{ pkg.pkgname }} {{ pkg.full_version }} - Package Details{% endblock %} +{% block title %}Arch Linux - {{ pkg.pkgname }} {{ pkg.full_version }} ({{ pkg.arch.name }}){% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% load package_extras %} diff --git a/templates/packages/files.html b/templates/packages/files.html index 362e62cd..50ab6e83 100644 --- a/templates/packages/files.html +++ b/templates/packages/files.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% block title %}Arch Linux - {{ pkg.pkgname }} {{ pkg.full_version }} - Package File List{% endblock %} +{% block title %}Arch Linux - {{ pkg.pkgname }} {{ pkg.full_version }} ({{ pkg.arch.name }}) - File List{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block content %} -- cgit v1.2.3-54-g00ecf From 23020b33a0f8bf48c76d82726f143a09fca0fd1f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 18 Oct 2011 10:59:14 -0500 Subject: Refresh title and other aspects of flag package templates * Update to contain version and architecture * Update some page text to be more descriptive * Add a meta tag to not directly index these pages in search engines Signed-off-by: Dan McGee <dan@archlinux.org> --- templates/packages/flag.html | 7 ++++--- templates/packages/flag_confirmed.html | 6 ++++-- templates/packages/flagged.html | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'templates') diff --git a/templates/packages/flag.html b/templates/packages/flag.html index 34dfe34e..5fc9c91d 100644 --- a/templates/packages/flag.html +++ b/templates/packages/flag.html @@ -1,18 +1,19 @@ {% extends "base.html" %} {% load package_extras %} -{% block title %}Arch Linux - Flag Package - {{ package.pkgname }}{% endblock %} +{% block title %}Arch Linux - Flag Package - {{ package.pkgname }} {{ package.full_version }} ({{ package.arch.name }}){% endblock %} +{% block head %}<meta name="robots" content="noindex"/>{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block content %} <div id="pkg-flag" class="box"> - <h2>Flag Package: {{ package.pkgname }}</h2> + <h2>Flag Package: {{ package.pkgname }} {{ package.full_version }} ({{ package.arch.name }})</h2> <p>If you notice a package is out-of-date (i.e., there is a newer <strong>stable</strong> release available), then please notify us using the form below. Do <em>not</em> report bugs via this form!</p> - <p>Note that all of the following packages will be marked out of date:</p> + <p>Note that the following {{ packages|length }} package{{ packages|pluralize }} will be marked out of date:</p> <ul> {% for pkg in packages %} <li>{% pkg_details_link pkg %} {{ pkg.full_version }} [{{ pkg.repo.name|lower }}] ({{ pkg.arch.name }})</li> diff --git a/templates/packages/flag_confirmed.html b/templates/packages/flag_confirmed.html index 398212f8..6274adbb 100644 --- a/templates/packages/flag_confirmed.html +++ b/templates/packages/flag_confirmed.html @@ -1,14 +1,16 @@ {% extends "base.html" %} {% load package_extras %} -{% block title %}Arch Linux - Package Flagged - {{ package.pkgname }}{% endblock %} +{% block title %}Arch Linux - Package Flagged - {{ package.pkgname }} {{ package.full_version }} ({{ package.arch.name }}){% endblock %} +{% block head %}<meta name="robots" content="noindex"/>{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block content %} <div id="pkg-flag" class="box"> <h2>Package Flagged - {{ package.pkgname }}</h2> - <p>Thank you, the maintainers have been notified the following packages are out-of-date:</p> + <p>Thank you, the maintainers have been notified the following + {{ packages|length }} package{{ packages|pluralize }} are out-of-date:</p> <ul> {% for pkg in packages %} <li>{% pkg_details_link pkg %} {{ pkg.full_version }} [{{ pkg.repo.name|lower }}] ({{ pkg.arch.name }})</li> diff --git a/templates/packages/flagged.html b/templates/packages/flagged.html index a99a6924..bbe0fad5 100644 --- a/templates/packages/flagged.html +++ b/templates/packages/flagged.html @@ -1,12 +1,13 @@ {% extends "base.html" %} {% load package_extras %} -{% block title %}Arch Linux - Flag Package - {{ pkg.pkgname }}{% endblock %} +{% block title %}Arch Linux - Flag Package - {{ pkg.pkgname }} {{ pkg.full_version }} ({{ pkg.arch.name }}){% endblock %} +{% block head %}<meta name="robots" content="noindex"/>{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block content %} <div id="pkg-flagged-error" class="box"> - <h2>Error: Package already flagged</h2> + <h2>Package {{ pkg.pkgname }} {{ pkg.full_version }} ({{ pkg.arch.name }}) already flagged</h2> <p><strong>{{pkg.pkgname}}</strong> has already been flagged out-of-date.</p> -- cgit v1.2.3-54-g00ecf From e31d7f864ddfbce49eda91aa01654b76dcd009b9 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Wed, 19 Oct 2011 11:04:42 -0500 Subject: Use admin_media_prefix helper everywhere in search template Signed-off-by: Dan McGee <dan@archlinux.org> --- templates/packages/search.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/packages/search.html b/templates/packages/search.html index 4744aa88..800b883d 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -1,10 +1,12 @@ {% extends "base.html" %} {% load package_extras %} +{% load adminmedia %} + {% block title %}Arch Linux - Package Database{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block head %} -<link rel="stylesheet" type="text/css" href="/media/admin_media/css/widgets.css" /> +<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/widgets.css" /> {% endblock %} {% block content %} @@ -170,7 +172,7 @@ <h3>Package Search</h3> </div> <script type="text/javascript" src="/jsi18n/"></script> -{% load adminmedia %}<script type="text/javascript" src="{% admin_media_prefix %}js/core.js"></script> <script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";</script> +<script type="text/javascript" src="{% admin_media_prefix %}js/core.js"></script> {{search_form.media}} {% endblock %} -- cgit v1.2.3-54-g00ecf From 30b0c7b1a990ffbb244d103ac3e6022d4be60ec5 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Mon, 24 Oct 2011 16:28:13 -0500 Subject: Add icons for Apple iOS web application bookmarks These will be used for an icon if adding a bookmark as a Home Screen icon on iOS devices. We add the three recommended sizes for old iPhone screen size, the new iPhone resolution, and the iPad. Signed-off-by: Dan McGee <dan@archlinux.org> --- media/logos/apple-touch-icon-114x114.png | Bin 0 -> 3240 bytes media/logos/apple-touch-icon-57x57.png | Bin 0 -> 1638 bytes media/logos/apple-touch-icon-72x72.png | Bin 0 -> 2076 bytes templates/base.html | 3 +++ 4 files changed, 3 insertions(+) create mode 100644 media/logos/apple-touch-icon-114x114.png create mode 100644 media/logos/apple-touch-icon-57x57.png create mode 100644 media/logos/apple-touch-icon-72x72.png (limited to 'templates') diff --git a/media/logos/apple-touch-icon-114x114.png b/media/logos/apple-touch-icon-114x114.png new file mode 100644 index 00000000..e6365ee2 Binary files /dev/null and b/media/logos/apple-touch-icon-114x114.png differ diff --git a/media/logos/apple-touch-icon-57x57.png b/media/logos/apple-touch-icon-57x57.png new file mode 100644 index 00000000..d2d78262 Binary files /dev/null and b/media/logos/apple-touch-icon-57x57.png differ diff --git a/media/logos/apple-touch-icon-72x72.png b/media/logos/apple-touch-icon-72x72.png new file mode 100644 index 00000000..170656e0 Binary files /dev/null and b/media/logos/apple-touch-icon-72x72.png differ diff --git a/templates/base.html b/templates/base.html index 1a217505..3b509070 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,6 +8,9 @@ <link rel="stylesheet" type="text/css" href="/media/archweb-print.css" media="print" /> <link rel="icon" type="image/x-icon" href="/media/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="/media/favicon.ico" /> + <link rel="apple-touch-icon" href="/media/logos/apple-touch-icon-57x57.png" /> + <link rel="apple-touch-icon" sizes="72x72" href="/media/logos/apple-touch-icon-72x72.png" /> + <link rel="apple-touch-icon" sizes="114x114" href="/media/logos/apple-touch-icon-114x114.png" /> <link rel="search" type="application/opensearchdescription+xml" href="{% url opensearch-packages as osp %}{{ osp }}" title="Arch Linux Packages" /> {% block head %}{% endblock %} </head> -- cgit v1.2.3-54-g00ecf From 09ea244420a4f8687c9b0122d867dabc5d7d577c Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Tue, 1 Nov 2011 16:45:12 -0500 Subject: Update donation text and links We are finally set up through SPI and Click&Pledge. Add the necessary text, buttons, and links for our new donation home. Signed-off-by: Dan McGee <dan@archlinux.org> --- media/donate.gif | Bin 2951 -> 0 bytes templates/public/donate.html | 37 ++++++++++--------------------------- templates/public/index.html | 25 ++++--------------------- 3 files changed, 14 insertions(+), 48 deletions(-) delete mode 100644 media/donate.gif (limited to 'templates') diff --git a/media/donate.gif b/media/donate.gif deleted file mode 100644 index d637428b..00000000 Binary files a/media/donate.gif and /dev/null differ diff --git a/templates/public/donate.html b/templates/public/donate.html index b5fc43df..0dcfcf2a 100644 --- a/templates/public/donate.html +++ b/templates/public/donate.html @@ -23,33 +23,16 @@ <h2>Donate to Arch Linux</h2> <h3>Monetary donations</h3> -{% comment %} - <p>Financial contributions are accepted via <a title="Click to donate now" - href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=aaronmgriffin@gmail.com&currency_code=USD">PayPal</a>. - Funds are used for server hardware upgrades, conventions, schwag giveaways and more.</p> - - <div id="paypal-button"> - <!-- paypal code --> - <form id="paypal-form" name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post"> - <p><input type="hidden" name="cmd" value="_xclick"/></p> - <p><input type="hidden" name="business" value="aaronmgriffin@gmail.com"/></p> - <p><input type="hidden" name="currency_code" value="USD"/></p> - <p><input type="hidden" name="tax" value="0"/></p> - <p><input type="hidden" name="lc" value="US"/></p> - <p><input type="hidden" name="bn" value="PP-DonationsBF"/></p> - <p><input type="hidden" name="item_name" value="Arch Linux Donation"/></p> - <p><input type="hidden" name="no_shipping" value="1"/></p> - <p><input type="hidden" name="cn" value="Suggestions/Comments"/></p> - <p><input type="hidden" name="no_note" value="1"/></p> - <p><input type="image" src="/media/donate.gif" name="submit" - title="Make a PayPal donation to the Arch Linux project" - alt="Make a PayPal donation to the Arch Linux project" - style="background:transparent;border:none;" /></p> - </form> - </div> -{% endcomment %} - <p>At the moment, we are currently not taking monetary donations, but we - may accept them again in the future.</p> + <p>Financial contributions are accepted via <a href="https://co.clickandpledge.com/Default.aspx?WID=47294" title="Donate via Click&Pledge to Arch Linux"/>Click&Pledge</a>. + Arch Linux is a member project of the + <a href="http://www.spi-inc.org/">Software in the Public Interest, Inc.</a> + non-profit corporation. Funds are used for hosting costs, server hardware + upgrades, and more. You are encouraged to learn more about the SPI, as well + as <a href="http://www.spi-inc.org/donations/">how donations work</a>.</p> + + <a href="https://co.clickandpledge.com/Default.aspx?WID=47294"> + <img src="http://images.clickandpledge.com/flair/buttons/210x34/CP_EN_BK_S_001.gif" alt="Online donation system by ClickandPledge" title="Online donation system by ClickandPledge"/> + </a> <h3>Commercial sponsors and contributions</h3> diff --git a/templates/public/index.html b/templates/public/index.html index b63876ac..06a6a0c3 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -206,28 +206,11 @@ <h4>About</h4> </div><!-- #nav-sidebar --> -{% comment %} -<div id="home-paypal-button" class="widget"> - - <form id="paypal-form" name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post"> - <p><input type="hidden" name="cmd" value="_xclick"/></p> - <p><input type="hidden" name="business" value="aaronmgriffin@gmail.com"/></p> - <p><input type="hidden" name="currency_code" value="USD"/></p> - <p><input type="hidden" name="tax" value="0"/></p> - <p><input type="hidden" name="lc" value="US"/></p> - <p><input type="hidden" name="bn" value="PP-DonationsBF"/></p> - <p><input type="hidden" name="item_name" value="Arch Linux Donation"/></p> - <p><input type="hidden" name="no_shipping" value="1"/></p> - <p><input type="hidden" name="cn" value="Suggestions/Comments"/></p> - <p><input type="hidden" name="no_note" value="1"/></p> - <p><input type="image" src="/media/donate.gif" name="submit" - title="Make a PayPal donation to the Arch Linux project" - alt="Make a PayPal donation to the Arch Linux project" - style="background:transparent;border:none;" /></p> - </form> - +<div id="home-donate-button" class="widget"> + <a href="https://co.clickandpledge.com/Default.aspx?WID=47294"> + <img src="http://images.clickandpledge.com/flair/buttons/210x34/CP_EN_BK_S_001.gif" alt="Donate via Click&Pledge to Arch Linux" title="Donate via Click&Pledge to Arch Linux"/> + </a> </div> -{% endcomment %} <div id="arch-sponsors" class="widget"> -- cgit v1.2.3-54-g00ecf From f26dcbf7285c62f0baa1c64ee813ad0ceff5c288 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Tue, 1 Nov 2011 17:19:22 -0500 Subject: Use copy of donate image in /media/ This ensures it gets served over HTTPS if the user was on a secure session to begin with. Signed-off-by: Dan McGee <dan@archlinux.org> --- templates/public/donate.html | 2 +- templates/public/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/public/donate.html b/templates/public/donate.html index 0dcfcf2a..514c1430 100644 --- a/templates/public/donate.html +++ b/templates/public/donate.html @@ -31,7 +31,7 @@ <h3>Monetary donations</h3> as <a href="http://www.spi-inc.org/donations/">how donations work</a>.</p> <a href="https://co.clickandpledge.com/Default.aspx?WID=47294"> - <img src="http://images.clickandpledge.com/flair/buttons/210x34/CP_EN_BK_S_001.gif" alt="Online donation system by ClickandPledge" title="Online donation system by ClickandPledge"/> + <img src="{% cdnprefix %}/media/CP_EN_BK_S_001.gif" alt="Donate via Click&Pledge to Arch Linux" title="Donate via Click&Pledge to Arch Linux"/> </a> <h3>Commercial sponsors and contributions</h3> diff --git a/templates/public/index.html b/templates/public/index.html index 06a6a0c3..854bd447 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -208,7 +208,7 @@ <h4>About</h4> <div id="home-donate-button" class="widget"> <a href="https://co.clickandpledge.com/Default.aspx?WID=47294"> - <img src="http://images.clickandpledge.com/flair/buttons/210x34/CP_EN_BK_S_001.gif" alt="Donate via Click&Pledge to Arch Linux" title="Donate via Click&Pledge to Arch Linux"/> + <img src="{% cdnprefix %}/media/CP_EN_BK_S_001.gif" alt="Donate via Click&Pledge to Arch Linux" title="Donate via Click&Pledge to Arch Linux"/> </a> </div> -- cgit v1.2.3-54-g00ecf From ac2278423a3d449fdfe8c813f1f2d391ef9aff08 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 14:59:00 -0500 Subject: Many signoff page improvements Add a new 'SignoffSpecification' model which will capture metadata regarding a specific package if it differs from the norm- e.g. more or less than 2 required signoffs, is known to be bad, a comment from the maintainer, etc. The groundwork is laid here; much of this will still need to be wired up in the future. Enhance the view with a lot more JS prettiness and add revoking of signoffs. The signoff page can be filtered and the links and all the fun stuff are totally dynamic now. Signed-off-by: Dan McGee <dan@archlinux.org> --- main/models.py | 11 -- media/archweb.css | 1 - media/archweb.js | 72 ++++++-- .../0010_auto__add_signoffspecification.py | 183 +++++++++++++++++++++ packages/models.py | 45 ++++- packages/urls.py | 1 + packages/views.py | 71 +++++--- templates/packages/differences.html | 2 +- templates/packages/signoff_cell.html | 12 ++ templates/packages/signoffs.html | 50 +++--- 10 files changed, 379 insertions(+), 69 deletions(-) create mode 100644 packages/migrations/0010_auto__add_signoffspecification.py create mode 100644 templates/packages/signoff_cell.html (limited to 'templates') diff --git a/main/models.py b/main/models.py index 780453c0..d55a9673 100644 --- a/main/models.py +++ b/main/models.py @@ -7,7 +7,6 @@ from main.utils import cache_function, make_choice, set_created_field from packages.models import PackageRelation -from packages.models import Signoff as PackageSignoff from datetime import datetime from itertools import groupby @@ -213,16 +212,6 @@ def maintainers(self): package_relations__pkgbase=self.pkgbase, package_relations__type=PackageRelation.MAINTAINER) - @property - def signoffs(self): - return PackageSignoff.objects.select_related('user').filter( - pkgbase=self.pkgbase, pkgver=self.pkgver, pkgrel=self.pkgrel, - epoch=self.epoch, arch=self.arch, repo=self.repo) - - def approved_for_signoff(self): - count = self.signoffs.filter(revoked__isnull=True).count() - return count >= PackageSignoff.REQUIRED - @cache_function(300) def applicable_arches(self): '''The list of (this arch) + (available agnostic arches).''' diff --git a/media/archweb.css b/media/archweb.css index ea2f3fb5..62dc4fbc 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -912,7 +912,6 @@ ul.admin-actions { #dev-signoffs .signed-username { color: #888; - margin-left: 0.5em; } /* iso testing feedback form */ diff --git a/media/archweb.js b/media/archweb.js index a51ae460..43812b33 100644 --- a/media/archweb.js +++ b/media/archweb.js @@ -139,7 +139,7 @@ function ajaxifyFiles() { /* packages/differences.html */ function filter_packages() { - // start with all rows, and then remove ones we shouldn't show + /* start with all rows, and then remove ones we shouldn't show */ var rows = $('#tbody_differences').children(); var all_rows = rows; if (!$('#id_multilib').is(':checked')) { @@ -150,12 +150,12 @@ function filter_packages() { rows = rows.filter('.' + arch); } if (!$('#id_minor').is(':checked')) { - // this check is done last because it is the most expensive + /* this check is done last because it is the most expensive */ var pat = /(.*)-(.+)/; rows = rows.filter(function(index) { var cells = $(this).children('td'); - // all this just to get the split version out of the table cell + /* all this just to get the split version out of the table cell */ var ver_a = cells.eq(2).find('span').text().match(pat); if (!ver_a) { return true; @@ -166,26 +166,26 @@ function filter_packages() { return true; } - // first check pkgver + /* first check pkgver */ if (ver_a[1] !== ver_b[1]) { return true; } - // pkgver matched, so see if rounded pkgrel matches + /* pkgver matched, so see if rounded pkgrel matches */ if (Math.floor(parseFloat(ver_a[2])) === Math.floor(parseFloat(ver_b[2]))) { return false; } - // pkgrel didn't match, so keep the row + /* pkgrel didn't match, so keep the row */ return true; }); } - // hide all rows, then show the set we care about + /* hide all rows, then show the set we care about */ all_rows.hide(); rows.show(); - // make sure we update the odd/even styling from sorting + /* make sure we update the odd/even styling from sorting */ $('.results').trigger('applyWidgets'); } -function filter_reset() { +function filter_packages_reset() { $('#id_archonly').val('both'); $('#id_multilib').removeAttr('checked'); $('#id_minor').removeAttr('checked'); @@ -213,26 +213,72 @@ function todolist_flag() { function signoff_package() { var link = this; $.getJSON(link.href, function(data) { + link = $(link); + var signoff = null; if (data.created) { - var signoff = $('<li>').addClass('signed-username').text(data.user); - $(link).append(signoff); + signoff = $('<li>').addClass('signed-username').text(data.user); + link.closest('td').children('ul').append(signoff); + } else if(data.user) { + signoff = link.closest('td').find('li').filter(function(index) { + return $(this).text() == data.user; + }); + } + console.log(signoff, data.revoked, data.user); + if (signoff && data.revoked) { + signoff.text(signoff.text() + ' (revoked)'); } /* update the approved column to reflect reality */ var approved; if (data.approved) { - approved = $(link).closest('tr').children('.signoff-no'); + approved = link.closest('tr').children('.signoff-no'); approved.text('Yes').addClass( 'signoff-yes').removeClass('signoff-no'); } else { - approved = $(link).closest('tr').children('.signoff-yes'); + approved = link.closest('tr').children('.signoff-yes'); approved.text('No').addClass( 'signoff-no').removeClass('signoff-yes'); } + link.removeAttr('title'); + /* Form our new link. The current will be something like + * '/packages/repo/arch/package/...' */ + var base_href = link.attr('href').split('/').slice(0, 5).join('/'); + if (data.revoked) { + link.text('Signoff'); + link.attr('href', base_href + '/signoff/'); + } else { + link.text('Revoke Signoff'); + link.attr('href', base_href + '/signoff/revoke/'); + } $('.results').trigger('updateCell', approved); }); return false; } +function filter_signoffs() { + /* start with all rows, and then remove ones we shouldn't show */ + var rows = $('#tbody_signoffs').children(); + var all_rows = rows; + $('#signoffs_filter .arch_filter').each(function() { + if (!$(this).is(':checked')) { + console.log($(this).val()); + rows = rows.not('.' + $(this).val()); + } + }); + if ($('#id_pending').is(':checked')) { + rows = rows.has('td.signoff-no'); + } + /* hide all rows, then show the set we care about */ + all_rows.hide(); + rows.show(); + /* make sure we update the odd/even styling from sorting */ + $('.results').trigger('applyWidgets'); +} +function filter_signoffs_reset() { + $('#signoffs_filter .arch_filter').attr('checked', 'checked'); + $('#id_pending').removeAttr('checked'); + filter_signoffs(); +} + /* visualizations */ function format_filesize(size, decimals) { /*var labels = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];*/ diff --git a/packages/migrations/0010_auto__add_signoffspecification.py b/packages/migrations/0010_auto__add_signoffspecification.py new file mode 100644 index 00000000..da24824e --- /dev/null +++ b/packages/migrations/0010_auto__add_signoffspecification.py @@ -0,0 +1,183 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + db.create_table('packages_signoffspecification', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('pkgbase', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), + ('pkgver', self.gf('django.db.models.fields.CharField')(max_length=255)), + ('pkgrel', self.gf('django.db.models.fields.CharField')(max_length=255)), + ('epoch', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), + ('arch', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.Arch'])), + ('repo', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.Repo'])), + ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), + ('created', self.gf('django.db.models.fields.DateTimeField')()), + ('required', self.gf('django.db.models.fields.PositiveIntegerField')(default=2)), + ('enabled', self.gf('django.db.models.fields.BooleanField')(default=True)), + ('known_bad', self.gf('django.db.models.fields.BooleanField')(default=False)), + ('comments', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), + )) + db.send_create_signal('packages', ['SignoffSpecification']) + + + def backwards(self, orm): + db.delete_table('packages_signoffspecification') + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'main.arch': { + 'Meta': {'ordering': "['name']", 'object_name': 'Arch', 'db_table': "'arches'"}, + 'agnostic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) + }, + 'main.package': { + 'Meta': {'ordering': "('pkgname',)", 'object_name': 'Package', 'db_table': "'packages'"}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Arch']"}), + 'build_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'compressed_size': ('main.models.PositiveBigIntegerField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'files_last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'flag_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'installed_size': ('main.models.PositiveBigIntegerField', [], {}), + 'last_update': ('django.db.models.fields.DateTimeField', [], {}), + 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), + 'packager_str': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pgp_signature': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgdesc': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), + 'pkgname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Repo']"}), + 'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) + }, + 'main.repo': { + 'Meta': {'ordering': "['name']", 'object_name': 'Repo', 'db_table': "'repos'"}, + 'bugs_category': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'bugs_project': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'staging': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'svn_root': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + }, + 'packages.conflict': { + 'Meta': {'ordering': "['name']", 'object_name': 'Conflict'}, + 'comparison': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'conflicts'", 'to': "orm['main.Package']"}), + 'version': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}) + }, + 'packages.license': { + 'Meta': {'ordering': "['name']", 'object_name': 'License'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'licenses'", 'to': "orm['main.Package']"}) + }, + 'packages.packagegroup': { + 'Meta': {'object_name': 'PackageGroup'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'groups'", 'to': "orm['main.Package']"}) + }, + 'packages.packagerelation': { + 'Meta': {'unique_together': "(('pkgbase', 'user', 'type'),)", 'object_name': 'PackageRelation'}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'type': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_relations'", 'to': "orm['auth.User']"}) + }, + 'packages.provision': { + 'Meta': {'ordering': "['name']", 'object_name': 'Provision'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'provides'", 'to': "orm['main.Package']"}), + 'version': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}) + }, + 'packages.replacement': { + 'Meta': {'ordering': "['name']", 'object_name': 'Replacement'}, + 'comparison': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'replaces'", 'to': "orm['main.Package']"}), + 'version': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}) + }, + 'packages.signoff': { + 'Meta': {'object_name': 'Signoff'}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Arch']"}), + 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Repo']"}), + 'revoked': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_signoffs'", 'to': "orm['auth.User']"}) + }, + 'packages.signoffspecification': { + 'Meta': {'object_name': 'SignoffSpecification'}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Arch']"}), + 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'known_bad': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Repo']"}), + 'required': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + } + } + + complete_apps = ['packages'] diff --git a/packages/models.py b/packages/models.py index 4cd3b1b5..ad082501 100644 --- a/packages/models.py +++ b/packages/models.py @@ -38,6 +38,49 @@ def __unicode__(self): class Meta: unique_together = (('pkgbase', 'user', 'type'),) +class SignoffSpecification(models.Model): + ''' + A specification for the signoff policy for this particular revision of a + pakcage. The default is requiring two signoffs for a given package. These + are created only if necessary; e.g., if one wanted to override the + required=2 attribute, otherwise a sane default object is used. + ''' + pkgbase = models.CharField(max_length=255, db_index=True) + pkgver = models.CharField(max_length=255) + pkgrel = models.CharField(max_length=255) + epoch = models.PositiveIntegerField(default=0) + arch = models.ForeignKey('main.Arch') + repo = models.ForeignKey('main.Repo') + user = models.ForeignKey(User) + created = models.DateTimeField(editable=False) + required = models.PositiveIntegerField(default=2) + enabled = models.BooleanField(default=True) + known_bad = models.BooleanField(default=False) + comments = models.TextField(null=True, blank=True) + +class SignoffManager(models.Manager): + def get_from_package(self, pkg, user, revoked=False): + '''Utility method to pull all relevant name-version fields from a + package and create a matching signoff.''' + not_revoked = not revoked + return Signoff.objects.get( + pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, + epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo, + revoked__isnull=not_revoked, user=user) + + def get_or_create_from_package(self, pkg, user): + '''Utility method to pull all relevant name-version fields from a + package and create a matching signoff.''' + return Signoff.objects.get_or_create( + pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, + epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo, + revoked=None, user=user) + + def for_package(self, pkg): + return self.select_related('user').filter( + pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, + epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo) + class Signoff(models.Model): ''' A signoff for a package (by pkgbase) at a given point in time. These are @@ -55,7 +98,7 @@ class Signoff(models.Model): revoked = models.DateTimeField(null=True) comments = models.TextField(null=True, blank=True) - REQUIRED = 2 + objects = SignoffManager() @property def packages(self): diff --git a/packages/urls.py b/packages/urls.py index d7d01170..576e3279 100644 --- a/packages/urls.py +++ b/packages/urls.py @@ -10,6 +10,7 @@ (r'^unflag/$', 'unflag'), (r'^unflag/all/$', 'unflag_all'), (r'^signoff/$', 'signoff_package'), + (r'^signoff/revoke/$', 'signoff_package', {'revoke': True}), (r'^download/$', 'download'), ) diff --git a/packages/views.py b/packages/views.py index 5114c87f..035d51cb 100644 --- a/packages/views.py +++ b/packages/views.py @@ -25,7 +25,7 @@ from main.models import Package, PackageFile, Arch, Repo from main.utils import make_choice, groupby_preserve_order, PackageStandin from mirrors.models import MirrorUrl -from .models import PackageRelation, PackageGroup, Signoff +from .models import PackageRelation, PackageGroup, SignoffSpecification, Signoff from .utils import (get_group_info, get_differences_info, get_wrong_permissions, get_current_signoffs) @@ -369,14 +369,24 @@ def unflag_all(request, name, repo, arch): pkgs.update(flag_date=None) return redirect(pkg) +DEFAULT_SIGNOFF_SPEC = SignoffSpecification(required=2) + +def approved_by_signoffs(signoffs, spec=DEFAULT_SIGNOFF_SPEC): + if signoffs: + good_signoffs = sum(1 for s in signoffs if not s.revoked) + return good_signoffs >= spec.required + return False + class PackageSignoffGroup(object): '''Encompasses all packages in testing with the same pkgbase.''' - def __init__(self, packages, target_repo=None, signoffs=None): + def __init__(self, packages, user=None): if len(packages) == 0: raise Exception self.packages = packages - self.target_repo = target_repo - self.signoffs = signoffs + self.user = user + self.target_repo = None + self.signoffs = set() + self.specification = DEFAULT_SIGNOFF_SPEC first = packages[0] self.pkgbase = first.pkgbase @@ -406,21 +416,24 @@ def package(self): def find_signoffs(self, all_signoffs): '''Look through a list of Signoff objects for ones matching this particular group and store them on the object.''' - if self.signoffs is None: - self.signoffs = [] for s in all_signoffs: if s.pkgbase != self.pkgbase: continue if self.version and not s.full_version == self.version: continue if s.arch_id == self.arch.id and s.repo_id == self.repo.id: - self.signoffs.append(s) + self.signoffs.add(s) def approved(self): - if self.signoffs: - good_signoffs = [s for s in self.signoffs if not s.revoked] - return len(good_signoffs) >= Signoff.REQUIRED - return False + return approved_by_signoffs(self.signoffs, self.specification) + + def user_signed_off(self, user=None): + '''Did a given user signoff on this package? user can be passed as an + argument, or attached to the group object itself so this can be called + from a template.''' + if user is None: + user = self.user + return user in (s.user for s in self.signoffs if not s.revoked) @permission_required('main.change_package') @never_cache @@ -443,7 +456,7 @@ def signoffs(request): grouped = groupby_preserve_order(packages, same_pkgbase_key) signoff_groups = [] for group in grouped: - signoff_group = PackageSignoffGroup(group) + signoff_group = PackageSignoffGroup(group, user=request.user) signoff_group.target_repo = pkgtorepo.get(signoff_group.pkgbase, "Unknown") signoff_group.find_signoffs(signoffs) @@ -451,27 +464,43 @@ def signoffs(request): signoff_groups.sort(key=attrgetter('pkgbase')) - return direct_to_template(request, 'packages/signoffs.html', - {'signoff_groups': signoff_groups}) + context = { + 'signoff_groups': signoff_groups, + 'arches': Arch.objects.all(), + } + return direct_to_template(request, 'packages/signoffs.html', context) @permission_required('main.change_package') @never_cache -def signoff_package(request, name, repo, arch): +def signoff_package(request, name, repo, arch, revoke=False): packages = get_list_or_404(Package, pkgbase=name, arch__name=arch, repo__name__iexact=repo, repo__testing=True) - pkg = packages[0] - signoff, created = Signoff.objects.get_or_create( - pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, - epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo, user=request.user) + package = packages[0] + + if revoke: + try: + signoff = Signoff.objects.get_from_package( + package, request.user, False) + except Signoff.DoesNotExist: + raise Http404 + signoff.revoked = datetime.utcnow() + signoff.save() + created = False + else: + signoff, created = Signoff.objects.get_or_create_from_package( + package, request.user) + + all_signoffs = Signoff.objects.for_package(package) if request.is_ajax(): data = { 'created': created, - 'approved': pkg.approved_for_signoff(), + 'revoked': bool(signoff.revoked), + 'approved': approved_by_signoffs(all_signoffs), 'user': str(request.user), } - return HttpResponse(simplejson.dumps(data), + return HttpResponse(simplejson.dumps(data, ensure_ascii=False), mimetype='application/json') return redirect('package-signoffs') diff --git a/templates/packages/differences.html b/templates/packages/differences.html index dd1046bc..0400ea37 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -65,7 +65,7 @@ <h3>Filter Differences View</h3> $('.results').tablesorter({widgets: ['zebra'], sortList: [[1,0], [0,0]]}); $('#diff_filter select').change(filter_packages); $('#diff_filter input').change(filter_packages); - $('#criteria_reset').click(filter_reset); + $('#criteria_reset').click(filter_differences_reset); // fire function on page load to ensure the current form selections take effect filter_packages(); }); diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html new file mode 100644 index 00000000..fce5d551 --- /dev/null +++ b/templates/packages/signoff_cell.html @@ -0,0 +1,12 @@ +<ul> + {% for signoff in group.signoffs %} + <li class="signed-username" title="Signed off by {{ signoff.user }}">{{ signoff.user }}{% if signoff.revoked %} (revoked){% endif %}</li> + {% endfor %} +</ul> +{% if group.user_signed_off %} +<div><a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/revoke/" + title="Revoke signoff {{ group.package.pkgname }} for {{ group.package.arch }}">Revoke Signoff</a></div> +{% else %} +<div><a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/" + title="Signoff {{ group.package.pkgname }} for {{ group.package.arch }}">Signoff</a></div> +{% endif %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index a8aa4de2..4a2f6c99 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -12,42 +12,46 @@ <h2>Package Signoffs</h2> <p>{{ signoff_groups|length }} signoff group{{ signoff_groups|pluralize }} found. A "signoff group" consists of packages grouped by pkgbase, architecture, and repository.</p> + <div class="box filter-criteria"> + <h3>Filter Displayed Signoffs</h3> + <form id="signoffs_filter" method="post" action="."> + <fieldset> + <legend>Select filter criteria</legend> + {% for arch in arches %} + <div><label for="id_arch_{{ arch.name }}" title="Architecture {{ arch.name }}">Arch {{ arch.name }}</label> + <input type="checkbox" name="arch_{{ arch.name }}" id="id_arch_{{ arch.name }}" class="arch_filter" value="{{ arch.name }}" checked="checked"/></div> + {% endfor %} + <div><label for="id_pending" title="Packages with not enough signoffs">Only Pending Approval</label> + <input type="checkbox" name="pending" id="id_pending" value="pending"/></div> + <div ><label> </label><input title="Reset search criteria" type="button" id="criteria_reset" value="Reset"/></div> + </fieldset> + </form> + </div> + <table id="signoffs" class="results"> <thead> <tr> + <th>Package Base/Version</th> <th>Arch</th> - <th>Package Base</th> + <th>Target Repo</th> <th># of Packages</th> - <th>Version</th> <th>Last Updated</th> - <th>Target Repo</th> <th>Approved</th> - <th>Signoff</th> + <th>Signoffs</th> </tr> </thead> - <tbody> + <tbody id="tbody_signoffs"> {% for group in signoff_groups %} {% with group.package as pkg %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr class="{% cycle 'odd' 'even' %} {{ pkg.arch.name }}"> + <td>{% pkg_details_link pkg %} {{ pkg.full_version }}</td> <td>{{ pkg.arch.name }}</td> - <td>{% pkg_details_link pkg %}</td> + <td>{{ group.target_repo }}</td> <td>{{ group.packages|length }}</td> - <td>{{ pkg.full_version }}</td> <td>{{ pkg.last_update|date }}</td> - <td>{{ group.target_repo }}</td> <td class="signoff-{{ group.approved|yesno }}"> {{ group.approved|yesno|capfirst }}</td> - <td> - <ul> - <li><a class="signoff-link" href="{{ pkg.get_absolute_url }}signoff/" - title="Signoff {{ pkg.pkgname }} for {{ pkg.arch }}">Signoff</a> - </li> - {% for signoff in group.signoffs %} - <li class="signed-username" title="Signed off by {{ signoff.user }}"> - {{ signoff.user }}{% if signoff.revoked %} (revoked){% endif %}</li> - {% endfor %} - </ul> - </td> + <td>{% include "packages/signoff_cell.html" %}</td> </tr> {% endwith %} {% endfor %} @@ -60,8 +64,12 @@ <h2>Package Signoffs</h2> <script type="text/javascript"> $(document).ready(function() { $('a.signoff-link').click(signoff_package); - $(".results").tablesorter({widgets: ['zebra'], sortList: [[1,0]], + $(".results").tablesorter({widgets: ['zebra'], sortList: [[0,0]], headers: { 6: { sorter: false } } }); + $('#signoffs_filter input').change(filter_signoffs); + $('#criteria_reset').click(filter_signoffs_reset); + // fire function on page load to ensure the current form selections take effect + filter_signoffs(); }); </script> {% endblock %} -- cgit v1.2.3-54-g00ecf From 74d2a5df5ca7ee4b6497a6e7609491d72cdbb309 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 17:18:13 -0500 Subject: Refactor more package signoff stuff This sets up some shared utility code for use in a later package signoff email report command. Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/models.py | 7 +- packages/utils.py | 134 ++++++++++++++++++++++++++++++++--- packages/views.py | 100 ++------------------------ templates/packages/signoff_cell.html | 4 +- templates/packages/signoffs.html | 12 ++-- 5 files changed, 144 insertions(+), 113 deletions(-) (limited to 'templates') diff --git a/packages/models.py b/packages/models.py index ad082501..3c319fe7 100644 --- a/packages/models.py +++ b/packages/models.py @@ -115,8 +115,11 @@ def full_version(self): return u'%s-%s' % (self.pkgver, self.pkgrel) def __unicode__(self): - return u'%s-%s: %s' % ( - self.pkgbase, self.full_version, self.user) + revoked = u'' + if self.revoked: + revoked = u' (revoked)' + return u'%s-%s: %s%s' % ( + self.pkgbase, self.full_version, self.user, revoked) class PackageGroup(models.Model): ''' diff --git a/packages/utils.py b/packages/utils.py index c8c1f8a6..42cfbe0f 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -1,12 +1,11 @@ -from collections import defaultdict from operator import itemgetter from django.db import connection from django.db.models import Count, Max -from main.models import Package -from main.utils import cache_function -from .models import PackageGroup, PackageRelation, Signoff +from main.models import Package, Repo +from main.utils import cache_function, groupby_preserve_order, PackageStandin +from .models import PackageGroup, PackageRelation, SignoffSpecification, Signoff @cache_function(300) def get_group_info(include_arches=None): @@ -148,8 +147,90 @@ def get_wrong_permissions(): id__in=to_fetch) return relations -def get_current_signoffs(): - '''Returns a mapping of pkgbase -> signoff objects.''' + +DEFAULT_SIGNOFF_SPEC = SignoffSpecification() + +def approved_by_signoffs(signoffs, spec=DEFAULT_SIGNOFF_SPEC): + if signoffs: + good_signoffs = sum(1 for s in signoffs if not s.revoked) + return good_signoffs >= spec.required + return False + +class PackageSignoffGroup(object): + '''Encompasses all packages in testing with the same pkgbase.''' + def __init__(self, packages, user=None): + if len(packages) == 0: + raise Exception + self.packages = packages + self.user = user + self.target_repo = None + self.signoffs = set() + self.specification = DEFAULT_SIGNOFF_SPEC + + first = packages[0] + self.pkgbase = first.pkgbase + self.arch = first.arch + self.repo = first.repo + self.version = '' + self.last_update = first.last_update + self.packager = first.packager + + version = first.full_version + if all(version == pkg.full_version for pkg in packages): + self.version = version + + @property + def package(self): + '''Try and return a relevant single package object representing this + group. Start by seeing if there is only one package, then look for the + matching package by name, finally falling back to a standin package + object.''' + if len(self.packages) == 1: + return self.packages[0] + + same_pkgs = [p for p in self.packages if p.pkgname == p.pkgbase] + if same_pkgs: + return same_pkgs[0] + + return PackageStandin(self.packages[0]) + + def find_signoffs(self, all_signoffs): + '''Look through a list of Signoff objects for ones matching this + particular group and store them on the object.''' + for s in all_signoffs: + if s.pkgbase != self.pkgbase: + continue + if self.version and not s.full_version == self.version: + continue + if s.arch_id == self.arch.id and s.repo_id == self.repo.id: + self.signoffs.add(s) + + def approved(self): + return approved_by_signoffs(self.signoffs, self.specification) + + @property + def completed(self): + return sum(1 for s in self.signoffs if not s.revoked) + + @property + def required(self): + return self.specification.required + + def user_signed_off(self, user=None): + '''Did a given user signoff on this package? user can be passed as an + argument, or attached to the group object itself so this can be called + from a template.''' + if user is None: + user = self.user + return user in (s.user for s in self.signoffs if not s.revoked) + + def __unicode__(self): + return u'%s-%s (%s): %d' % ( + self.pkgbase, self.version, self.arch, len(self.signoffs)) + +def get_current_signoffs(repos): + '''Returns a mapping of pkgbase -> signoff objects for the given repos.''' + cursor = connection.cursor() sql = """ SELECT DISTINCT s.id FROM packages_signoff s @@ -162,14 +243,49 @@ def get_current_signoffs(): AND s.repo_id = p.repo_id ) JOIN repos r ON p.repo_id = r.id - WHERE r.testing = %s + WHERE r.id IN ( """ - cursor = connection.cursor() - cursor.execute(sql, [True]) + sql += ", ".join("%s" for r in repos) + sql += ")" + cursor.execute(sql, [r.id for r in repos]) + results = cursor.fetchall() # fetch all of the returned signoffs by ID to_fetch = [row[0] for row in results] signoffs = Signoff.objects.select_related('user').in_bulk(to_fetch) return signoffs.values() +def get_target_repo_map(pkgbases): + package_repos = Package.objects.order_by().values_list( + 'pkgbase', 'repo__name').filter( + repo__testing=False, repo__staging=False, + pkgbase__in=pkgbases).distinct() + return dict(package_repos) + +def get_signoff_groups(repos=None): + if repos is None: + repos = Repo.objects.filter(testing=True) + + test_pkgs = Package.objects.normal().filter(repo__in=repos) + packages = test_pkgs.order_by('pkgname') + + # Collect all pkgbase values in testing repos + q_pkgbase = test_pkgs.values('pkgbase') + pkgtorepo = get_target_repo_map(q_pkgbase) + + # Collect all existing signoffs for these packages + signoffs = get_current_signoffs(repos) + + same_pkgbase_key = lambda x: (x.repo.name, x.arch.name, x.pkgbase) + grouped = groupby_preserve_order(packages, same_pkgbase_key) + signoff_groups = [] + for group in grouped: + signoff_group = PackageSignoffGroup(group) + signoff_group.target_repo = pkgtorepo.get(signoff_group.pkgbase, + "Unknown") + signoff_group.find_signoffs(signoffs) + signoff_groups.append(signoff_group) + + return signoff_groups + # vim: set ts=4 sw=4 et: diff --git a/packages/views.py b/packages/views.py index 035d51cb..e102760b 100644 --- a/packages/views.py +++ b/packages/views.py @@ -23,11 +23,11 @@ from urllib import urlencode from main.models import Package, PackageFile, Arch, Repo -from main.utils import make_choice, groupby_preserve_order, PackageStandin +from main.utils import make_choice from mirrors.models import MirrorUrl -from .models import PackageRelation, PackageGroup, SignoffSpecification, Signoff +from .models import PackageRelation, PackageGroup, Signoff from .utils import (get_group_info, get_differences_info, - get_wrong_permissions, get_current_signoffs) + get_wrong_permissions, get_signoff_groups, approved_by_signoffs) class PackageJSONEncoder(DjangoJSONEncoder): pkg_attributes = [ 'pkgname', 'pkgbase', 'repo', 'arch', 'pkgver', @@ -369,100 +369,12 @@ def unflag_all(request, name, repo, arch): pkgs.update(flag_date=None) return redirect(pkg) -DEFAULT_SIGNOFF_SPEC = SignoffSpecification(required=2) - -def approved_by_signoffs(signoffs, spec=DEFAULT_SIGNOFF_SPEC): - if signoffs: - good_signoffs = sum(1 for s in signoffs if not s.revoked) - return good_signoffs >= spec.required - return False - -class PackageSignoffGroup(object): - '''Encompasses all packages in testing with the same pkgbase.''' - def __init__(self, packages, user=None): - if len(packages) == 0: - raise Exception - self.packages = packages - self.user = user - self.target_repo = None - self.signoffs = set() - self.specification = DEFAULT_SIGNOFF_SPEC - - first = packages[0] - self.pkgbase = first.pkgbase - self.arch = first.arch - self.repo = first.repo - self.version = '' - - version = first.full_version - if all(version == pkg.full_version for pkg in packages): - self.version = version - - @property - def package(self): - '''Try and return a relevant single package object representing this - group. Start by seeing if there is only one package, then look for the - matching package by name, finally falling back to a standin package - object.''' - if len(self.packages) == 1: - return self.packages[0] - - same_pkgs = [p for p in self.packages if p.pkgname == p.pkgbase] - if same_pkgs: - return same_pkgs[0] - - return PackageStandin(self.packages[0]) - - def find_signoffs(self, all_signoffs): - '''Look through a list of Signoff objects for ones matching this - particular group and store them on the object.''' - for s in all_signoffs: - if s.pkgbase != self.pkgbase: - continue - if self.version and not s.full_version == self.version: - continue - if s.arch_id == self.arch.id and s.repo_id == self.repo.id: - self.signoffs.add(s) - - def approved(self): - return approved_by_signoffs(self.signoffs, self.specification) - - def user_signed_off(self, user=None): - '''Did a given user signoff on this package? user can be passed as an - argument, or attached to the group object itself so this can be called - from a template.''' - if user is None: - user = self.user - return user in (s.user for s in self.signoffs if not s.revoked) - @permission_required('main.change_package') @never_cache def signoffs(request): - test_pkgs = Package.objects.normal().filter(repo__testing=True) - packages = test_pkgs.order_by('pkgname') - - # Collect all pkgbase values in testing repos - q_pkgbase = test_pkgs.values('pkgbase') - package_repos = Package.objects.order_by().values_list( - 'pkgbase', 'repo__name').filter( - repo__testing=False, repo__staging=False, - pkgbase__in=q_pkgbase).distinct() - pkgtorepo = dict(package_repos) - - # Collect all existing signoffs for these packages - signoffs = get_current_signoffs() - - same_pkgbase_key = lambda x: (x.repo.name, x.arch.name, x.pkgbase) - grouped = groupby_preserve_order(packages, same_pkgbase_key) - signoff_groups = [] - for group in grouped: - signoff_group = PackageSignoffGroup(group, user=request.user) - signoff_group.target_repo = pkgtorepo.get(signoff_group.pkgbase, - "Unknown") - signoff_group.find_signoffs(signoffs) - signoff_groups.append(signoff_group) - - signoff_groups.sort(key=attrgetter('pkgbase')) + signoff_groups = sorted(get_signoff_groups(), key=attrgetter('pkgbase')) + for group in signoff_groups: + group.user = request.user context = { 'signoff_groups': signoff_groups, diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index fce5d551..87216193 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -5,8 +5,8 @@ </ul> {% if group.user_signed_off %} <div><a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/revoke/" - title="Revoke signoff {{ group.package.pkgname }} for {{ group.package.arch }}">Revoke Signoff</a></div> + title="Revoke signoff {{ group.pkgbase }} for {{ group.arch }}">Revoke Signoff</a></div> {% else %} <div><a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/" - title="Signoff {{ group.package.pkgname }} for {{ group.package.arch }}">Signoff</a></div> + title="Signoff {{ group.pkgbase }} for {{ group.arch }}">Signoff</a></div> {% endif %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 4a2f6c99..8d57a8c5 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -34,6 +34,7 @@ <h3>Filter Displayed Signoffs</h3> <th>Package Base/Version</th> <th>Arch</th> <th>Target Repo</th> + <th>Packager</th> <th># of Packages</th> <th>Last Updated</th> <th>Approved</th> @@ -42,18 +43,17 @@ <h3>Filter Displayed Signoffs</h3> </thead> <tbody id="tbody_signoffs"> {% for group in signoff_groups %} - {% with group.package as pkg %} - <tr class="{% cycle 'odd' 'even' %} {{ pkg.arch.name }}"> - <td>{% pkg_details_link pkg %} {{ pkg.full_version }}</td> - <td>{{ pkg.arch.name }}</td> + <tr class="{% cycle 'odd' 'even' %} {{ group.arch.name }}"> + <td>{% pkg_details_link group.package %} {{ group.version }}</td> + <td>{{ group.arch.name }}</td> <td>{{ group.target_repo }}</td> + <td>{{ group.packager|default:"Unknown" }}</td> <td>{{ group.packages|length }}</td> - <td>{{ pkg.last_update|date }}</td> + <td>{{ group.last_update|date }}</td> <td class="signoff-{{ group.approved|yesno }}"> {{ group.approved|yesno|capfirst }}</td> <td>{% include "packages/signoff_cell.html" %}</td> </tr> - {% endwith %} {% endfor %} </tbody> </table> -- cgit v1.2.3-54-g00ecf From 49ac7efd683152e4936f8013bb7a001470260034 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 17:18:55 -0500 Subject: Package signoff email report, initial revision Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/management/__init__.py | 0 packages/management/commands/__init__.py | 0 packages/management/commands/signoff_report.py | 110 +++++++++++++++++++++++++ templates/packages/signoff_report.txt | 27 ++++++ 4 files changed, 137 insertions(+) create mode 100644 packages/management/__init__.py create mode 100644 packages/management/commands/__init__.py create mode 100644 packages/management/commands/signoff_report.py create mode 100644 templates/packages/signoff_report.txt (limited to 'templates') diff --git a/packages/management/__init__.py b/packages/management/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/packages/management/commands/__init__.py b/packages/management/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py new file mode 100644 index 00000000..17e58f39 --- /dev/null +++ b/packages/management/commands/signoff_report.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +""" +signoff_report command + +Send an email summarizing the state of outstanding signoffs for the given +repository. + +Usage: ./manage.py signoff_report <email> <repository> +""" + +from django.core.urlresolvers import reverse +from django.core.management.base import BaseCommand, CommandError +from django.contrib.auth.models import User +from django.contrib.sites.models import Site +from django.db.models import Count +from django.template import loader, Context + +from collections import namedtuple +from datetime import datetime, timedelta +import logging +from operator import attrgetter +import sys + +from main.models import Package, Repo +from packages.models import Signoff +from packages.utils import get_signoff_groups + +logging.basicConfig( + level=logging.INFO, + format='%(asctime)s -> %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S', + stream=sys.stderr) +logger = logging.getLogger() + +class Command(BaseCommand): + args = "<email> <repository>" + help = "Send a signoff report for the given repository." + + def handle(self, *args, **options): + v = int(options.get('verbosity', None)) + if v == 0: + logger.level = logging.ERROR + elif v == 1: + logger.level = logging.INFO + elif v == 2: + logger.level = logging.DEBUG + + if len(args) != 2: + raise CommandError("email and repository must be provided") + + return generate_report(args[0], args[1]) + +def generate_report(email, repo_name): + repo = Repo.objects.get(name__iexact=repo_name) + # Collect all existing signoffs for these packages + signoff_groups = sorted(get_signoff_groups([repo]), + key=attrgetter('target_repo', 'arch', 'pkgbase')) + complete = [] + incomplete = [] + new = [] + old = [] + + new_hours = 24 + old_days = 14 + now = datetime.utcnow() + new_cutoff = now - timedelta(hours=new_hours) + old_cutoff = now - timedelta(days=old_days) + + for group in signoff_groups: + if group.approved(): + complete.append(group) + else: + incomplete.append(group) + if group.package.last_update > new_cutoff: + new.append(group) + if group.package.last_update < old_cutoff: + old.append(group) + + old.sort(key=attrgetter('last_update')) + + proto = 'https' + domain = Site.objects.get_current().domain + signoffs_url = '%s://%s%s' % (proto, domain, reverse('package-signoffs')) + + # and the fun bit + Leader = namedtuple('Leader', ['user', 'count']) + leaders = Signoff.objects.filter(created__gt=new_cutoff, + revoked__isnull=True).values_list('user').annotate( + signoff_count=Count('pk')).order_by('-signoff_count')[:5] + users = User.objects.in_bulk([l[0] for l in leaders]) + leaders = (Leader(users[l[0]], l[1]) for l in leaders) + + subject = 'Signoff report for [%s]' % repo.name.lower() + t = loader.get_template('packages/signoff_report.txt') + c = Context({ + 'repo': repo, + 'signoffs_url': signoffs_url, + 'incomplete': incomplete, + 'complete': complete, + 'new': new, + 'new_hours': new_hours, + 'old': old, + 'old_days': old_days, + 'leaders': leaders, + }) + from_addr = 'Arch Website Notification <nobody@archlinux.org>' + #send_mail(subject, t.render(c), from_addr, email) + print t.render(c) + +# vim: set ts=4 sw=4 et: diff --git a/templates/packages/signoff_report.txt b/templates/packages/signoff_report.txt new file mode 100644 index 00000000..84e3fc6b --- /dev/null +++ b/templates/packages/signoff_report.txt @@ -0,0 +1,27 @@ +=== {% autoescape off %}Signoff report for [{{ repo|lower }}] === +{{ signoffs_url }} + +== New packages in [{{ repo|lower}}] in last {{ new_hours }} hours ({{ new|length }} total) == +{% for group in new %} +* {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}){% endfor %} + +{% regroup incomplete by target_repo as by_repo %}{% for target_repo in by_repo %} +== Incomplete signoffs for [{{ target_repo.grouper|lower }}] ({{ target_repo.list|length }} total) == +{% for group in target_repo.list %} +* {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}) + {{ group.completed }}/{{ group.required }} signoffs{% endfor %} +{% endfor %} + +== Completed signoffs ({{ complete|length }} total) == +{% for group in complete %} +* {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}){% endfor %} + + +== All packages in [{{ repo|lower }}] for more than {{ old_days }} days ({{ old|length }} total) == +{% for group in old %} +* {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}), since {{ group.last_update|date }}{% endfor %} +{% endautoescape %} + +== Top five in signoffs in last {{ new_hours }} hours == +{% for leader in leaders %} +{{ forloop.counter }}. {{ leader.user }} - {{ leader.count }} signoffs{% endfor %} -- cgit v1.2.3-54-g00ecf From caa15d61a3882d1076378ae406bb2effcb63ff87 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 17:29:05 -0500 Subject: Minor tweaks to style and sorting of signoffs Signed-off-by: Dan McGee <dan@archlinux.org> --- media/archweb.css | 4 ++++ templates/packages/signoffs.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/media/archweb.css b/media/archweb.css index 62dc4fbc..f817e18d 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -895,6 +895,10 @@ ul.admin-actions { } /* dev: signoff page */ +#dev-signoffs tr:hover { + background: #ffd; +} + #dev-signoffs ul { list-style: none; margin: 0; diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 8d57a8c5..0bdc6d46 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -65,7 +65,7 @@ <h3>Filter Displayed Signoffs</h3> $(document).ready(function() { $('a.signoff-link').click(signoff_package); $(".results").tablesorter({widgets: ['zebra'], sortList: [[0,0]], - headers: { 6: { sorter: false } } }); + headers: { 7: { sorter: false } } }); $('#signoffs_filter input').change(filter_signoffs); $('#criteria_reset').click(filter_signoffs_reset); // fire function on page load to ensure the current form selections take effect -- cgit v1.2.3-54-g00ecf From e3e3e498765ab416a2902adf114cd3270e3eb12e Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Wed, 2 Nov 2011 09:47:02 -0500 Subject: Add URL to todolist email Signed-off-by: Dan McGee <dan@archlinux.org> --- main/models.py | 5 +++++ templates/todolists/email_notification.txt | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/main/models.py b/main/models.py index d55a9673..972b098c 100644 --- a/main/models.py +++ b/main/models.py @@ -470,6 +470,11 @@ class Meta: def get_absolute_url(self): return '/todo/%i/' % self.id + def get_full_url(self, proto='https'): + '''get a URL suitable for things like email including the domain''' + domain = Site.objects.get_current().domain + return '%s://%s%s' % (proto, domain, self.get_absolute_url()) + class TodolistPkg(models.Model): list = models.ForeignKey(Todolist) pkg = models.ForeignKey(Package) diff --git a/templates/todolists/email_notification.txt b/templates/todolists/email_notification.txt index 10b50f64..8b22b465 100644 --- a/templates/todolists/email_notification.txt +++ b/templates/todolists/email_notification.txt @@ -1,10 +1,11 @@ -{% autoescape off %}The todo list {{ todolist.name }} has had the following packages added to it for which you are a maintainer: +{% autoescape off %}The todo list "{{ todolist.name }}" has had the following packages added to it for which you are a maintainer: {% for tpkg in todo_packages %} * {{ tpkg.pkg.repo.name|lower }}/{{ tpkg.pkg.pkgname }} ({{ tpkg.pkg.arch.name }}) - {{ tpkg.pkg.get_full_url }}{% endfor %} Todo list information: -Creator: {{todolist.creator.get_full_name}} -Name: {{todolist.name}} +Name: {{ todolist.name }} +URL: {{ todolist.get_full_url }} +Creator: {{ todolist.creator.get_full_name }} Description: -{{todolist.description|striptags|wordwrap:69}}{% endautoescape %} +{{ todolist.description|striptags|wordwrap:78 }}{% endautoescape %} -- cgit v1.2.3-54-g00ecf From 8187b87143081a2be75032db91287f9deb9d1f89 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 19:10:07 -0500 Subject: Add signoff options form and data entry page This allows the criteria and other information about certain signoffs to be overridden as necessary. Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/models.py | 52 ++++++++++++++++++++++++++------- packages/urls.py | 1 + packages/views.py | 40 ++++++++++++++++++++++++- templates/packages/signoff_cell.html | 15 ++++++++-- templates/packages/signoff_options.html | 18 ++++++++++++ templates/packages/signoffs.html | 3 +- 6 files changed, 113 insertions(+), 16 deletions(-) create mode 100644 templates/packages/signoff_options.html (limited to 'templates') diff --git a/packages/models.py b/packages/models.py index 3c319fe7..a2b53a06 100644 --- a/packages/models.py +++ b/packages/models.py @@ -38,6 +38,22 @@ def __unicode__(self): class Meta: unique_together = (('pkgbase', 'user', 'type'),) + +class SignoffSpecificationManager(models.Manager): + def get_from_package(self, pkg): + '''Utility method to pull all relevant name-version fields from a + package and get a matching specification.''' + return self.get( + pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, + epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo) + + def get_or_create_from_package(self, pkg): + '''Utility method to pull all relevant name-version fields from a + package and get or create a matching specification.''' + return self.get_or_create( + pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, + epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo) + class SignoffSpecification(models.Model): ''' A specification for the signoff policy for this particular revision of a @@ -53,25 +69,40 @@ class SignoffSpecification(models.Model): repo = models.ForeignKey('main.Repo') user = models.ForeignKey(User) created = models.DateTimeField(editable=False) - required = models.PositiveIntegerField(default=2) - enabled = models.BooleanField(default=True) - known_bad = models.BooleanField(default=False) + required = models.PositiveIntegerField(default=2, + help_text="How many signoffs are required for this package?") + enabled = models.BooleanField(default=True, + help_text="Is this package eligible for signoffs?") + known_bad = models.BooleanField(default=False, + help_text="Is package is known to be broken in some way?") comments = models.TextField(null=True, blank=True) + objects = SignoffSpecificationManager() + + @property + def full_version(self): + if self.epoch > 0: + return u'%d:%s-%s' % (self.epoch, self.pkgver, self.pkgrel) + return u'%s-%s' % (self.pkgver, self.pkgrel) + + def __unicode__(self): + return u'%s-%s' % (self.pkgbase, self.full_version) + + class SignoffManager(models.Manager): def get_from_package(self, pkg, user, revoked=False): '''Utility method to pull all relevant name-version fields from a - package and create a matching signoff.''' + package and get a matching signoff.''' not_revoked = not revoked - return Signoff.objects.get( + return self.get( pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo, revoked__isnull=not_revoked, user=user) def get_or_create_from_package(self, pkg, user): '''Utility method to pull all relevant name-version fields from a - package and create a matching signoff.''' - return Signoff.objects.get_or_create( + package and get or create a matching signoff.''' + return self.get_or_create( pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo, revoked=None, user=user) @@ -196,9 +227,8 @@ def remove_inactive_maintainers(sender, instance, created, **kwargs): post_save.connect(remove_inactive_maintainers, sender=User, dispatch_uid="packages.models") -pre_save.connect(set_created_field, sender=PackageRelation, - dispatch_uid="packages.models") -pre_save.connect(set_created_field, sender=Signoff, - dispatch_uid="packages.models") +for sender in (PackageRelation, SignoffSpecification, Signoff): + pre_save.connect(set_created_field, sender=sender, + dispatch_uid="packages.models") # vim: set ts=4 sw=4 et: diff --git a/packages/urls.py b/packages/urls.py index 576e3279..4d391a3c 100644 --- a/packages/urls.py +++ b/packages/urls.py @@ -11,6 +11,7 @@ (r'^unflag/all/$', 'unflag_all'), (r'^signoff/$', 'signoff_package'), (r'^signoff/revoke/$', 'signoff_package', {'revoke': True}), + (r'^signoff/options/$', 'signoff_options'), (r'^download/$', 'download'), ) diff --git a/packages/views.py b/packages/views.py index e102760b..66bcd3fc 100644 --- a/packages/views.py +++ b/packages/views.py @@ -25,7 +25,7 @@ from main.models import Package, PackageFile, Arch, Repo from main.utils import make_choice from mirrors.models import MirrorUrl -from .models import PackageRelation, PackageGroup, Signoff +from .models import PackageRelation, PackageGroup, SignoffSpecification, Signoff from .utils import (get_group_info, get_differences_info, get_wrong_permissions, get_signoff_groups, approved_by_signoffs) @@ -417,6 +417,44 @@ def signoff_package(request, name, repo, arch, revoke=False): return redirect('package-signoffs') +class SignoffOptionsForm(forms.ModelForm): + class Meta: + model = SignoffSpecification + fields = ('required', 'enabled', 'known_bad', 'comments') + +@permission_required('main.change_package') +@never_cache +def signoff_options(request, name, repo, arch): + packages = get_list_or_404(Package, pkgbase=name, + arch__name=arch, repo__name__iexact=repo, repo__testing=True) + package = packages[0] + + # TODO ensure submitter is maintainer and/or packager + + try: + spec = SignoffSpecification.objects.get_from_package(package) + except SignoffSpecification.DoesNotExist: + # create a fake one, but don't save it just yet + spec = SignoffSpecification(pkgbase=package.pkgbase, + pkgver=package.pkgver, pkgrel=package.pkgrel, + epoch=package.epoch, arch=package.arch, repo=package.repo) + spec.user = request.user + + if request.POST: + form = SignoffOptionsForm(request.POST, instance=spec) + if form.is_valid(): + form.save() + return redirect('package-signoffs') + else: + form = SignoffOptionsForm(instance=spec) + + context = { + 'packages': packages, + 'package': package, + 'form': form, + } + return direct_to_template(request, 'packages/signoff_options.html', context) + def flaghelp(request): return direct_to_template(request, 'packages/flaghelp.html') diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index 87216193..0a630119 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -1,12 +1,23 @@ +{% spaceless %} +{% if group.signoffs %} <ul> {% for signoff in group.signoffs %} <li class="signed-username" title="Signed off by {{ signoff.user }}">{{ signoff.user }}{% if signoff.revoked %} (revoked){% endif %}</li> {% endfor %} </ul> +{% endif %} {% if group.user_signed_off %} -<div><a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/revoke/" +<div> + <a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/revoke/" title="Revoke signoff {{ group.pkgbase }} for {{ group.arch }}">Revoke Signoff</a></div> {% else %} -<div><a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/" +<div> + <a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/" title="Signoff {{ group.pkgbase }} for {{ group.arch }}">Signoff</a></div> {% endif %} +{% if group.packager == user %} +<div> + <a class="signoff-options" href="{{ group.package.get_absolute_url }}signoff/options/">Packager Options</a> +</div> +{% endif %} +{% endspaceless %} diff --git a/templates/packages/signoff_options.html b/templates/packages/signoff_options.html new file mode 100644 index 00000000..ee9b8b47 --- /dev/null +++ b/templates/packages/signoff_options.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %}Arch Linux - Package Signoff Options - {{ package.pkgbase }} {{ package.full_version }} ({{ package.arch.name }}){% endblock %} +{% block head %}<meta name="robots" content="noindex"/>{% endblock %} +{% block navbarclass %}anb-packages{% endblock %} + +{% block content %} +<div id="signoff-options" class="box"> + <h2>Package Signoff Options: {{ package.pkgbase }} {{ package.full_version }} ({{ package.arch.name }})</h2> + <form id="signoff-options-form" method="post">{% csrf_token %} + <fieldset> + {{ form.as_p }} + </fieldset> + <p><label></label> <input title="Set Signoff Options" type="submit" value="Set Signoff Options" /></p> + </form> + +</div> +{% endblock %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 0bdc6d46..9bc7fd74 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -50,8 +50,7 @@ <h3>Filter Displayed Signoffs</h3> <td>{{ group.packager|default:"Unknown" }}</td> <td>{{ group.packages|length }}</td> <td>{{ group.last_update|date }}</td> - <td class="signoff-{{ group.approved|yesno }}"> - {{ group.approved|yesno|capfirst }}</td> + <td class="signoff-{{ group.approved|yesno }}">{{ group.approved|yesno|capfirst }}</td> <td>{% include "packages/signoff_cell.html" %}</td> </tr> {% endfor %} -- cgit v1.2.3-54-g00ecf From 5f2c3bf98baabf919681525e600639643aa2c119 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 20:39:59 -0500 Subject: Signoffs changes and improvements * Better signoff report with more detail * Show signoff specification in signoffs view * Honor disabled/bad flags and display in approval column * Various other small bugfixes and tweaks Signed-off-by: Dan McGee <dan@archlinux.org> --- media/archweb.css | 8 +++++-- media/archweb.js | 30 ++++++++++++++++---------- packages/management/commands/signoff_report.py | 13 ++++++++++- packages/models.py | 28 +++++++++++++++++------- packages/utils.py | 16 ++++++++------ packages/views.py | 15 +++++++++---- templates/packages/signoff_cell.html | 2 ++ templates/packages/signoff_report.txt | 13 +++++++++++ templates/packages/signoffs.html | 19 ++++++++++++++-- 9 files changed, 109 insertions(+), 35 deletions(-) (limited to 'templates') diff --git a/media/archweb.css b/media/archweb.css index f817e18d..303173f2 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -914,8 +914,12 @@ ul.admin-actions { color: red; } -#dev-signoffs .signed-username { - color: #888; +#dev-signoffs .signoff-bad { + color: darkorange; +} + +#dev-signoffs .signoff-disabled { + color: gray; } /* iso testing feedback form */ diff --git a/media/archweb.js b/media/archweb.js index 43812b33..a9f4e0c9 100644 --- a/media/archweb.js +++ b/media/archweb.js @@ -215,28 +215,33 @@ function signoff_package() { $.getJSON(link.href, function(data) { link = $(link); var signoff = null; + var cell = link.closest('td'); if (data.created) { signoff = $('<li>').addClass('signed-username').text(data.user); - link.closest('td').children('ul').append(signoff); + var list = cell.children('ul'); + if (list.size() == 0) { + list = $('<ul>').prependTo(cell); + } + list.append(signoff); } else if(data.user) { signoff = link.closest('td').find('li').filter(function(index) { return $(this).text() == data.user; }); } - console.log(signoff, data.revoked, data.user); if (signoff && data.revoked) { signoff.text(signoff.text() + ' (revoked)'); } /* update the approved column to reflect reality */ - var approved; - if (data.approved) { - approved = link.closest('tr').children('.signoff-no'); - approved.text('Yes').addClass( - 'signoff-yes').removeClass('signoff-no'); + var approved = link.closest('tr').children('.approval'); + approved.attr('class', ''); + if (data.known_bad) { + approved.text('Bad').addClass('signoff-bad'); + } else if (!data.enabled) { + approved.text('Disabled').addClass('signoff-disabled'); + } else if (data.approved) { + approved.text('Yes').addClass('signoff-yes'); } else { - approved = link.closest('tr').children('.signoff-yes'); - approved.text('No').addClass( - 'signoff-no').removeClass('signoff-yes'); + approved.text('No').addClass('signoff-no'); } link.removeAttr('title'); /* Form our new link. The current will be something like @@ -245,6 +250,10 @@ function signoff_package() { if (data.revoked) { link.text('Signoff'); link.attr('href', base_href + '/signoff/'); + /* should we be hiding the link? */ + if (data.known_bad || !data.enabled) { + link.remove(); + } } else { link.text('Revoke Signoff'); link.attr('href', base_href + '/signoff/revoke/'); @@ -260,7 +269,6 @@ function filter_signoffs() { var all_rows = rows; $('#signoffs_filter .arch_filter').each(function() { if (!$(this).is(':checked')) { - console.log($(this).val()); rows = rows.not('.' + $(this).val()); } }); diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index 02f3d985..3431dada 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -56,6 +56,8 @@ def generate_report(email, repo_name): # Collect all existing signoffs for these packages signoff_groups = sorted(get_signoff_groups([repo]), key=attrgetter('target_repo', 'arch', 'pkgbase')) + disabled = [] + bad = [] complete = [] incomplete = [] new = [] @@ -68,10 +70,16 @@ def generate_report(email, repo_name): old_cutoff = now - timedelta(days=old_days) for group in signoff_groups: - if group.approved(): + spec = group.specification + if spec.known_bad: + bad.append(group) + elif not spec.enabled: + disabled.append(group) + elif group.approved(): complete.append(group) else: incomplete.append(group) + if group.package.last_update > new_cutoff: new.append(group) if group.package.last_update < old_cutoff: @@ -96,6 +104,9 @@ def generate_report(email, repo_name): c = Context({ 'repo': repo, 'signoffs_url': signoffs_url, + 'disabled': disabled, + 'bad': bad, + 'all': signoff_groups, 'incomplete': incomplete, 'complete': complete, 'new': new, diff --git a/packages/models.py b/packages/models.py index a2b53a06..b70c21bf 100644 --- a/packages/models.py +++ b/packages/models.py @@ -1,3 +1,5 @@ +from collections import namedtuple + from django.db import models from django.db.models.signals import pre_save, post_save from django.contrib.auth.models import User @@ -42,22 +44,26 @@ class Meta: class SignoffSpecificationManager(models.Manager): def get_from_package(self, pkg): '''Utility method to pull all relevant name-version fields from a - package and get a matching specification.''' + package and get a matching signoff specification.''' return self.get( pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo) - def get_or_create_from_package(self, pkg): - '''Utility method to pull all relevant name-version fields from a - package and get or create a matching specification.''' - return self.get_or_create( - pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, - epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo) + def get_or_default_from_package(self, pkg): + '''utility method to pull all relevant name-version fields from a + package and get a matching signoff specification, or return the default + base case.''' + try: + return self.get( + pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, + epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo) + except SignoffSpecification.DoesNotExist: + return DEFAULT_SIGNOFF_SPEC class SignoffSpecification(models.Model): ''' A specification for the signoff policy for this particular revision of a - pakcage. The default is requiring two signoffs for a given package. These + package. The default is requiring two signoffs for a given package. These are created only if necessary; e.g., if one wanted to override the required=2 attribute, otherwise a sane default object is used. ''' @@ -89,6 +95,12 @@ def __unicode__(self): return u'%s-%s' % (self.pkgbase, self.full_version) +# fake default signoff spec when we don't have a persisted one in the database +FakeSignoffSpecification = namedtuple('FakeSignoffSpecification', + ('required', 'enabled', 'known_bad', 'comments')) +DEFAULT_SIGNOFF_SPEC = FakeSignoffSpecification(2, True, False, u'') + + class SignoffManager(models.Manager): def get_from_package(self, pkg, user, revoked=False): '''Utility method to pull all relevant name-version fields from a diff --git a/packages/utils.py b/packages/utils.py index 42cfbe0f..60b95e21 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -5,7 +5,8 @@ from main.models import Package, Repo from main.utils import cache_function, groupby_preserve_order, PackageStandin -from .models import PackageGroup, PackageRelation, SignoffSpecification, Signoff +from .models import (PackageGroup, PackageRelation, + SignoffSpecification, Signoff, DEFAULT_SIGNOFF_SPEC) @cache_function(300) def get_group_info(include_arches=None): @@ -148,9 +149,7 @@ def get_wrong_permissions(): return relations -DEFAULT_SIGNOFF_SPEC = SignoffSpecification() - -def approved_by_signoffs(signoffs, spec=DEFAULT_SIGNOFF_SPEC): +def approved_by_signoffs(signoffs, spec): if signoffs: good_signoffs = sum(1 for s in signoffs if not s.revoked) return good_signoffs >= spec.required @@ -158,14 +157,13 @@ def approved_by_signoffs(signoffs, spec=DEFAULT_SIGNOFF_SPEC): class PackageSignoffGroup(object): '''Encompasses all packages in testing with the same pkgbase.''' - def __init__(self, packages, user=None): + def __init__(self, packages): if len(packages) == 0: raise Exception self.packages = packages - self.user = user + self.user = None self.target_repo = None self.signoffs = set() - self.specification = DEFAULT_SIGNOFF_SPEC first = packages[0] self.pkgbase = first.pkgbase @@ -175,6 +173,10 @@ def __init__(self, packages, user=None): self.last_update = first.last_update self.packager = first.packager + self.specification = \ + SignoffSpecification.objects.get_or_default_from_package(first) + self.default_spec = self.specification is DEFAULT_SIGNOFF_SPEC + version = first.full_version if all(version == pkg.full_version for pkg in packages): self.version = version diff --git a/packages/views.py b/packages/views.py index 66bcd3fc..307691e2 100644 --- a/packages/views.py +++ b/packages/views.py @@ -7,8 +7,9 @@ from django.core.mail import send_mail from django.core.serializers.json import DjangoJSONEncoder from django.db.models import Q -from django.http import HttpResponse, Http404 -from django.shortcuts import get_object_or_404, get_list_or_404, redirect +from django.http import HttpResponse, Http404, HttpResponseForbidden +from django.shortcuts import (get_object_or_404, get_list_or_404, + redirect, render) from django.template import loader, Context from django.utils import simplejson from django.views.decorators.cache import never_cache @@ -404,12 +405,16 @@ def signoff_package(request, name, repo, arch, revoke=False): package, request.user) all_signoffs = Signoff.objects.for_package(package) + spec = SignoffSpecification.objects.get_or_default_from_package(package) if request.is_ajax(): data = { 'created': created, 'revoked': bool(signoff.revoked), - 'approved': approved_by_signoffs(all_signoffs), + 'approved': approved_by_signoffs(all_signoffs, spec), + 'required': spec.required, + 'enabled': spec.enabled, + 'known_bad': spec.known_bad, 'user': str(request.user), } return HttpResponse(simplejson.dumps(data, ensure_ascii=False), @@ -429,7 +434,9 @@ def signoff_options(request, name, repo, arch): arch__name=arch, repo__name__iexact=repo, repo__testing=True) package = packages[0] - # TODO ensure submitter is maintainer and/or packager + if request.user != package.packager and \ + request.user not in package.maintainers: + return render(request, '403.html', status=403) try: spec = SignoffSpecification.objects.get_from_package(package) diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index 0a630119..6c705b4e 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -11,10 +11,12 @@ <a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/revoke/" title="Revoke signoff {{ group.pkgbase }} for {{ group.arch }}">Revoke Signoff</a></div> {% else %} +{% if not group.specification.known_bad and group.specification.enabled %} <div> <a class="signoff-link" href="{{ group.package.get_absolute_url }}signoff/" title="Signoff {{ group.pkgbase }} for {{ group.arch }}">Signoff</a></div> {% endif %} +{% endif %} {% if group.packager == user %} <div> <a class="signoff-options" href="{{ group.package.get_absolute_url }}signoff/options/">Packager Options</a> diff --git a/templates/packages/signoff_report.txt b/templates/packages/signoff_report.txt index 84e3fc6b..81020c8f 100644 --- a/templates/packages/signoff_report.txt +++ b/templates/packages/signoff_report.txt @@ -1,6 +1,19 @@ === {% autoescape off %}Signoff report for [{{ repo|lower }}] === {{ signoffs_url }} +There are currently: +* {{ new|length }} new package{{ new|length|pluralize }} in last {{ new_hours }} hours +* {{ bad|length }} known bad package{{ bad|length|pluralize }} +* {{ disabled|length }} package{{ disabled|length|pluralize }} not accepting signoffs +* {{ complete|length }} fully signed off package{{ complete|length|pluralize }} +* {{ incomplete|length }} package{{ incomplete|length|pluralize }} missing signoffs +* {{ old|length }} package{{ old|length|pluralize }} older than {{ old_days }} days + +(Note: the word 'package' as used here refers to packages as grouped by +pkgbase, architecture, and repository; e.g., one PKGBUILD produces one +package per architecture, even if it is a split package.) + + == New packages in [{{ repo|lower}}] in last {{ new_hours }} hours ({{ new|length }} total) == {% for group in new %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}){% endfor %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 9bc7fd74..d517e5e3 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -39,6 +39,7 @@ <h3>Filter Displayed Signoffs</h3> <th>Last Updated</th> <th>Approved</th> <th>Signoffs</th> + <th>Notes</th> </tr> </thead> <tbody id="tbody_signoffs"> @@ -50,8 +51,22 @@ <h3>Filter Displayed Signoffs</h3> <td>{{ group.packager|default:"Unknown" }}</td> <td>{{ group.packages|length }}</td> <td>{{ group.last_update|date }}</td> - <td class="signoff-{{ group.approved|yesno }}">{{ group.approved|yesno|capfirst }}</td> + {% if group.specification.known_bad %} + <td class="approval signoff-bad">Bad</td> + {% else %} + {% if not group.specification.enabled %} + <td class="approval signoff-disabled">Disabled</td> + {% else %} + <td class="approval signoff-{{ group.approved|yesno }}">{{ group.approved|yesno|capfirst }}</td> + {% endif %} + {% endif %} <td>{% include "packages/signoff_cell.html" %}</td> + <td class="wrap">{% if not group.default_spec %}{% with group.specification as spec %} + {% if spec.required != 2 %}Required signoffs: {{ spec.required }}<br/>{% endif %} + {% if not spec.enabled %}Signoffs are not currently enabled<br/>{% endif %} + {% if spec.known_bad %}Package is known to be bad<br/>{% endif %} + {{ spec.comments|default:""|linebreaks }} + {% endwith %}{% endif %}</td> </tr> {% endfor %} </tbody> @@ -64,7 +79,7 @@ <h3>Filter Displayed Signoffs</h3> $(document).ready(function() { $('a.signoff-link').click(signoff_package); $(".results").tablesorter({widgets: ['zebra'], sortList: [[0,0]], - headers: { 7: { sorter: false } } }); + headers: { 7: { sorter: false }, 8: {sorter: false } } }); $('#signoffs_filter input').change(filter_signoffs); $('#criteria_reset').click(filter_signoffs_reset); // fire function on page load to ensure the current form selections take effect -- cgit v1.2.3-54-g00ecf From 5e295a3dbb0b64f229e9419384721b154e013b9e Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 21:20:50 -0500 Subject: Allow signoff options to apply to all packages across architectures If you check the new box, you can set the options for both the i686 and the x86_64 packages at the same time. Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/views.py | 32 +++++++++++++++++++++++++++++++- templates/packages/signoff_cell.html | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/packages/views.py b/packages/views.py index 00dd7f7d..aa15d0cf 100644 --- a/packages/views.py +++ b/packages/views.py @@ -6,6 +6,7 @@ from django.conf import settings from django.core.mail import send_mail from django.core.serializers.json import DjangoJSONEncoder +from django.db import transaction from django.db.models import Q from django.http import HttpResponse, Http404, HttpResponseForbidden from django.shortcuts import (get_object_or_404, get_list_or_404, @@ -426,10 +427,36 @@ def signoff_package(request, name, repo, arch, revoke=False): return redirect('package-signoffs') class SignoffOptionsForm(forms.ModelForm): + apply_all = forms.BooleanField(required=False, + help_text="Apply these options to all architectures?") + class Meta: model = SignoffSpecification fields = ('required', 'enabled', 'known_bad', 'comments') +def _signoff_options_all(request, name, repo): + seen_ids = set() + with transaction.commit_on_success(): + # find or create a specification for all architectures, then + # graft the form data onto them + packages = Package.objects.filter(pkgbase=name, + repo__name__iexact=repo, repo__testing=True) + for package in packages: + try: + spec = SignoffSpecification.objects.get_from_package(package) + if spec.pk in seen_ids: + continue + except SignoffSpecification.DoesNotExist: + spec = SignoffSpecification(pkgbase=package.pkgbase, + pkgver=package.pkgver, pkgrel=package.pkgrel, + epoch=package.epoch, arch=package.arch, + repo=package.repo) + spec.user = request.user + form = SignoffOptionsForm(request.POST, instance=spec) + if form.is_valid(): + form.save() + seen_ids.add(form.instance.pk) + @permission_required('main.change_package') @never_cache def signoff_options(request, name, repo, arch): @@ -453,7 +480,10 @@ def signoff_options(request, name, repo, arch): if request.POST: form = SignoffOptionsForm(request.POST, instance=spec) if form.is_valid(): - form.save() + if form.cleaned_data['apply_all']: + _signoff_options_all(request, name, repo) + else: + form.save() return redirect('package-signoffs') else: form = SignoffOptionsForm(instance=spec) diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index 6c705b4e..4f9f726b 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -19,7 +19,7 @@ {% endif %} {% if group.packager == user %} <div> - <a class="signoff-options" href="{{ group.package.get_absolute_url }}signoff/options/">Packager Options</a> + <a class="signoff-options" href="{{ group.package.get_absolute_url }}signoff/options/">Signoff Options</a> </div> {% endif %} {% endspaceless %} -- cgit v1.2.3-54-g00ecf From 0aa42e2c01df2bf1c9e425994420f5ae10252597 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 3 Nov 2011 21:32:30 -0500 Subject: Allow signoff manipulation if you are a maintainer This is a more expensive and not-yet-optimized way of doing this, but we can fix that later as needed. Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/utils.py | 4 ++++ templates/packages/signoff_cell.html | 2 +- templates/todolists/view.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/packages/utils.py b/packages/utils.py index 60b95e21..1a2c0de0 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -2,6 +2,7 @@ from django.db import connection from django.db.models import Count, Max +from django.contrib.auth.models import User from main.models import Package, Repo from main.utils import cache_function, groupby_preserve_order, PackageStandin @@ -172,6 +173,9 @@ def __init__(self, packages): self.version = '' self.last_update = first.last_update self.packager = first.packager + self.maintainers = User.objects.filter( + package_relations__type=PackageRelation.MAINTAINER, + package_relations__pkgbase=self.pkgbase) self.specification = \ SignoffSpecification.objects.get_or_default_from_package(first) diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index 4f9f726b..0bf44ca2 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -17,7 +17,7 @@ title="Signoff {{ group.pkgbase }} for {{ group.arch }}">Signoff</a></div> {% endif %} {% endif %} -{% if group.packager == user %} +{% if user == group.packager or user in group.maintainers %} <div> <a class="signoff-options" href="{{ group.package.get_absolute_url }}signoff/options/">Signoff Options</a> </div> diff --git a/templates/todolists/view.html b/templates/todolists/view.html index 8f515c9b..c9ea919a 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -29,7 +29,7 @@ <h2>Todo List: {{ list.name }}</h2> <th>Name</th> <th>Arch</th> <th>Repo</th> - <th>Maintainer</th> + <th>Maintainers</th> <th>Status</th> </tr> </thead> -- cgit v1.2.3-54-g00ecf From 8ba68aed370c2369bebaaca4d4158b6c40223c0f Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Fri, 4 Nov 2011 10:59:45 -0500 Subject: Add filter by target repo on signoffs page And add a count of displayed rows below the filter options. Signed-off-by: Dan McGee <dan@archlinux.org> --- media/archweb.js | 7 ++++++- packages/views.py | 1 + templates/packages/signoffs.html | 12 +++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/media/archweb.js b/media/archweb.js index a9f4e0c9..2b8e5d6d 100644 --- a/media/archweb.js +++ b/media/archweb.js @@ -267,22 +267,27 @@ function filter_signoffs() { /* start with all rows, and then remove ones we shouldn't show */ var rows = $('#tbody_signoffs').children(); var all_rows = rows; - $('#signoffs_filter .arch_filter').each(function() { + /* apply arch and repo filters */ + $('#signoffs_filter .arch_filter').add( + '#signoffs_filter .repo_filter').each(function() { if (!$(this).is(':checked')) { rows = rows.not('.' + $(this).val()); } }); + /* and then the slightly more expensive pending check */ if ($('#id_pending').is(':checked')) { rows = rows.has('td.signoff-no'); } /* hide all rows, then show the set we care about */ all_rows.hide(); rows.show(); + $('#filter-count').text(rows.length); /* make sure we update the odd/even styling from sorting */ $('.results').trigger('applyWidgets'); } function filter_signoffs_reset() { $('#signoffs_filter .arch_filter').attr('checked', 'checked'); + $('#signoffs_filter .repo_filter').attr('checked', 'checked'); $('#id_pending').removeAttr('checked'); filter_signoffs(); } diff --git a/packages/views.py b/packages/views.py index aa15d0cf..3c0c2bee 100644 --- a/packages/views.py +++ b/packages/views.py @@ -381,6 +381,7 @@ def signoffs(request): context = { 'signoff_groups': signoff_groups, 'arches': Arch.objects.all(), + 'repo_names': sorted(set(g.target_repo for g in signoff_groups)), } return direct_to_template(request, 'packages/signoffs.html', context) diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index d517e5e3..f4511f75 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -9,7 +9,7 @@ <h2>Package Signoffs</h2> - <p>{{ signoff_groups|length }} signoff group{{ signoff_groups|pluralize }} found. + <p>{{ signoff_groups|length }} total signoff group{{ signoff_groups|pluralize }} found. A "signoff group" consists of packages grouped by pkgbase, architecture, and repository.</p> <div class="box filter-criteria"> @@ -21,9 +21,15 @@ <h3>Filter Displayed Signoffs</h3> <div><label for="id_arch_{{ arch.name }}" title="Architecture {{ arch.name }}">Arch {{ arch.name }}</label> <input type="checkbox" name="arch_{{ arch.name }}" id="id_arch_{{ arch.name }}" class="arch_filter" value="{{ arch.name }}" checked="checked"/></div> {% endfor %} + {% for repo_name in repo_names %} + <div><label for="id_repo_{{ repo_name|lower }}" title="Target Repository {{ repo_name }}">[{{ repo_name|lower }}]</label> + <input type="checkbox" name="repo_{{ repo_name|lower }}" id="id_repo_{{ repo_name|lower }}" class="repo_filter" value="{{ repo_name|lower }}" checked="checked"/></div> + {% endfor %} <div><label for="id_pending" title="Packages with not enough signoffs">Only Pending Approval</label> <input type="checkbox" name="pending" id="id_pending" value="pending"/></div> - <div ><label> </label><input title="Reset search criteria" type="button" id="criteria_reset" value="Reset"/></div> + <div><label> </label><input title="Reset search criteria" type="button" id="criteria_reset" value="Reset"/></div> + <div class="clear"></div> + <div id="filter-info"><span id="filter-count">{{ signoff_groups|length }}</span> signoff groups displayed.</div> </fieldset> </form> </div> @@ -44,7 +50,7 @@ <h3>Filter Displayed Signoffs</h3> </thead> <tbody id="tbody_signoffs"> {% for group in signoff_groups %} - <tr class="{% cycle 'odd' 'even' %} {{ group.arch.name }}"> + <tr class="{% cycle 'odd' 'even' %} {{ group.arch.name }} {{ group.target_repo|lower }}"> <td>{% pkg_details_link group.package %} {{ group.version }}</td> <td>{{ group.arch.name }}</td> <td>{{ group.target_repo }}</td> -- cgit v1.2.3-54-g00ecf From e565fde00f56c7a01ff55a204a0a56d3ce4bf8b4 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Fri, 4 Nov 2011 11:31:35 -0500 Subject: Signoff email: prune empty content Don't send the email at all if there are no packages even in the repository, and don't print empty sections. Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/management/commands/signoff_report.py | 4 ++++ templates/packages/signoff_report.txt | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index 3431dada..3357bc1e 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -69,6 +69,10 @@ def generate_report(email, repo_name): new_cutoff = now - timedelta(hours=new_hours) old_cutoff = now - timedelta(days=old_days) + if len(signoff_groups) == 0: + # no need to send an email at all + return + for group in signoff_groups: spec = group.specification if spec.known_bad: diff --git a/templates/packages/signoff_report.txt b/templates/packages/signoff_report.txt index 81020c8f..046c2f1e 100644 --- a/templates/packages/signoff_report.txt +++ b/templates/packages/signoff_report.txt @@ -14,27 +14,28 @@ pkgbase, architecture, and repository; e.g., one PKGBUILD produces one package per architecture, even if it is a split package.) -== New packages in [{{ repo|lower}}] in last {{ new_hours }} hours ({{ new|length }} total) == +{% if new %}== New packages in [{{ repo|lower}}] in last {{ new_hours }} hours ({{ new|length }} total) == {% for group in new %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}){% endfor %} -{% regroup incomplete by target_repo as by_repo %}{% for target_repo in by_repo %} +{% endif %}{% regroup incomplete by target_repo as by_repo %}{% for target_repo in by_repo %} == Incomplete signoffs for [{{ target_repo.grouper|lower }}] ({{ target_repo.list|length }} total) == {% for group in target_repo.list %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}) {{ group.completed }}/{{ group.required }} signoffs{% endfor %} {% endfor %} -== Completed signoffs ({{ complete|length }} total) == +{% if complete %}== Completed signoffs ({{ complete|length }} total) == {% for group in complete %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}){% endfor %} -== All packages in [{{ repo|lower }}] for more than {{ old_days }} days ({{ old|length }} total) == +{% endif %}{% if old %}== All packages in [{{ repo|lower }}] for more than {{ old_days }} days ({{ old|length }} total) == {% for group in old %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}), since {{ group.last_update|date }}{% endfor %} -{% endautoescape %} -== Top five in signoffs in last {{ new_hours }} hours == + +{% endif %}== Top five in signoffs in last {{ new_hours }} hours == {% for leader in leaders %} {{ forloop.counter }}. {{ leader.user }} - {{ leader.count }} signoffs{% endfor %} +{% endautoescape %} -- cgit v1.2.3-54-g00ecf From e15654fd7cbd5bf5e9a5c7d59b6b2a50999ee467 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Fri, 4 Nov 2011 11:56:38 -0500 Subject: Fix misnamed JS function call Signed-off-by: Dan McGee <dan@archlinux.org> --- templates/packages/differences.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/packages/differences.html b/templates/packages/differences.html index 0400ea37..6c06ae25 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -65,7 +65,7 @@ <h3>Filter Differences View</h3> $('.results').tablesorter({widgets: ['zebra'], sortList: [[1,0], [0,0]]}); $('#diff_filter select').change(filter_packages); $('#diff_filter input').change(filter_packages); - $('#criteria_reset').click(filter_differences_reset); + $('#criteria_reset').click(filter_packages_reset); // fire function on page load to ensure the current form selections take effect filter_packages(); }); -- cgit v1.2.3-54-g00ecf From 21d5f818a60ab2626f941f8ff53e263e802494d5 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Fri, 11 Nov 2011 10:42:51 -0600 Subject: Touch up signoff page styles Signed-off-by: Dan McGee <dan@archlinux.org> --- media/archweb.css | 10 +++++----- templates/packages/signoff_cell.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/media/archweb.css b/media/archweb.css index 303173f2..c5477422 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -899,26 +899,26 @@ ul.admin-actions { background: #ffd; } -#dev-signoffs ul { +ul.signoff-list { list-style: none; margin: 0; padding: 0; } -#dev-signoffs .signoff-yes { +.signoff-yes { color: green; font-weight: bold; } -#dev-signoffs .signoff-no { +.signoff-no { color: red; } -#dev-signoffs .signoff-bad { +.signoff-bad { color: darkorange; } -#dev-signoffs .signoff-disabled { +.signoff-disabled { color: gray; } diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index 0bf44ca2..01a5d58d 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -1,6 +1,6 @@ {% spaceless %} {% if group.signoffs %} -<ul> +<ul class="signoff-list"> {% for signoff in group.signoffs %} <li class="signed-username" title="Signed off by {{ signoff.user }}">{{ signoff.user }}{% if signoff.revoked %} (revoked){% endif %}</li> {% endfor %} -- cgit v1.2.3-54-g00ecf From 022692b3f33de8c45741d3cb27fa95f9f6facdea Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Fri, 11 Nov 2011 10:43:18 -0600 Subject: Show relevant signoffs on dashboard Signed-off-by: Dan McGee <dan@archlinux.org> --- devel/views.py | 5 +++++ packages/utils.py | 7 ++++++- templates/devel/index.html | 50 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 59 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/devel/views.py b/devel/views.py index 694ed6dc..0002df04 100644 --- a/devel/views.py +++ b/devel/views.py @@ -18,6 +18,7 @@ from main.models import Arch, Repo from main.models import UserProfile from packages.models import PackageRelation +from packages.utils import get_signoff_groups from todolists.utils import get_annotated_todolists from .utils import get_annotated_maintainers @@ -48,6 +49,9 @@ def index(request): todolists = get_annotated_todolists() todolists = [todolist for todolist in todolists if todolist.incomplete_count > 0] + signoffs = sorted(get_signoff_groups(user=request.user), + key=operator.attrgetter('pkgbase')) + maintainers = get_annotated_maintainers() maintained = PackageRelation.objects.filter( @@ -70,6 +74,7 @@ def index(request): 'orphan': orphan, 'flagged' : flagged, 'todopkgs' : todopkgs, + 'signoffs': signoffs } return direct_to_template(request, 'devel/index.html', page_dict) diff --git a/packages/utils.py b/packages/utils.py index b21ac557..0df0e382 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -330,7 +330,7 @@ def get_target_repo_map(repos): cursor.execute(sql, params) return dict(cursor.fetchall()) -def get_signoff_groups(repos=None): +def get_signoff_groups(repos=None, user=None): if repos is None: repos = Repo.objects.filter(testing=True) repo_ids = [r.pk for r in repos] @@ -340,6 +340,11 @@ def get_signoff_groups(repos=None): packages = test_pkgs.order_by('pkgname') packages = attach_maintainers(packages) + # Filter by user if asked to do so + if user is not None: + packages = [p for p in packages if user == p.packager + or user in p.maintainers] + # Collect all pkgbase values in testing repos pkgtorepo = get_target_repo_map(repos) diff --git a/templates/devel/index.html b/templates/devel/index.html index d3f7ec3b..06cf10ab 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -15,8 +15,8 @@ <h3>My Flagged Packages</h3> <thead> <tr> <th>Name</th> - <th>Repo</th> <th>Version</th> + <th>Repo</th> <th>Arch</th> <th>Flagged</th> <th>Last Updated</th> @@ -26,8 +26,8 @@ <h3>My Flagged Packages</h3> {% for pkg in flagged %} <tr class="{% cycle 'odd' 'even' %}"> <td>{% pkg_details_link pkg %}</td> - <td>{{ pkg.repo.name }}</td> <td>{{ pkg.full_version }}</td> + <td>{{ pkg.repo.name }}</td> <td>{{ pkg.arch.name }}</td> <td>{{ pkg.flag_date|date }}</td> <td>{{ pkg.last_update|date }}</td> @@ -96,6 +96,47 @@ <h3>Package Todo Lists</h3> </tbody> </table> + <h3>Signoff Status</h3> + + <table id="dash-signoffs" class="results"> + <thead> + <tr> + <th>Name</th> + <th>Version</th> + <th>Arch</th> + <th>Target Repo</th> + <th>Last Updated</th> + <th>Approved</th> + <th>Signoffs</th> + </tr> + </thead> + <tbody> + {% for group in signoffs %} + <tr class="{% cycle 'odd' 'even' %}"> + <td>{% pkg_details_link group.package %}</td> + <td>{{ group.version }}</td> + <td>{{ group.arch.name }}</td> + <td>{{ group.target_repo }}</td> + <td>{{ group.last_update|date }}</td> + {% if group.specification.known_bad %} + <td class="approval signoff-bad">Bad</td> + {% else %} + {% if not group.specification.enabled %} + <td class="approval signoff-disabled">Disabled</td> + {% else %} + <td class="approval signoff-{{ group.approved|yesno }}">{{ group.approved|yesno|capfirst }}</td> + {% endif %} + {% endif %} + <td><ul class="signoff-list"> + {% for signoff in group.signoffs %} + <li class="signed-username" title="Signed off by {{ signoff.user }}">{{ signoff.user }}{% if signoff.revoked %} (revoked){% endif %}</li> + {% endfor %} + </ul></td> + </tr> + {% endfor %} + </tbody> + </table> + <h3>Developer Reports</h3> <ul> <li><a href="reports/big/">Big</a>: @@ -255,6 +296,11 @@ <h2>Stats by Developer</h2> {widgets: ['zebra'], sortList: [[0,0], [1,0]]}); $("#dash-todo:not(:has(tbody tr.empty))").tablesorter( {widgets: ['zebra'], sortList: [[1,1]]}); + $("#dash-signoffs:not(:has(tbody tr.empty))").tablesorter({ + widgets: ['zebra'], + sortList: [[0,0]], + headers: { 6: {sorter: false } } + }); $(".dash-stats").tablesorter({ widgets: ['zebra'], sortList: [[0,0]], -- cgit v1.2.3-54-g00ecf From 12408702eaf89ea338670ba808da9ef49e35c562 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Mon, 14 Nov 2011 12:19:17 -0600 Subject: Allow population of signoff specs with SVN commit messages This pulls them from the latest SVN commit on trunk. We don't have a failproof method of getting the exact right commit, but this should be close if it is run on a regular basis via cron (aka hourly). Note that running locally, I needed the development version of South to get the migration included here to apply because of information_schema changes in the current version of MySQL. Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/management/commands/populate_signoffs.py | 89 +++++++++++ packages/management/commands/signoff_report.py | 2 +- ...11_auto__chg_field_signoffspecification_user.py | 165 +++++++++++++++++++++ packages/models.py | 2 +- packages/views/signoff.py | 5 + settings.py | 4 + templates/packages/signoffs.html | 2 +- 7 files changed, 266 insertions(+), 3 deletions(-) create mode 100644 packages/management/commands/populate_signoffs.py create mode 100644 packages/migrations/0011_auto__chg_field_signoffspecification_user.py (limited to 'templates') diff --git a/packages/management/commands/populate_signoffs.py b/packages/management/commands/populate_signoffs.py new file mode 100644 index 00000000..5b5acbaf --- /dev/null +++ b/packages/management/commands/populate_signoffs.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +""" +populate_signoffs command + +Pull the latest commit message from SVN for a given package that is +signoff-eligible and does not have an existing comment attached. + +Usage: ./manage.py populate_signoffs +""" + +from datetime import datetime +import logging +import subprocess +import sys +from xml.etree.ElementTree import XML + +from django.conf import settings +from django.contrib.auth.models import User +from django.core.management.base import NoArgsCommand + +from ...models import SignoffSpecification +from ...utils import get_signoff_groups + +logging.basicConfig( + level=logging.INFO, + format='%(asctime)s -> %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S', + stream=sys.stderr) +logger = logging.getLogger() + +class Command(NoArgsCommand): + help = "Pull the latest commit message from SVN for a given package that is signoff-eligible and does not have an existing comment attached" + + def handle_noargs(self, **options): + v = int(options.get('verbosity', None)) + if v == 0: + logger.level = logging.ERROR + elif v == 1: + logger.level = logging.INFO + elif v == 2: + logger.level = logging.DEBUG + + return add_signoff_comments() + +def svn_log(pkgbase, repo): + path = '%s%s/%s/trunk/' % (settings.SVN_BASE_URL, repo.svn_root, pkgbase) + cmd = ['svn', 'log', '--limit=1', '--xml', path] + log_data = subprocess.check_output(cmd) + # the XML format is very very simple, especially with only one revision + xml = XML(log_data) + revision = int(xml.find('logentry').get('revision')) + date = datetime.strptime(xml.findtext('logentry/date'), + '%Y-%m-%dT%H:%M:%S.%fZ') + return { + 'revision': revision, + 'date': date, + 'author': xml.findtext('logentry/author'), + 'message': xml.findtext('logentry/msg'), + } + +def create_specification(package, log): + trimmed_message = log['message'].strip() + spec = SignoffSpecification(pkgbase=package.pkgbase, + pkgver=package.pkgver, pkgrel=package.pkgrel, + epoch=package.epoch, arch=package.arch, repo=package.repo, + comments=trimmed_message) + try: + spec.user = User.objects.get(username=log['author']) + except User.DoesNotExist: + pass + + return spec + +def add_signoff_comments(): + logger.info("getting all signoff groups") + groups = get_signoff_groups() + logger.info("%d signoff groups found", len(groups)) + + for group in groups: + if not group.default_spec: + continue + + logger.debug("getting SVN log for %s (%s)", group.pkgbase, group.repo) + log = svn_log(group.pkgbase, group.repo) + logger.info("creating spec with SVN message for %s", group.pkgbase) + spec = create_specification(group.packages[0], log) + spec.save() + +# vim: set ts=4 sw=4 et: diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index 3357bc1e..3b67f518 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -22,7 +22,7 @@ from operator import attrgetter import sys -from main.models import Package, Repo +from main.models import Repo from packages.models import Signoff from packages.utils import get_signoff_groups diff --git a/packages/migrations/0011_auto__chg_field_signoffspecification_user.py b/packages/migrations/0011_auto__chg_field_signoffspecification_user.py new file mode 100644 index 00000000..f6e3cdd9 --- /dev/null +++ b/packages/migrations/0011_auto__chg_field_signoffspecification_user.py @@ -0,0 +1,165 @@ +# encoding: utf-8 +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + db.alter_column('packages_signoffspecification', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) + + def backwards(self, orm): + db.alter_column('packages_signoffspecification', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['auth.User'])) + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'main.arch': { + 'Meta': {'ordering': "['name']", 'object_name': 'Arch', 'db_table': "'arches'"}, + 'agnostic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) + }, + 'main.package': { + 'Meta': {'ordering': "('pkgname',)", 'object_name': 'Package', 'db_table': "'packages'"}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Arch']"}), + 'build_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'compressed_size': ('main.models.PositiveBigIntegerField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'files_last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'flag_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'installed_size': ('main.models.PositiveBigIntegerField', [], {}), + 'last_update': ('django.db.models.fields.DateTimeField', [], {}), + 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), + 'packager_str': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pgp_signature': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgdesc': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), + 'pkgname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Repo']"}), + 'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) + }, + 'main.repo': { + 'Meta': {'ordering': "['name']", 'object_name': 'Repo', 'db_table': "'repos'"}, + 'bugs_category': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'bugs_project': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'staging': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'svn_root': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + }, + 'packages.conflict': { + 'Meta': {'ordering': "['name']", 'object_name': 'Conflict'}, + 'comparison': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'conflicts'", 'to': "orm['main.Package']"}), + 'version': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}) + }, + 'packages.license': { + 'Meta': {'ordering': "['name']", 'object_name': 'License'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'licenses'", 'to': "orm['main.Package']"}) + }, + 'packages.packagegroup': { + 'Meta': {'object_name': 'PackageGroup'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'groups'", 'to': "orm['main.Package']"}) + }, + 'packages.packagerelation': { + 'Meta': {'unique_together': "(('pkgbase', 'user', 'type'),)", 'object_name': 'PackageRelation'}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'type': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_relations'", 'to': "orm['auth.User']"}) + }, + 'packages.provision': { + 'Meta': {'ordering': "['name']", 'object_name': 'Provision'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'provides'", 'to': "orm['main.Package']"}), + 'version': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}) + }, + 'packages.replacement': { + 'Meta': {'ordering': "['name']", 'object_name': 'Replacement'}, + 'comparison': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'replaces'", 'to': "orm['main.Package']"}), + 'version': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}) + }, + 'packages.signoff': { + 'Meta': {'object_name': 'Signoff'}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Arch']"}), + 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Repo']"}), + 'revoked': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_signoffs'", 'to': "orm['auth.User']"}) + }, + 'packages.signoffspecification': { + 'Meta': {'object_name': 'SignoffSpecification'}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Arch']"}), + 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'known_bad': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Repo']"}), + 'required': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) + } + } + + complete_apps = ['packages'] diff --git a/packages/models.py b/packages/models.py index b70c21bf..0d02ab31 100644 --- a/packages/models.py +++ b/packages/models.py @@ -73,7 +73,7 @@ class SignoffSpecification(models.Model): epoch = models.PositiveIntegerField(default=0) arch = models.ForeignKey('main.Arch') repo = models.ForeignKey('main.Repo') - user = models.ForeignKey(User) + user = models.ForeignKey(User, null=True) created = models.DateTimeField(editable=False) required = models.PositiveIntegerField(default=2, help_text="How many signoffs are required for this package?") diff --git a/packages/views/signoff.py b/packages/views/signoff.py index 26b6e710..e57b4d9a 100644 --- a/packages/views/signoff.py +++ b/packages/views/signoff.py @@ -98,7 +98,10 @@ def _signoff_options_all(request, name, repo): pkgver=package.pkgver, pkgrel=package.pkgrel, epoch=package.epoch, arch=package.arch, repo=package.repo) + + if spec.user is None: spec.user = request.user + form = SignoffOptionsForm(request.POST, instance=spec) if form.is_valid(): form.save() @@ -122,6 +125,8 @@ def signoff_options(request, name, repo, arch): spec = SignoffSpecification(pkgbase=package.pkgbase, pkgver=package.pkgver, pkgrel=package.pkgrel, epoch=package.epoch, arch=package.arch, repo=package.repo) + + if spec.user is None: spec.user = request.user if request.POST: diff --git a/settings.py b/settings.py index 51f9fcf6..80e024af 100644 --- a/settings.py +++ b/settings.py @@ -134,4 +134,8 @@ # URL to fetch a current list of available ISOs ISO_LIST_URL = 'http://releng.archlinux.org/isos/' +# URL for SVN access for fetching commit messages (note absence of packages or +# community bit on the end, repo.svn_root is appended) +SVN_BASE_URL = 'svn+ssh://svn.archlinux.org/srv/svn-' + # vim: set ts=4 sw=4 et: diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index f4511f75..bd84289c 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -71,7 +71,7 @@ <h3>Filter Displayed Signoffs</h3> {% if spec.required != 2 %}Required signoffs: {{ spec.required }}<br/>{% endif %} {% if not spec.enabled %}Signoffs are not currently enabled<br/>{% endif %} {% if spec.known_bad %}Package is known to be bad<br/>{% endif %} - {{ spec.comments|default:""|linebreaks }} + {{ spec.comments|default:""|linebreaksbr }} {% endwith %}{% endif %}</td> </tr> {% endfor %} -- cgit v1.2.3-54-g00ecf From 5b63c29fe1c37ce9d946adedeaf13f5ad94d144a Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Tue, 15 Nov 2011 14:03:36 -0600 Subject: Show full names on developer user list pages The old display format doesn't really make sense. Also fix the invalid HTML generated by the PGP tag link- we need to escape using & inside the generated URLs. Signed-off-by: Dan McGee <dan@archlinux.org> --- main/templatetags/pgp.py | 2 +- media/archweb.css | 4 ++++ templates/public/developer_list.html | 2 +- templates/public/userlist.html | 2 -- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index f875c11e..67f5e08d 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -21,7 +21,7 @@ def pgp_key_link(key_id): pgp_server = getattr(settings, 'PGP_SERVER', None) if not pgp_server: return format_key(key_id) - url = 'http://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ + url = 'http://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ (pgp_server, key_id) values = (url, format_key(key_id), key_id[-8:]) return '<a href="%s" title="PGP key search for %s">0x%s</a>' % values diff --git a/media/archweb.css b/media/archweb.css index c5477422..f4bb92fa 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -802,6 +802,10 @@ div#arch-bio-toc { text-align: center; } + div#arch-bio-toc a { + white-space: nowrap; + } + table.arch-bio-entry td.pic { vertical-align: top; padding-right: 15px; diff --git a/templates/public/developer_list.html b/templates/public/developer_list.html index 2abbbfe4..0ac444e5 100644 --- a/templates/public/developer_list.html +++ b/templates/public/developer_list.html @@ -4,7 +4,7 @@ <p> {% for dev in dev_list %} <a href="#{{ dev.username }}" title="Jump to profile for {{ dev.get_full_name }}"> - {{ dev.first_name }}{{ dev.last_name.0|capfirst}}</a>    + {{ dev.first_name }} {{ dev.last_name }}</a>    {% endfor %} </p> </div> diff --git a/templates/public/userlist.html b/templates/public/userlist.html index c51215c3..0077f611 100644 --- a/templates/public/userlist.html +++ b/templates/public/userlist.html @@ -6,7 +6,6 @@ {% block content %} {% cache 600 dev-tu-profiles user_type %} <div id="dev-tu-profiles" class="box"> - <h2>Arch Linux {{user_type}}</h2> <p>{{description}}</p> @@ -14,7 +13,6 @@ <h2>Arch Linux {{user_type}}</h2> {% with users as dev_list %} {% include 'public/developer_list.html' %} {% endwith %} - </div> {% endcache %} {% endblock %} -- cgit v1.2.3-54-g00ecf From 64f5799ef7fb76ed0e8759359b4ee8127e8903f5 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Tue, 15 Nov 2011 15:15:08 -0600 Subject: Fix up empty table display on dev dashboard Fix the colspan for the existing tables, and add a notice for the new signoffs table which did not have one. Thanks-to: Andrea Scarpino <andrea@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org> --- templates/devel/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/devel/index.html b/templates/devel/index.html index 06cf10ab..0f0ded38 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -33,7 +33,7 @@ <h3>My Flagged Packages</h3> <td>{{ pkg.last_update|date }}</td> </tr> {% empty %} - <tr class="empty"><td colspan="4"><em>No flagged packages to display</em></td></tr> + <tr class="empty"><td colspan="6"><em>No flagged packages to display</em></td></tr> {% endfor %} </tbody> </table> @@ -91,7 +91,7 @@ <h3>Package Todo Lists</h3> <td>{{ todo.incomplete_count }}</td> </tr> {% empty %} - <tr class="empty"><td colspan="3"><em>No package todo lists to display</em></td></tr> + <tr class="empty"><td colspan="6"><em>No package todo lists to display</em></td></tr> {% endfor %} </tbody> </table> @@ -133,6 +133,8 @@ <h3>Signoff Status</h3> {% endfor %} </ul></td> </tr> + {% empty %} + <tr class="empty"><td colspan="7"><em>No packages you maintain or have packaged need signoffs</em></td></tr> {% endfor %} </tbody> </table> -- cgit v1.2.3-54-g00ecf From f43a33ed8696d7bcb987d4878c6411c5d16846d6 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Thu, 17 Nov 2011 13:32:42 -0600 Subject: Display package URLs unquoted if possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example: kbd-ru-keymaps. Before: http://wiki.archlinux.org/index.php/%D0%98%D0%BD%D1%82%D0%B5%D1%80%D0%BD%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F After: http://wiki.archlinux.org/index.php/Интернационализация Signed-off-by: Dan McGee <dan@archlinux.org> --- packages/templatetags/package_extras.py | 13 ++++++++++++- templates/packages/details.html | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 01bf7510..67c7fbbc 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -1,4 +1,4 @@ -from urllib import urlencode, quote as urlquote +from urllib import urlencode, quote as urlquote, unquote try: from urlparse import parse_qs except ImportError: @@ -13,6 +13,17 @@ def link_encode(url, query, doseq=False): data = urlencode(query, doseq).replace('&', '&') return "%s?%s" % (url, data) +@register.filter +def url_unquote(original_url): + try: + url = original_url + if isinstance(url, unicode): + url = url.encode('ascii') + url = unquote(url).decode('utf-8') + return url + except UnicodeError: + return original_url + class BuildQueryStringNode(template.Node): def __init__(self, sortfield): self.sortfield = sortfield diff --git a/templates/packages/details.html b/templates/packages/details.html index 2998592f..a9908012 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -108,7 +108,7 @@ <h4>Versions Elsewhere</h4> </tr><tr> <th>Upstream URL:</th> <td>{% if pkg.url %}<a href="{{ pkg.url }}" - title="Visit the website for {{ pkg.pkgname }}">{{ pkg.url }}</a>{% endif %}</td> + title="Visit the website for {{ pkg.pkgname }}">{{ pkg.url|url_unquote }}</a>{% endif %}</td> </tr><tr> <th>License(s):</th> <td>{{ pkg.licenses.all|join:", " }}</td> -- cgit v1.2.3-54-g00ecf From 85657db05d7f65604340699cfcb9967c9e81a0ef Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Mon, 21 Nov 2011 10:08:23 -0600 Subject: Better support for non-latin full names Add a 'latin_name' field to the user profile so we can better support those developers with names in non-Latin scripts, and yet still show a Latin name as necessary on the developer profile page. This field only shows up if populated. Also, use consistent sorting everywhere- rather than using username, always use first_name and last_name fields. Signed-off-by: Dan McGee <dan@archlinux.org> --- devel/views.py | 2 +- .../0057_auto__add_field_userprofile_latin_name.py | 153 +++++++++++++++++++++ main/models.py | 2 + packages/views/search.py | 3 +- public/views.py | 6 +- templates/devel/clock.html | 2 +- templates/public/developer_list.html | 2 +- 7 files changed, 164 insertions(+), 6 deletions(-) create mode 100644 main/migrations/0057_auto__add_field_userprofile_latin_name.py (limited to 'templates') diff --git a/devel/views.py b/devel/views.py index 0002df04..08b19cd7 100644 --- a/devel/views.py +++ b/devel/views.py @@ -83,7 +83,7 @@ def index(request): @never_cache def clock(request): devs = User.objects.filter(is_active=True).order_by( - 'username').select_related('userprofile') + 'first_name', 'last_name').select_related('userprofile') now = datetime.now() utc_now = datetime.utcnow().replace(tzinfo=pytz.utc) diff --git a/main/migrations/0057_auto__add_field_userprofile_latin_name.py b/main/migrations/0057_auto__add_field_userprofile_latin_name.py new file mode 100644 index 00000000..ffde1885 --- /dev/null +++ b/main/migrations/0057_auto__add_field_userprofile_latin_name.py @@ -0,0 +1,153 @@ +# encoding: utf-8 +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + db.add_column('user_profiles', 'latin_name', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + def backwards(self, orm): + db.delete_column('user_profiles', 'latin_name') + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'main.arch': { + 'Meta': {'ordering': "['name']", 'object_name': 'Arch', 'db_table': "'arches'"}, + 'agnostic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) + }, + 'main.donor': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Donor', 'db_table': "'donors'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) + }, + 'main.package': { + 'Meta': {'ordering': "('pkgname',)", 'unique_together': "(('pkgname', 'repo', 'arch'),)", 'object_name': 'Package', 'db_table': "'packages'"}, + 'arch': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Arch']"}), + 'build_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'compressed_size': ('main.models.PositiveBigIntegerField', [], {}), + 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'files_last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'flag_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'installed_size': ('main.models.PositiveBigIntegerField', [], {}), + 'last_update': ('django.db.models.fields.DateTimeField', [], {}), + 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), + 'packager_str': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pgp_signature': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'pkgdesc': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'pkgname': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'repo': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Repo']"}), + 'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) + }, + 'main.packagedepend': { + 'Meta': {'object_name': 'PackageDepend', 'db_table': "'package_depends'"}, + 'depname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'depvcmp': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'optional': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Package']"}) + }, + 'main.packagefile': { + 'Meta': {'object_name': 'PackageFile', 'db_table': "'package_files'"}, + 'directory': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_directory': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Package']"}) + }, + 'main.repo': { + 'Meta': {'ordering': "['name']", 'object_name': 'Repo', 'db_table': "'repos'"}, + 'bugs_category': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'bugs_project': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'staging': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'svn_root': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + }, + 'main.todolist': { + 'Meta': {'object_name': 'Todolist', 'db_table': "'todolists'"}, + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + 'main.todolistpkg': { + 'Meta': {'unique_together': "(('list', 'pkg'),)", 'object_name': 'TodolistPkg', 'db_table': "'todolist_pkgs'"}, + 'complete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'list': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Todolist']"}), + 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Package']"}) + }, + 'main.userprofile': { + 'Meta': {'object_name': 'UserProfile', 'db_table': "'user_profiles'"}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '50'}), + 'allowed_repos': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['main.Repo']", 'symmetrical': 'False', 'blank': 'True'}), + 'favorite_distros': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'interests': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'languages': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'latin_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'notify': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'other_contact': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'pgp_key': ('main.models.PGPKeyField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'picture': ('django.db.models.fields.files.FileField', [], {'default': "'devs/silhouette.png'", 'max_length': '100'}), + 'public_email': ('django.db.models.fields.CharField', [], {'max_length': '50'}), + 'roles': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'time_zone': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '100'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'userprofile'", 'unique': 'True', 'to': "orm['auth.User']"}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'yob': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['main'] diff --git a/main/models.py b/main/models.py index b37468f9..d7780b91 100644 --- a/main/models.py +++ b/main/models.py @@ -77,6 +77,8 @@ class UserProfile(models.Model): help_text="Ideally 125px by 125px") user = models.OneToOneField(User, related_name='userprofile') allowed_repos = models.ManyToManyField('Repo', blank=True) + latin_name = models.CharField(max_length=255, null=True, blank=True, + help_text="Latin-form name; used only for non-Latin full names") class Meta: db_table = 'user_profiles' diff --git a/packages/views/search.py b/packages/views/search.py index 57481614..65fcddb3 100644 --- a/packages/views/search.py +++ b/packages/views/search.py @@ -60,7 +60,8 @@ def __init__(self, *args, **kwargs): self.fields['arch'].choices = make_choice( [arch.name for arch in Arch.objects.all()]) self.fields['q'].widget.attrs.update({"size": "30"}) - maints = User.objects.filter(is_active=True).order_by('username') + maints = User.objects.filter(is_active=True).order_by( + 'first_name', 'last_name') self.fields['maintainer'].choices = \ [('', 'All'), ('orphan', 'Orphan')] + \ [(m.username, m.get_full_name()) for m in maints] diff --git a/public/views.py b/public/views.py index 14dd6353..c28fd303 100644 --- a/public/views.py +++ b/public/views.py @@ -34,13 +34,15 @@ def index(request): } def userlist(request, user_type='devs'): - users = User.objects.order_by('username').select_related('userprofile') + users = User.objects.order_by( + 'first_name', 'last_name').select_related('userprofile') if user_type == 'devs': users = users.filter(is_active=True, groups__name="Developers") elif user_type == 'tus': users = users.filter(is_active=True, groups__name="Trusted Users") elif user_type == 'fellows': - users = users.filter(is_active=False, groups__name__in=["Developers", "Trusted Users"]) + users = users.filter(is_active=False, + groups__name__in=["Developers", "Trusted Users"]) else: raise Http404 diff --git a/templates/devel/clock.html b/templates/devel/clock.html index 0f0e20c5..d2eb0a8d 100644 --- a/templates/devel/clock.html +++ b/templates/devel/clock.html @@ -45,7 +45,7 @@ <h2>Developer World Clocks</h2> <script type="text/javascript"> $(document).ready(function() { $("#clocks-table:has(tbody tr)").tablesorter( - {widgets: ['zebra'], sortList: [[1,0]]}); + {widgets: ['zebra'], sortList: [[0,0]]}); }); </script> {% endblock %} diff --git a/templates/public/developer_list.html b/templates/public/developer_list.html index 0ac444e5..5aa4c6b2 100644 --- a/templates/public/developer_list.html +++ b/templates/public/developer_list.html @@ -21,7 +21,7 @@ <table class="bio bio-{{ dev.username }}" cellspacing="0"> <tr> <th>Name:</th> - <td>{{ dev.get_full_name }}</td> + <td>{{ dev.get_full_name }}{% if prof.latin_name %} ({{ prof.latin_name}}){% endif %}</td> </tr><tr> <th>Alias:</th> <td>{{ prof.alias }}</td> -- cgit v1.2.3-54-g00ecf From 0be32f0a388267e54d9ab88e64391f355dafdfb5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker <LukeShu@sbcglobal.net> Date: Sat, 26 Nov 2011 13:25:12 -0500 Subject: A bunch of whitespace or .example/whatever changes to reduce stupid differences between us and upstream archweb --- TODO | 4 + local_settings.py.example | 59 +++ media/archnavbar/archnavbar.css | 9 +- media/archweb.css | 972 ++++++++++++++++++++++++++++++++------- public/views.py | 6 +- templates/packages/flaghelp.html | 3 +- templates/packages/search.html | 11 +- templates/releng/add.html | 22 +- 8 files changed, 885 insertions(+), 201 deletions(-) create mode 100644 TODO create mode 100644 local_settings.py.example (limited to 'templates') diff --git a/TODO b/TODO new file mode 100644 index 00000000..608d8470 --- /dev/null +++ b/TODO @@ -0,0 +1,4 @@ +TODO: + - refactor stats by templates in dashboard, maybe a templatetag + + diff --git a/local_settings.py.example b/local_settings.py.example new file mode 100644 index 00000000..bad03921 --- /dev/null +++ b/local_settings.py.example @@ -0,0 +1,59 @@ +### Django settings for archlinux project. + +## Debug settings +DEBUG = False +TEMPLATE_DEBUG = True +DEBUG_TOOLBAR = True + +## For django debug toolbar +INTERNAL_IPS = ('127.0.0.1',) + +## Notification admins +ADMINS = ( + # ('Joe Admin', 'joeadmin@example.com'), +) + +## MySQL Database settings +DATABASES = { + 'default': { + 'ENGINE' : 'django.db.backends.mysql', + 'NAME' : 'archlinux', + 'USER' : 'archlinux', + 'PASSWORD': 'archlinux', + 'HOST' : '', + 'PORT' : '', + 'OPTIONS' : {'init_command': 'SET storage_engine=InnoDB'}, + }, +} + +## Define cache settings +CACHES = { + 'default': { + 'BACKEND' : 'django.core.cache.backends.dummy.DummyCache', + #'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache', + #'LOCATION': '127.0.0.1:11211', + } +} +CACHE_MIDDLEWARE_KEY_PREFIX = 'arch' +CACHE_MIDDLEWARE_SECONDS = 300 + +## Use secure session cookies? Make this true if you want all +## logged-in actions to take place over HTTPS only. If developing +## locally, you will want to use False. +SESSION_COOKIE_SECURE = False + +## location for saving dev pictures +MEDIA_ROOT = '/srv/example.com/img/' + +## web url for serving image files +MEDIA_URL = 'http://example.com/img/' + +## Make this unique, and don't share it with anybody. +SECRET_KEY = '00000000000000000000000000000000000000000000000' + +## CDN settings +CDN_ENABLED = False +# Scheme-relative URL, should work for both http/https +CDN_PATH = '//example.com/path/' + +# vim: set ts=4 sw=4 et: diff --git a/media/archnavbar/archnavbar.css b/media/archnavbar/archnavbar.css index 6b82cb92..f83b8544 100644 --- a/media/archnavbar/archnavbar.css +++ b/media/archnavbar/archnavbar.css @@ -7,11 +7,9 @@ */ /* container for the entire bar */ -#archnavbar { height: 40px !important; padding: 10px 15px !important; -background: #000 !important; border-bottom: 5px #787DAB solid !important; } +#archnavbar { height: 40px !important; padding: 10px 15px !important; background: #000 !important; border-bottom: 5px #787DAB solid !important; } -#archnavbarlogo { float: left !important; margin: 0 !important; padding: 0 -!important; height: 50px !important; width: 397px !important; } +#archnavbarlogo { float: left !important; margin: 0 !important; padding: 0 !important; height: 50px !important; width: 397px !important; } /* and use a proper PNG for all other modern browsers */ html > body #archnavbarlogo { background: url('parabolabw.png') no-repeat !important; } @@ -20,8 +18,7 @@ html > body #archnavbarlogo { background: url('parabolabw.png') no-repeat !impor #archnavbarlogo h1 { margin: 0 !important; padding: 0 !important; text-indent: -9999px !important; } /* make the link the same size as the logo */ -#archnavbarlogo a { display: block !important; height: 50px !important; width: -397px !important; } +#archnavbarlogo a { display: block !important; height: 50px !important; width: 397px !important; } /* display the list inline, float it to the right and style it */ #archnavbar ul { display: inline !important; float: right !important; list-style: none !important; margin: 0 !important; padding: 0 !important; } diff --git a/media/archweb.css b/media/archweb.css index 85fdb610..0cb1c6ac 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -13,262 +13,886 @@ @import url('archnavbar/archnavbar.css'); /* simple reset */ -* { margin: 0; padding: 0; line-height: 1.4; } +* { + margin: 0; + padding: 0; + line-height: 1.4; +} /* general styling */ -body { min-width: 650px; background: #f6f9fc; color: #222; font: normal 100% sans-serif; text-align: center; } -p { margin: .33em 0 1em; } -ol, ul { margin-bottom: 1em; padding-left: 2em; } -ul { list-style: square; } -code { font: 1.2em monospace; background: #ffd; padding: 0.15em 0.25em; } -pre { font: 1.2em monospace; border: 1px solid #bdb; background: #dfd; padding: 0.5em; margin: 0.25em 2em; } -pre code { display: block; background: none; } -blockquote { margin: 1.5em 2em; } -input { vertical-align: middle; } -select[multiple] { padding-top: 1px; padding-bottom: 1px; } -select[multiple] option { padding-left: 0.3em; padding-right: 0.5em; } -input[type=submit] { padding-left: 0.6em; padding-right: 0.6em; } -.clear { clear: both; } -hr { border: none; border-top: 1px solid #888; } -img { border: 0; } +body { + min-width: 650px; + background: #f6f9fc; + color: #222; + font: normal 100% sans-serif; + text-align: center; +} + +p { + margin: .33em 0 1em; +} + +ol, +ul { + margin-bottom: 1em; + padding-left: 2em; +} + + ul { + list-style: square; + } + +code { + font: 1.2em monospace; + background: #ffd; + padding: 0.15em 0.25em; +} + +pre { + font: 1.2em monospace; + border: 1px solid #bdb; + background: #dfd; + padding: 0.5em; + margin: 0.25em 2em; +} + + pre code { + display: block; + background: none; + } + +blockquote { + margin: 1.5em 2em; +} + +input { + vertical-align: middle; +} + +select[multiple] { + padding-top: 1px; + padding-bottom: 1px; +} + + select[multiple] option { + padding-left: 0.3em; + padding-right: 0.5em; + } + +input[type=submit] { + padding-left: 0.6em; + padding-right: 0.6em; +} + +.clear { + clear: both; +} + +hr { + border: none; + border-top: 1px solid #888; +} + +img { + border: 0; +} /* scale fonts down to a sane default (16 * .812 = 13px) */ -#content { font-size: 0.812em; } +#content { + font-size: 0.812em; +} /* link style */ -a { text-decoration: none; } -a:link, th a:visited { color: #07b; } -a:visited { color: #666; } -a:hover { text-decoration: underline; color: #666; } -a:active { color: #e90; } +a { + text-decoration: none; +} + + a:link, + th a:visited { + color: #07b; + } + + a:visited { + color: #666; + } + + a:hover { + text-decoration: underline; + color: #666; + } + + a:active { + color: #e90; + } /* headings */ -h2 { font-size: 1.5em; margin-bottom: 0.5em; border-bottom: 1px solid #888; } -h3 { font-size: 1.25em; margin-top: 1em; } -h4 { font-size: 1.15em; margin-top: 1em; } -h5 { font-size: 1em; margin-top: 1em; } +h2 { + font-size: 1.5em; + margin-bottom: 0.5em; + border-bottom: 1px solid #888; +} + +h3 { + font-size: 1.25em; + margin-top: 1em; +} + +h4 { + font-size: 1.15em; + margin-top: 1em; +} + +h5 { + font-size: 1em; + margin-top: 1em; +} /* general layout */ -div#content { width: 95%; margin: 0 auto; text-align: left; } -div#content-left-wrapper { float: left; width: 100%; } /* req to keep content above sidebar in source code */ -div#content-left { margin: 0 340px 0 0; } -div#content-right { float: left; width: 300px; margin-left: -300px; } -div.box { margin-bottom: 1.5em; padding: 0.65em; background: #ecf2f5; border: 1px solid #bcd; } -div#footer { clear: both; margin: 2em 0 1em; } -div#footer p { margin: 0; text-align: center; font-size: 0.85em; } +div#content { + width: 95%; + margin: 0 auto; + text-align: left; +} + +div#content-left-wrapper { + float: left; + width: 100%; /* req to keep content above sidebar in source code */ +} + +div#content-left { + margin: 0 340px 0 0; +} + +div#content-right { + float: left; + width: 300px; + margin-left: -300px; +} + +div.box { + margin-bottom: 1.5em; + padding: 0.65em; + background: #ecf2f5; + border: 1px solid #bcd; +} + +div#footer { + clear: both; + margin: 2em 0 1em; +} + + div#footer p { + margin: 0; + text-align: center; + font-size: 0.85em; + } /* alignment */ -div.center, table.center, img.center { width: auto; margin-left: auto; margin-right: auto; } -p.center, td.center, th.center { text-align: center; } +div.center, +table.center, +img.center { + width: auto; + margin-left: auto; + margin-right: auto; +} + +p.center, +td.center, +th.center { + text-align: center; +} /* table generics */ -table { width: 100%; border-collapse: collapse; } -table .wrap { white-space: normal; } -th, td { white-space: nowrap; text-align: left; } -th { vertical-align: middle; font-weight: bold; } -td { vertical-align: top; } +table { + width: 100%; + border-collapse: collapse; +} + + table .wrap { + white-space: normal; + } + +th, +td { + white-space: nowrap; + text-align: left; +} + + th { + vertical-align: middle; + font-weight: bold; + } + + td { + vertical-align: top; + } /* table pretty styles */ -table.pretty1 { width: auto; margin-top: 0.25em; margin-bottom: 0.5em; border-collapse: collapse; border: 1px solid #bcd; } -table.pretty1 th { padding: 0.35em; background: #e4eeff; border: 1px solid #bcd; } -table.pretty1 td { padding: 0.35em; border: 1px dotted #bcd; } -table.pretty2 { width: auto; margin-top: 0.25em; margin-bottom: 0.5em; border-collapse: collapse; border: 1px solid #bbb; } -table.pretty2 th { padding: 0.35em; background: #eee; border: 1px solid #bbb; } -table.pretty2 td { padding: 0.35em; border: 1px dotted #bbb; } +table.pretty1 { + width: auto; + margin-top: 0.25em; + margin-bottom: 0.5em; + border-collapse: collapse; + border: 1px solid #bcd; +} + + table.pretty1 th { + padding: 0.35em; + background: #e4eeff; + border: 1px solid #bcd; + } + + table.pretty1 td { + padding: 0.35em; + border: 1px dotted #bcd; + } + +table.pretty2 { + width: auto; + margin-top: 0.25em; + margin-bottom: 0.5em; + border-collapse: collapse; + border: 1px solid #bbb; +} + + table.pretty2 th { + padding: 0.35em; + background: #eee; + border: 1px solid #bbb; + } + + table.pretty2 td { + padding: 0.35em; + border: 1px dotted #bbb; + } /* forms and input styling */ -form p { margin: 0.5em 0; } -fieldset { border: 0; } -label { width: 12em; vertical-align: top; display: inline-block; font-weight: bold; } -input[type=text], input[type=password], textarea { padding: 0.10em; } -form.general-form label, form.general-form .form-help { width: 10em; vertical-align: top; display: inline-block; } -form.general-form input[type=text], form.general-form textarea { width: 45%; } +form p { + margin: 0.5em 0; +} + +fieldset { + border: 0; +} + +label { + width: 12em; + vertical-align: top; + display: inline-block; + font-weight: bold; +} + +input[type=text], +input[type=password], +textarea { + padding: 0.10em; +} + +form.general-form label, +form.general-form .form-help { + width: 10em; + vertical-align: top; + display: inline-block; +} + +form.general-form input[type=text], +form.general-form textarea { + width: 45%; +} /* archdev navbar */ -div#archdev-navbar { margin: 1.5em 0; } -div#archdev-navbar ul { list-style: none; margin: -0.5em 0; padding: 0; } -div#archdev-navbar li { display: inline; margin: 0; padding: 0; font-size: 0.9em; } -div#archdev-navbar li a { padding: 0 0.5em; color: #07b; } +div#archdev-navbar { + margin: 1.5em 0; +} + + div#archdev-navbar ul { + list-style: none; + margin: -0.5em 0; + padding: 0; + } + + div#archdev-navbar li { + display: inline; + margin: 0; + padding: 0; + font-size: 0.9em; + } + + div#archdev-navbar li a { + padding: 0 0.5em; + color: #07b; + } /* error/info messages (x pkg is already flagged out-of-date, etc) */ -#sys-message { width: 35em; text-align: center; margin: 1em auto; padding: 0.5em; background: #fff; border: 1px solid #f00; } -#sys-message p { margin: 0; } - -ul.errorlist { color: red; } - -/* +#sys-message { + width: 35em; + text-align: center; + margin: 1em auto; + padding: 0.5em; + background: #fff; + border: 1px solid #f00; +} + + #sys-message p { + margin: 0; + } + +ul.errorlist { + color: red; +} + +/** * PAGE SPECIFIC STYLES */ /* home: introduction */ -#intro p.readmore { margin: -0.5em 0 0 0; font-size: .9em; text-align: right; } +#intro p.readmore { + margin: -0.5em 0 0 0; + font-size: .9em; + text-align: right; +} /* home: news */ -#news { margin-top: 1.5em; } -#news h3 { border-bottom: 1px solid #888; } -#news div { margin-bottom: 1em; } -#news div p { margin-bottom: 0.5em; } -#news .more { font-weight: normal; } -#news .rss-icon { float: right; margin: -1.6em 0.4em 0 0; } -#news h4 { font-size: 1em; margin-top: 1.5em; border-bottom: 1px dotted #bbb; } -#news .timestamp { float: right; font-size: 0.85em; margin: -1.8em 0.5em 0 0; } +#news { + margin-top: 1.5em; +} + + #news h3 { + border-bottom: 1px solid #888; + } + + #news div { + margin-bottom: 1em; + } + + #news div p { + margin-bottom: 0.5em; + } + + #news .more { + font-weight: normal; + } + + #news .rss-icon { + float: right; + margin: -1.6em 0.4em 0 0; + } + + #news h4 { + font-size: 1em; + margin-top: 1.5em; + border-bottom: 1px dotted #bbb; + } + + #news .timestamp { + float: right; + font-size: 0.85em; + margin: -1.8em 0.5em 0 0; + } /* home: pkgsearch box */ -#pkgsearch { padding: 1em 0.75em; background: #3ad; color: #fff; border: 1px solid #08b; } -#pkgsearch label { width: auto; padding: 0.1em 0; } -#pkgsearch input { width: 10em; float: right; font-size: 1em; color: #000; background: #fff; border: 1px solid #09c; } +#pkgsearch { + padding: 1em 0.75em; + background: #3ad; + color: #fff; + border: 1px solid #08b; +} + + #pkgsearch label { + width: auto; + padding: 0.1em 0; + } + + #pkgsearch input { + width: 10em; + float: right; + font-size: 1em; + color: #000; + background: #fff; + border: 1px solid #09c; + } /* home: recent pkg updates */ -#pkg-updates h3 { margin: 0 0 0.3em; } -#pkg-updates .more { font-weight: normal; } -#pkg-updates .rss-icon { float: right; margin: -2em 0 0 0; } -#pkg-updates table { margin: 0; } -#pkg-updates td.pkg-name { white-space: normal; } -#pkg-updates td.pkg-arch { text-align: right; } -#pkg-updates span.testing, #pkg-updates span.community-testing, span.multilib-testing { font-style: italic; } -#pkg-updates span.staging, #pkg-updates span.community-staging, span.multilib-staging { font-style: italic; color: #ff8040; } +#pkg-updates h3 { + margin: 0 0 0.3em; +} + + #pkg-updates .more { + font-weight: normal; + } + + #pkg-updates .rss-icon { + float: right; + margin: -2em 0 0 0; + } + + #pkg-updates table { + margin: 0; + } + + #pkg-updates td.pkg-name { + white-space: normal; + } + + #pkg-updates td.pkg-arch { + text-align: right; + } + + #pkg-updates span.testing, + #pkg-updates span.community-testing, + span.multilib-testing { + font-style: italic; + } + + #pkg-updates span.staging, + #pkg-updates span.community-staging, + span.multilib-staging { + font-style: italic; + color: #ff8040; + } /* home: sidebar navigation */ -div#nav-sidebar ul { list-style: none; margin: 0.5em 0 0.5em 1em; padding: 0; } +div#nav-sidebar ul { + list-style: none; + margin: 0.5em 0 0.5em 1em; + padding: 0; +} /* home: sponsor banners */ -div#arch-sponsors img { padding: 0.3em 0; } +div#arch-sponsors img { + padding: 0.3em 0; +} /* home: sidebar components (navlist, sponsors, pkgsearch, etc) */ -div.widget { margin-bottom: 1.5em; } +div.widget { + margin-bottom: 1.5em; +} /* feeds page */ -#rss-feeds .rss { padding-right: 20px; background: url(rss.png) top right no-repeat; } +#rss-feeds .rss { + padding-right: 20px; + background: url(rss.png) top right no-repeat; +} /* artwork: logo images */ -#artwork img.inverted { background: #333; padding: 0; } -#artwork div.imagelist img { display: inline; margin: 0.75em; } +#artwork img.inverted { + background: #333; + padding: 0; +} + +#artwork div.imagelist img { + display: inline; + margin: 0.75em; +} /* news: article list */ -.news-nav { float: right; margin-top: -2.2em; } -.news-nav .prev, .news-nav .next { margin-left: 1em; margin-right: 1em; } +.news-nav { + float: right; + margin-top: -2.2em; +} + + .news-nav .prev, + .news-nav .next { + margin-left: 1em; + margin-right: 1em; + } /* news: article pages */ -div.news-article .article-info { margin: 0; color: #999; } +div.news-article .article-info { + margin: 0; + color: #999; +} /* news: add/edit article */ -form#newsform { width: 60em; } -form#newsform input[type=text], form#newsform textarea { width: 75%; } +form#newsform { + width: 60em; +} + + form#newsform input[type=text], + form#newsform textarea { + width: 75%; + } /* donate: donor list */ -div#donor-list ul { width: 100%; } -/* max 4 columns, but possibly fewer if screen size doesn't allow for more */ -div#donor-list li { float: left; width: 25%; min-width: 20em; } +div#donor-list ul { + width: 100%; +} + /* max 4 columns, but possibly fewer if screen size doesn't allow for more */ + div#donor-list li { + float: left; + width: 25%; + min-width: 20em; + } /* download page */ -#arch-downloads h3 { border-bottom: 1px dotted #aaa; } -table#download-torrents .cpu-arch { text-align: center; } -table#download-mirrors { width: auto; margin-bottom: 1em; } -table#download-mirrors td.mirror-country { padding-top: 1em; } -table#download-mirrors td.mirror-server { padding-right: 1em; } -table#download-mirrors a { display: block; float: right; width: 4em; } +#arch-downloads h3 { + border-bottom: 1px dotted #aaa; +} + +table#download-torrents .cpu-arch { + text-align: center; +} + +table#download-mirrors { + width: auto; + margin-bottom: 1em; +} + + table#download-mirrors td.mirror-country { + padding-top: 1em; + } + + table#download-mirrors td.mirror-server { + padding-right: 1em; + } + + table#download-mirrors a { + display: block; + float: right; + width: 4em; + } /* pkglists/devlists */ -table.results { font-size: 0.846em; border-top: 1px dotted #999; border-bottom: 1px dotted #999; } -table.results th { padding: 0.5em 1em 0.25em 0.25em; border-bottom: 1px solid #999; white-space: nowrap; background-color:#fff; } -table.results td { padding: .3em 1em .3em 3px; } -table.results tr.odd { background: #fff; } -table.results tr.even { background: #e4eeff; } -/* additional styles for JS sorting */ -table.results th.header { padding-right: 20px; background-image: url(nosort.gif); background-repeat: no-repeat; background-position: center right; cursor: pointer; } -table.results th.headerSortDown { background-color: #e4eeff; background-image: url(desc.gif); } -table.results th.headerSortUp { background-color: #e4eeff; background-image: url(asc.gif); } -table.results .flagged { color: red; } +table.results { + font-size: 0.846em; + border-top: 1px dotted #999; + border-bottom: 1px dotted #999; +} + + table.results th { + padding: 0.5em 1em 0.25em 0.25em; + border-bottom: 1px solid #999; + white-space: nowrap; + background-color:#fff; + } + + table.results td { + padding: .3em 1em .3em 3px; + } + + table.results tr.odd { + background: #fff; + } + + table.results tr.even { + background: #e4eeff; + } + + /* additional styles for JS sorting */ + table.results th.header { + padding-right: 20px; + background-image: url(nosort.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; + } + + table.results th.headerSortDown { + background-color: #e4eeff; + background-image: url(desc.gif); + } + + table.results th.headerSortUp { + background-color: #e4eeff; + background-image: url(asc.gif); + } + + table.results .flagged { + color: red; + } /* pkglist: layout */ -div#pkglist-about { margin-top: 1.5em; } +div#pkglist-about { + margin-top: 1.5em; +} /* pkglist: results navigation */ -#pkglist-stats-top, #pkglist-stats-bottom { font-size: 0.85em; } -#pkglist-results .pkglist-nav { float: right; margin-top: -2.2em; } -.pkglist-nav .prev { margin-right: 1em; } -.pkglist-nav .next { margin-right: 1em; } +#pkglist-stats-top, +#pkglist-stats-bottom { + font-size: 0.85em; +} + +#pkglist-results .pkglist-nav { + float: right; + margin-top: -2.2em; +} + +.pkglist-nav .prev { + margin-right: 1em; +} + +.pkglist-nav .next { + margin-right: 1em; +} /* search fields and other filter selections */ -.filter-criteria h3 { font-size: 1em; margin-top:0; } -.filter-criteria div { float: left; margin-right: 1.65em; font-size: 0.85em; } -.filter-criteria legend { display: none; } -.filter-criteria label { width: auto; display: block; font-weight: normal; } +.filter-criteria h3 { + font-size: 1em; + margin-top:0; +} + +.filter-criteria div { + float: left; + margin-right: 1.65em; + font-size: 0.85em; +} + +.filter-criteria legend { + display: none; +} + +.filter-criteria label { + width: auto; + display: block; + font-weight: normal; +} /* pkgdetails: details links that float on the right */ -#pkgdetails #detailslinks { float: right; } -#pkgdetails #detailslinks h4 { margin-top: 0; margin-bottom: 0.25em; } -#pkgdetails #detailslinks ul { list-style: none; padding: 0; margin-bottom: 0; font-size: 0.846em; } -#pkgdetails #detailslinks > div { padding: 0.5em; margin-bottom: 1em; background: #eee; border: 1px solid #bbb; } -#pkgdetails #actionlist .flagged { color: red; font-size: 0.9em; font-style: italic; } +#pkgdetails #detailslinks { + float: right; +} + + #pkgdetails #detailslinks h4 { + margin-top: 0; + margin-bottom: 0.25em; + } + + #pkgdetails #detailslinks ul { + list-style: none; + padding: 0; + margin-bottom: 0; + font-size: 0.846em; + } + + #pkgdetails #detailslinks > div { + padding: 0.5em; + margin-bottom: 1em; + background: #eee; + border: 1px solid #bbb; + } + +#pkgdetails #actionlist .flagged { + color: red; + font-size: 0.9em; + font-style: italic; +} /* pkgdetails: pkg info */ -#pkgdetails #pkginfo { width: auto; } -#pkgdetails #pkginfo td { padding: 0.25em 0 0.25em 1.5em; } +#pkgdetails #pkginfo { + width: auto; +} + + #pkgdetails #pkginfo td { + padding: 0.25em 0 0.25em 1.5em; + } /* pkgdetails: flag package */ -form#flag-pkg-form label { width: 10em; } -form#flag-pkg-form textarea, form#flag-pkg-form input[type=text] { width: 45%; } +form#flag-pkg-form label { + width: 10em; +} + +form#flag-pkg-form textarea, +form#flag-pkg-form input[type=text] { + width: 45%; +} /* pkgdetails: deps, required by and file lists */ -#pkgdetails #metadata h3 { background: #555; color: #fff; font-size: 1em; margin-bottom: 0.5em; padding: 0.2em 0.35em; } -#pkgdetails #metadata ul { list-style: none; margin: 0; padding: 0; } -#pkgdetails #metadata li { padding-left: 0.5em; } -#pkgdetails #metadata p { padding-left: 0.5em; } -#pkgdetails #metadata .message { font-style: italic; } -#pkgdetails #metadata br { clear: both; } -#pkgdetails #pkgdeps { float: left; width: 48%; margin-right: 2%; } -#pkgdetails #metadata .virtual-dep { font-style: italic; } -#pkgdetails #metadata .testing-dep { font-style: italic; } -#pkgdetails #metadata .opt-dep { font-style: italic; } -#pkgdetails #metadata .dep-desc { font-style: italic; } -#pkgdetails #pkgreqs { float: left; width: 50%; } -#pkgdetails #pkgfiles { clear: left; padding-top: 1em; } +#pkgdetails #metadata h3 { + background: #555; + color: #fff; + font-size: 1em; + margin-bottom: 0.5em; + padding: 0.2em 0.35em; +} + +#pkgdetails #metadata ul { + list-style: none; + margin: 0; + padding: 0; +} + +#pkgdetails #metadata li { + padding-left: 0.5em; +} + +#pkgdetails #metadata p { + padding-left: 0.5em; +} + +#pkgdetails #metadata .message { + font-style: italic; +} + +#pkgdetails #metadata br { + clear: both; +} + +#pkgdetails #pkgdeps { + float: left; + width: 48%; + margin-right: 2%; +} + +#pkgdetails #metadata .virtual-dep, +#pkgdetails #metadata .testing-dep, +#pkgdetails #metadata .opt-dep, +#pkgdetails #metadata .dep-desc { + font-style: italic; +} +#pkgdetails #pkgreqs { + float: left; + width: 50%; +} + +#pkgdetails #pkgfiles { + clear: left; + padding-top: 1em; +} /* dev/TU biographies */ -div#arch-bio-toc { width: 75%; margin: 0 auto; text-align: center; } -table.arch-bio-entry td.pic { vertical-align: top; padding-right: 15px; padding-top: 10px; } -table.arch-bio-entry td.pic img { padding: 4px; border: 1px solid #ccc; } -table.arch-bio-entry table.bio { margin-bottom: 2em; } -table.arch-bio-entry table.bio th { text-align: left; padding-right: 0.5em; vertical-align: top; white-space: nowrap; } -table.arch-bio-entry table.bio td { width: 100%; padding-bottom: 0.25em; } +div#arch-bio-toc { + width: 75%; + margin: 0 auto; + text-align: center; +} + +table.arch-bio-entry td.pic { + vertical-align: top; + padding-right: 15px; + padding-top: 10px; +} + + table.arch-bio-entry td.pic img { + padding: 4px; + border: 1px solid #ccc; + } + +table.arch-bio-entry table.bio { + margin-bottom: 2em; +} + + table.arch-bio-entry table.bio th { + text-align: left; + padding-right: 0.5em; + vertical-align: top; + white-space: nowrap; + } + + table.arch-bio-entry table.bio td { + width: 100%; + padding-bottom: 0.25em; + } /* dev: login/out */ p.login-error {} -table#dev-login { width: auto; } +table#dev-login { + width: auto; +} /* dev dashboard: flagged packages */ -form#dash-pkg-notify { text-align: right; padding: 1em 0 0; margin-top: 1em; font-size: 0.85em; border-top: 1px dotted #aaa; } -form#dash-pkg-notify label { width: auto; font-weight: normal; } -form#dash-pkg-notify input { vertical-align: middle; margin: 0 0.25em; } -form#dash-pkg-notify input[type=submit] { margin-top: -0.25em; } -form#dash-pkg-notify p { margin: 0; } - -table.dash-stats .key { width: 50%; } +form#dash-pkg-notify { + text-align: right; + padding: 1em 0 0; + margin-top: 1em; + font-size: 0.85em; + border-top: 1px dotted #aaa; +} + + form#dash-pkg-notify label { + width: auto; + font-weight: normal; + } + + form#dash-pkg-notify input { + vertical-align: middle; + margin: 0 0.25em; + } + + form#dash-pkg-notify input[type=submit] { + margin-top: -0.25em; + } + + form#dash-pkg-notify p { + margin: 0; + } + +table.dash-stats .key { + width: 50%; +} /* dev dashboard: admin actions (add news items, todo list, etc) */ -ul.admin-actions { float: right; list-style: none; margin-top: -2.5em; } -ul.admin-actions li { display: inline; padding-left: 1.5em; } +ul.admin-actions { + float: right; + list-style: none; + margin-top: -2.5em; +} + + ul.admin-actions li { + display: inline; + padding-left: 1.5em; + } /* todo lists (public and private) */ -.todo-table .complete { color: green; } -.todo-table .incomplete { color: red; } -.todo-info { margin: 0; color: #999; } -.todo-list h4 { margin-top: 0; margin-bottom: 0.4em; } +.todo-table .complete { + color: green; +} + +.todo-table .incomplete { + color: red; +} +.todo-info { + margin: 0; color: #999; +} + +.todo-list h4 { + margin-top: 0; + margin-bottom: 0.4em; +} /* dev: signoff page */ -#dev-signoffs ul { list-style: none; margin: 0; padding: 0; } -#dev-signoffs .signoff-yes { color: green; font-weight: bold; } -#dev-signoffs .signoff-no { color: red; } -#dev-signoffs .signed-username { color: #888; margin-left: 0.5em; } +#dev-signoffs ul { + list-style: none; + margin: 0; + padding: 0; +} + +#dev-signoffs .signoff-yes { + color: green; + font-weight: bold; +} + +#dev-signoffs .signoff-no { + color: red; +} + +#dev-signoffs .signed-username { + color: #888; + margin-left: 0.5em; +} /* iso testing feedback form */ -#releng-feedback label { width: auto; display: inline; font-weight: normal; } -#releng-feedback ul { padding-left: 1em; } -#releng-feedback li { list-style: none; } -#releng-feedback ul+.helptext { position: relative; top: -0.9em; } +#releng-feedback label { + width: auto; + display: inline; + font-weight: normal; +} + +#releng-feedback ul { + padding-left: 1em; +} + +#releng-feedback li { + list-style: none; +} + +#releng-feedback ul+.helptext { + position: relative; + top: -0.9em; +} /* highlight current website in the navbar */ -#archnavbar.anb-home ul li#anb-home a { color: white !important; } -#archnavbar.anb-packages ul li#anb-packages a { color: white !important; } -#archnavbar.anb-download ul li#anb-download a { color: white !important; } +#archnavbar.anb-home ul li#anb-home a, +#archnavbar.anb-packages ul li#anb-packages a, +#archnavbar.anb-download ul li#anb-download a { + color: white !important; +} diff --git a/public/views.py b/public/views.py index 1aae2846..bb9cd454 100644 --- a/public/views.py +++ b/public/views.py @@ -31,11 +31,13 @@ def index(request): } def userlist(request, user_type='hackers'): - users = User.objects.order_by('username').select_related('userprofile') + users = User.objects.order_by( + 'username').select_related('userprofile') if user_type == 'hackers': users = users.filter(is_active=True, groups__name="Hackers") elif user_type == 'fellows': - users = users.filter(is_active=False, groups__name__in=["Hackers"]) + users = users.filter(is_active=False, + groups__name__in=["Hackers"]) else: raise Http404 diff --git a/templates/packages/flaghelp.html b/templates/packages/flaghelp.html index 4a9d1cdf..e33ba0f5 100644 --- a/templates/packages/flaghelp.html +++ b/templates/packages/flaghelp.html @@ -25,8 +25,7 @@ <h3>Flagging Packages</h3> <p>The message box portion of the flag utility is optional, and meant for short messages only. If you need more than 200 characters for your message, then file a bug report, email the maintainer directly, or send - an email to the <a target="_blank" - href="http://list.parabolagnulinux.org/listinfo.cgi/dev-parabolagnulinux.org" + an email to the <a target="_blank" href="http://list.parabolagnulinux.org/listinfo.cgi/dev-parabolagnulinux.org" title="Visit the parabola dev mailing list">parabola mailing list</a> with your additional text.</p> diff --git a/templates/packages/search.html b/templates/packages/search.html index 2a314853..4a61298e 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -156,16 +156,15 @@ <h3>Package Search</h3> </div><!-- #pkglist-results --> {% else %} <div class="box"> - <p>We couldn't find any packages matching your query. Try searching again - using different criteria.</p> + <p>We couldn't find any packages matching your query. Try searching again + using different criteria.</p> </div> {% endif %} <div id="pkglist-about" class="box"> - <p>You are browsing the Parabola package database. From here you can - find detailed information about packages located in the official - supported repositories. If you need the sourceball from where a - package is built, you can look at our <a + <p>You are browsing the Parabola package database. From here you can find + detailed information about packages located in the official supported repositories. + If you need the sourceball from where a package is built, you can look at our <a href='http://repo.parabolagnulinux.org/sources/packages' title='Sourceballed packages'>sources repo</a>.</p> </div> diff --git a/templates/releng/add.html b/templates/releng/add.html index 428812c9..402ceac6 100644 --- a/templates/releng/add.html +++ b/templates/releng/add.html @@ -6,17 +6,17 @@ <div class="box"> <h2>Parabola Releng Testbuild Feedback Entry</h2> - <p>This page allows you to submit feedback after testing an Parabola - installation using a release engineering testbuild. Mark all the - options you used during the installation; at the end you can specify - whether everything went OK. Be sure to only denote a successful - install after having checked the installation properly. Some options - require you to check several things (such as config files), this will - be mentioned alongside the option.</p> <p>There is also an overview of - all feedback on the <a href="{% url releng-test-overview %}">results - page</a>. Once we have builds that are properly tested (enough - successful feedback for all important features of the ISO or a - slightly earlier ISO), we can release new official media.</p> + <p>This page allows you to submit feedback after testing an Parabola installation + using a release engineering testbuild. Mark all the options you used during the + installation; at the end you can specify whether everything went OK. Be + sure to only denote a successful install after having checked the + installation properly. Some options require you to check several things (such as + config files), this will be mentioned alongside the option.</p> + <p>There is also an overview of all feedback on the + <a href="{% url releng-test-overview %}">results page</a>. Once we have + builds that are properly tested (enough successful feedback for all + important features of the ISO or a slightly earlier ISO), we can release new + official media.</p> <div id="releng-feedback"> <form action="" method="post">{% csrf_token %} {{ form.as_p }} -- cgit v1.2.3-54-g00ecf From 9279d9a04cc99691ab6c7fbafe7db03a757d23e8 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Wed, 30 Nov 2011 12:27:57 -0600 Subject: Fix minor validation error Signed-off-by: Dan McGee <dan@archlinux.org> --- templates/devel/profile.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/devel/profile.html b/templates/devel/profile.html index 2f16801b..b6580ab8 100644 --- a/templates/devel/profile.html +++ b/templates/devel/profile.html @@ -6,7 +6,7 @@ <h2>Developer Profile</h2> - <form id="edit-profile-form" enctype="multipart/form-data" method="post">{% csrf_token %} + <form id="edit-profile-form" enctype="multipart/form-data" method="post" action="">{% csrf_token %} <p><em>Note:</em> This is the public information shown on the developer and/or TU profiles page, so please be appropriate with the information you provide here.</p> -- cgit v1.2.3-54-g00ecf From b05eae96a4be8990a1de81795013587ded7ed3aa Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Wed, 30 Nov 2011 12:28:11 -0600 Subject: Add more precise sort for last update signoff column This allows sorting by the exact time recorded in the database, even if we don't show it directly to the user, which makes finding the most recent updates a lot easier. Signed-off-by: Dan McGee <dan@archlinux.org> --- media/archweb.js | 13 +++++++++++++ templates/packages/signoffs.html | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/media/archweb.js b/media/archweb.js index 4f098c7d..151d0f81 100644 --- a/media/archweb.js +++ b/media/archweb.js @@ -54,6 +54,19 @@ if (typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + $.tablesorter.addParser({ + id: 'epochdate', + is: function(s) { return false; }, + format: function(s, t, c) { + /* TODO: this assumes our magic class is the only one */ + var epoch = $(c).attr('class'); + if (!epoch.indexOf('epoch-') == 0) { + return 0; + } + return epoch.slice(6); + }, + type: 'numeric' + }); $.tablesorter.addParser({ id: 'longDateTime', re: /^(\d{4})-(\d{2})-(\d{2}) ([012]\d):([0-5]\d)(:([0-5]\d))?( (\w+))?$/, diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index bd84289c..b032e656 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -56,7 +56,7 @@ <h3>Filter Displayed Signoffs</h3> <td>{{ group.target_repo }}</td> <td>{{ group.packager|default:"Unknown" }}</td> <td>{{ group.packages|length }}</td> - <td>{{ group.last_update|date }}</td> + <td class="epoch-{{ group.last_update|date:'U' }}">{{ group.last_update|date }}</td> {% if group.specification.known_bad %} <td class="approval signoff-bad">Bad</td> {% else %} @@ -85,7 +85,7 @@ <h3>Filter Displayed Signoffs</h3> $(document).ready(function() { $('a.signoff-link').click(signoff_package); $(".results").tablesorter({widgets: ['zebra'], sortList: [[0,0]], - headers: { 7: { sorter: false }, 8: {sorter: false } } }); + headers: { 5: { sorter: 'epochdate' }, 7: { sorter: false }, 8: {sorter: false } } }); $('#signoffs_filter input').change(filter_signoffs); $('#criteria_reset').click(filter_signoffs_reset); // fire function on page load to ensure the current form selections take effect -- cgit v1.2.3-54-g00ecf From 6b8ef446bcd6a1cbc794d0846968e806034d3aad Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Wed, 30 Nov 2011 13:55:36 -0600 Subject: Add master key overview page And a bunch of text that may suck, but is better than nothing. Signed-off-by: Dan McGee <dan@archlinux.org> --- main/models.py | 12 ++++++++++ main/templatetags/pgp.py | 13 +++++++++++ public/views.py | 18 ++++++++++----- templates/public/keys.html | 57 ++++++++++++++++++++++++++++++++++++++++++++++ urls.py | 1 + 5 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 templates/public/keys.html (limited to 'templates') diff --git a/main/models.py b/main/models.py index 990cc8ca..9156fb51 100644 --- a/main/models.py +++ b/main/models.py @@ -53,6 +53,18 @@ class Meta: verbose_name = 'Additional Profile Data' verbose_name_plural = 'Additional Profile Data' + def get_absolute_url(self): + # TODO: this is disgusting. find a way to consolidate this logic with + # public.views.userlist among other places, and make some constants or + # something so we aren't using copies of string names everywhere. + group_names = self.user.groups.values_list('name', flat=True) + if "Developers" in group_names: + prefix = "developers" + elif "Trusted Users" in group_names: + prefix = "trustedusers" + else: + prefix = "fellows" + return '/%s/#%s' % (prefix, self.user.username) class TodolistManager(models.Manager): def incomplete(self): diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index 67f5e08d..d69e2918 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -1,5 +1,7 @@ from django import template from django.conf import settings +from django.utils.html import conditional_escape +from django.utils.safestring import mark_safe register = template.Library() @@ -26,4 +28,15 @@ def pgp_key_link(key_id): values = (url, format_key(key_id), key_id[-8:]) return '<a href="%s" title="PGP key search for %s">0x%s</a>' % values +@register.filter +def pgp_fingerprint(key_id, autoescape=True): + if not key_id: + return u'' + if autoescape: + esc = conditional_escape + else: + esc = lambda x: x + return mark_safe(format_key(esc(key_id))) +pgp_fingerprint.needs_autoescape = True + # vim: set ts=4 sw=4 et: diff --git a/public/views.py b/public/views.py index c28fd303..95b590fc 100644 --- a/public/views.py +++ b/public/views.py @@ -1,17 +1,17 @@ -from main.models import Arch, Repo, Donor -from mirrors.models import MirrorUrl -from news.models import News -from . import utils - from django.conf import settings from django.contrib.auth.models import User from django.http import Http404 from django.views.generic import list_detail from django.views.generic.simple import direct_to_template +from devel.models import MasterKey +from main.models import Arch, Repo, Donor +from mirrors.models import MirrorUrl +from news.models import News +from utils import get_recent_updates def index(request): - pkgs = utils.get_recent_updates() + pkgs = get_recent_updates() context = { 'news_updates': News.objects.order_by('-postdate', '-id')[:15], 'pkg_updates': pkgs, @@ -77,4 +77,10 @@ def feeds(request): } return direct_to_template(request, 'public/feeds.html', context) +def keys(request): + context = { + 'keys': MasterKey.objects.select_related('owner', 'revoker').all(), + } + return direct_to_template(request, 'public/keys.html', context) + # vim: set ts=4 sw=4 et: diff --git a/templates/public/keys.html b/templates/public/keys.html new file mode 100644 index 00000000..2e7fcebe --- /dev/null +++ b/templates/public/keys.html @@ -0,0 +1,57 @@ +{% extends "base.html" %} +{% load pgp %} + +{% block title %}Arch Linux - Master Signing Keys{% endblock %} + +{% block content %} +<div id="signing-keys" class="box"> + <h2>Master Signing Keys</h2> + + <p>This page lists the Arch Linux Master Keys. This is a distributed set of + keys that are seen as "official" signing keys of the distribution. Each key + is held by a different developer, and a revocation certificate for the key + is held by a different developer. Thus, no one developer has absolute hold + on any sort of absolute, root trust.</p> + <p>The {{ keys|length }} key{{ keys|pluralize }} listed below should be + regarded as the current set of master keys. They are available on public + keyservers and should be signed by the owner of the key.</p> + <p>All official Arch Linux developers and trusted users should have their + key signed by at least three of these master keys. This is in accordance + with the PGP <em>web of trust</em> concept. If a user is willing to + marginally trust all of the master keys, three signatures from different + master keys will consider a given developer's key as valid. For more + information on trust, please consult the + <a href="http://www.gnupg.org/gph/en/manual.html">GNU Privacy Handbook</a> + and <a href="http://www.gnupg.org/gph/en/manual.html#AEN385">Using trust to + validate keys</a>.</p> + + <table class="pretty2"> + <thead> + <tr> + <th>Master Key</th> + <th>Full Fingerprint</th> + <th>Owner</th> + <th>Owner's Signing Key</th> + <th>Revoker</th> + <th>Revoker's Signing Key</th> + </tr> + </thead> + <tbody> + {% for key in keys %} + <tr> + <td>{% pgp_key_link key.pgp_key %}</td> + <td>{{ key.pgp_key|pgp_fingerprint }}</td> + {% with key.owner.userprofile as owner_profile %} + <td><a href="{{ owner_profile.get_absolute_url }}">{{ key.owner.get_full_name }}</a></td> + <td>{% pgp_key_link owner_profile.pgp_key %}</td> + {% endwith %} + {% with key.revoker.userprofile as revoker_profile %} + <td><a href="{{ revoker_profile.get_absolute_url }}">{{ key.revoker.get_full_name }}</a></td> + <td>{% pgp_key_link revoker_profile.pgp_key %}</td> + {% endwith %} + </tr> + {% endfor %} + </tbody> + </table> +</div> +{% endblock %} diff --git a/urls.py b/urls.py index 1d06f0f2..b01d2ee3 100644 --- a/urls.py +++ b/urls.py @@ -67,6 +67,7 @@ (r'^fellows/$', 'userlist', { 'user_type':'fellows' }, 'page-fellows'), (r'^donate/$', 'donate', {}, 'page-donate'), (r'^download/$', 'download', {}, 'page-download'), + (r'^master-keys/$', 'keys', {}, 'page-keys'), ) # Includes and other remaining stuff -- cgit v1.2.3-54-g00ecf From 4590196d79273c49172e2da74e7a7b31e59d7a27 Mon Sep 17 00:00:00 2001 From: Dan McGee <dan@archlinux.org> Date: Wed, 30 Nov 2011 14:07:35 -0600 Subject: Integrate master key into rest of site Signed-off-by: Dan McGee <dan@archlinux.org> --- devel/management/commands/generate_keyring.py | 4 ++++ sitemaps.py | 22 ++++++++++++++++++---- templates/public/index.html | 2 ++ 3 files changed, 24 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/devel/management/commands/generate_keyring.py b/devel/management/commands/generate_keyring.py index 35ab8874..a3a764b4 100644 --- a/devel/management/commands/generate_keyring.py +++ b/devel/management/commands/generate_keyring.py @@ -13,6 +13,7 @@ import subprocess import sys +from devel.models import MasterKey from main.models import UserProfile logging.basicConfig( @@ -48,11 +49,14 @@ def generate_keyring(keyserver, keyring): pgp_key__isnull=False).extra(where=["pgp_key != ''"]).values_list( "pgp_key", flat=True) logger.info("%d keys fetched from user profiles", len(key_ids)) + master_key_ids = MasterKey.objects.values_list("pgp_key", flat=True) + logger.info("%d keys fetched from master keys", len(master_key_ids)) gpg_cmd = ["gpg", "--no-default-keyring", "--keyring", keyring, "--keyserver", keyserver, "--recv-keys"] logger.info("running command: %r", gpg_cmd) gpg_cmd.extend(key_ids) + gpg_cmd.extend(master_key_ids) subprocess.check_call(gpg_cmd) logger.info("keyring at %s successfully updated", keyring) diff --git a/sitemaps.py b/sitemaps.py index 7718002d..958d1f44 100644 --- a/sitemaps.py +++ b/sitemaps.py @@ -71,10 +71,24 @@ class BaseSitemap(Sitemap): base_viewnames = ( ('index', 1.0, 'hourly'), ('packages-search', 0.8, 'hourly'), - 'page-about', 'page-art', 'page-svn', 'page-devs', 'page-tus', - 'page-fellows', 'page-donate', 'page-download', 'news-list', - 'feeds-list', 'groups-list', 'mirror-list', 'mirror-status', - 'mirrorlist', 'packages-differences', 'releng-test-overview', + ('page-keys', 0.8, 'weekly'), + ('news-list', 0.7, 'weekly'), + ('groups-list', 0.5, 'weekly'), + ('mirror-status', 0.4, 'hourly'), + 'page-about', + 'page-art', + 'page-svn', + 'page-devs', + 'page-tus', + 'page-fellows', + 'page-donate', + 'page-download', + 'feeds-list', + 'mirror-list', + 'mirrorlist', + 'packages-differences', + 'releng-test-overview', + 'visualize-index', ) def items(self): diff --git a/templates/public/index.html b/templates/public/index.html index 854bd447..4bd26f6b 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -170,6 +170,8 @@ <h4>Tools</h4> <h4>Development</h4> <ul> + <li><a href="{% url page-keys %}" + title="Package/Database signing master keys">Master Keys</a></li> <li><a href="/packages/" title="View/search the package repository database">Packages</a></li> <li><a href="/groups/" -- cgit v1.2.3-54-g00ecf From 623e0453cee5e3f663a0b18d68db0396cc812983 Mon Sep 17 00:00:00 2001 From: Luke Shumaker <LukeShu@sbcglobal.net> Date: Thu, 1 Dec 2011 23:35:41 -0500 Subject: I think this fixes all the broken links (that point to parabolagnulinux.org anyway) --- devel/views.py | 2 +- settings.py | 2 +- templates/base.html | 2 +- templates/packages/flaghelp.html | 2 +- templates/public/art.html | 2 +- templates/public/download.html | 2 +- templates/public/feeds.html | 2 +- templates/public/index.html | 4 ++-- todolists/views.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) (limited to 'templates') diff --git a/devel/views.py b/devel/views.py index 7cc45419..b9bd7cce 100644 --- a/devel/views.py +++ b/devel/views.py @@ -292,7 +292,7 @@ def save(self, commit=True): send_mail("Your new parabolaweb account", template.render(ctx), - 'Parabola <dev@list.parabolagnulinux.org>', + 'Parabola <dev@lists.parabolagnulinux.org>', [user.email], fail_silently=False) diff --git a/settings.py b/settings.py index cb17c96c..e1fc45d5 100644 --- a/settings.py +++ b/settings.py @@ -13,7 +13,7 @@ MANAGERS = ADMINS # Package out-of-date emails for orphans -NOTIFICATIONS = ['packages@list.parabolagnulinux.org'] +NOTIFICATIONS = ['dev@lists.parabolagnulinux.org'] # Full path to the data directory DEPLOY_PATH = os.path.dirname(os.path.realpath(__file__)) diff --git a/templates/base.html b/templates/base.html index ca492281..b537c603 100644 --- a/templates/base.html +++ b/templates/base.html @@ -39,7 +39,7 @@ <li><a href="/packages/differences/" title="Package architecture differences">Architecture Differences</a></li> <li><a - href="http://list.parabolagnulinux.org/pipermail/dev-parabolagnulinux.org/" + href="http://lists.parabolagnulinux.org/pipermail/dev/" title="dev mailing list archives">Archives</a></li> <li><a href="/devel/clock/" title="Developer world clocks">Dev Clocks</a></li> {% if user.is_staff %} diff --git a/templates/packages/flaghelp.html b/templates/packages/flaghelp.html index e33ba0f5..d60018fa 100644 --- a/templates/packages/flaghelp.html +++ b/templates/packages/flaghelp.html @@ -25,7 +25,7 @@ <h3>Flagging Packages</h3> <p>The message box portion of the flag utility is optional, and meant for short messages only. If you need more than 200 characters for your message, then file a bug report, email the maintainer directly, or send - an email to the <a target="_blank" href="http://list.parabolagnulinux.org/listinfo.cgi/dev-parabolagnulinux.org" + an email to the <a target="_blank" href="https://lists.parabolagnulinux.org/mailman/listinfo/dev" title="Visit the parabola dev mailing list">parabola mailing list</a> with your additional text.</p> diff --git a/templates/public/art.html b/templates/public/art.html index 68179f23..3a92b8b4 100644 --- a/templates/public/art.html +++ b/templates/public/art.html @@ -10,7 +10,7 @@ <h2>Parabola Logos and Artwork</h2> <p>You can help by creating artwork for Parabola GNU/Linux-libre.</p> - <p>Send your designs to web@list.parabolagnulinux.org and state they are CC-by-sa + <p>Send your designs to dev@lists.parabolagnulinux.org and state they are CC-by-sa or another free culture friendly license.</p> diff --git a/templates/public/download.html b/templates/public/download.html index 7a1cd855..207414dc 100644 --- a/templates/public/download.html +++ b/templates/public/download.html @@ -23,7 +23,7 @@ <h3>Release Info</h3> <li><strong>Resources:</strong> <ul> <li><a - href="http://list.parabolagnulinux.org/listinfo.cgi/dev-parabolagnulinux.org" + href="https://lists.parabolagnulinux.org/mailman/listinfo/dev" title="Parabola Hackers Discussion List">Mailing List</a></li> </ul> </li> diff --git a/templates/public/feeds.html b/templates/public/feeds.html index 79e8a1aa..da70e6ee 100644 --- a/templates/public/feeds.html +++ b/templates/public/feeds.html @@ -17,7 +17,7 @@ <h3>News and Activity Feeds</h3> the Parabola staff.</p> <p>The <a - href="http://wiki.parabolagnulinux.org/feed.php" + href="https://wiki.parabolagnulinux.org/index.php?title=Special:RecentChanges&feed=atom" title="ParabolaWiki Recent Changes feed" class="rss">Parabola Wiki: Recent changes feed</a> is also available to track document changes from the <a href="http://wiki.parabolagnulinux.org/" title="Parabola Wiki community diff --git a/templates/public/index.html b/templates/public/index.html index 3805b997..044b586f 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -123,9 +123,9 @@ <h4>Documentation</h4> <h4>Community</h4> <ul> - <li><a href="http://list.parabolagnulinux.org/listinfo.cgi" + <li><a href="http://lists.parabolagnulinux.org/" title="Community and developer mailing lists">Mailing Lists</a></li> - <li><a href="http://list.parabolagnulinux.org/pipermail/dev-parabolagnulinux.org/" + <li><a href="https://lists.parabolagnulinux.org/pipermail/dev/" title="dev mailing list archives">Dev Archives</a></li> <li><a href="http://wiki.parabolagnulinux.org/IRC_Channels" title="Official and regional IRC communities">IRC Channels</a></li> diff --git a/todolists/views.py b/todolists/views.py index 43763545..233102cf 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -161,7 +161,7 @@ def send_todolist_emails(todo_list, new_packages): template = loader.get_template('todolists/email_notification.txt') send_mail('Packages added to todo list \'%s\'' % todo_list.name, template.render(ctx), - 'Parabola <packages@list.parabolagnulinux.org>', + 'Parabola <dev@lists.parabolagnulinux.org>', [maint], fail_silently=True) -- cgit v1.2.3-54-g00ecf From a10b6d884f4f102f5216f4b341f35bb341cee176 Mon Sep 17 00:00:00 2001 From: Luke Shumaker <LukeShu@sbcglobal.net> Date: Thu, 1 Dec 2011 23:55:27 -0500 Subject: Normalize the URI scheme used for inbound links. Don't use one when possible, else use https --- README | 2 +- packages/templatetags/package_extras.py | 8 ++++---- public/views.py | 2 +- settings.py | 2 +- templates/base.html | 12 ++++++------ templates/packages/flag.html | 2 +- templates/packages/flaghelp.html | 4 ++-- templates/packages/search.html | 2 +- templates/public/about.html | 2 +- templates/public/donate.html | 2 +- templates/public/download.html | 16 ++++++++-------- templates/public/feeds.html | 4 ++-- templates/public/https.html | 5 ++--- templates/public/index.html | 18 +++++++++--------- templates/public/svn.html | 2 +- 15 files changed, 41 insertions(+), 42 deletions(-) (limited to 'templates') diff --git a/README b/README index 0e9d19af..acd8b8f9 100644 --- a/README +++ b/README @@ -94,7 +94,7 @@ for your install. 10. To optionally populate the database with real data: - $ wget http://repo.parabolagnulinux.org/core/os/i686/core.db.tar.gz + $ wget https://repo.parabolagnulinux.org/core/os/i686/core.db.tar.gz $ ./manage.py reporead i686 core.db.tar.gz $ ./manage.py syncisos diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 01d9afd6..c8c88ca7 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -74,7 +74,7 @@ def userpkgs(user): @register.simple_tag def get_wiki_link(package): - url = "https://wiki.parabolagnulinux.org/index.php" + url = "//wiki.parabolagnulinux.org/index.php" data = { 'title': "Special:Search", 'search': package.pkgname, @@ -92,7 +92,7 @@ def svn_trunk(package): @register.simple_tag def bugs_list(package): - url = "https://bugs.parabolagnulinux.org/bugs/issue?" + url = "//bugs.parabolagnulinux.org/bugs/issue?" data = { '@action': 'search', 'title': package.pkgname, @@ -101,7 +101,7 @@ def bugs_list(package): @register.simple_tag def bug_report(package): - url = "https://bugs.parabolagnulinux.org/bugs/issue?" + url = "//bugs.parabolagnulinux.org/bugs/issue?" data = { '@template': 'item', 'keyword': 'packages', @@ -118,5 +118,5 @@ def flag_unfree(package): 'priority': 'critical', 'title': '[%s] Please put your reasons here (register first if you haven\'t)' % package.pkgname, } - return "https://bugs.parabolagnulinux.org/bugs/issue?%s" % urlencode(data) + return "//bugs.parabolagnulinux.org/bugs/issue?%s" % urlencode(data) # vim: set ts=4 sw=4 et: diff --git a/public/views.py b/public/views.py index bb9cd454..43b46b12 100644 --- a/public/views.py +++ b/public/views.py @@ -52,7 +52,7 @@ def donate(request): return direct_to_template(request, 'public/donate.html', context) def download(request): - return redirect('http://wiki.parabolagnulinux.org/get', permanent=True) + return redirect('//wiki.parabolagnulinux.org/get', permanent=True) def feeds(request): context = { diff --git a/settings.py b/settings.py index e1fc45d5..ed12bbec 100644 --- a/settings.py +++ b/settings.py @@ -132,6 +132,6 @@ INSTALLED_APPS = list(INSTALLED_APPS) + [ 'debug_toolbar' ] # URL to fetch a current list of available ISOs -ISO_LIST_URL = 'http://repo.parabolagnulinux.org/isos/' +ISO_LIST_URL = 'https://repo.parabolagnulinux.org/isos/' # vim: set ts=4 sw=4 et: diff --git a/templates/base.html b/templates/base.html index b537c603..746c6cf4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -19,10 +19,10 @@ <ul id="archnavbarlist"> <li id="anb-home"><a href="/" title="Parabola news, packages, projects and more">Home</a></li> <li id="anb-packages"><a href="/packages/" title="Package Database">Packages</a></li> - <li id="anb-wiki"><a href="http://wiki.parabolagnulinux.org" title="Community documentation">Wiki</a></li> - <li id="anb-bugs"><a href="https://bugs.parabolagnulinux.org" title="Issue Tracker">Bugs</a></li> - <li id="anb-projects"><a href="https://projects.parabolagnulinux.org" title="Our Code">Projects</a></li> - <li id="anb-download"><a href="http://wiki.parabolagnulinux.org/Download" title="Get Parabola">Download</a></li> + <li id="anb-wiki"><a href="//wiki.parabolagnulinux.org" title="Community documentation">Wiki</a></li> + <li id="anb-bugs"><a href="//bugs.parabolagnulinux.org" title="Issue Tracker">Bugs</a></li> + <li id="anb-projects"><a href="//projects.parabolagnulinux.org" title="Our Code">Projects</a></li> + <li id="anb-download"><a href="//wiki.parabolagnulinux.org/Download" title="Get Parabola">Download</a></li> </ul> </div> </div><!-- #archnavbar --> @@ -32,14 +32,14 @@ {% if user.is_authenticated %} <ul> <li><a href="/devel/" title="Developer Dashboard">Dashboard</a></li> - <li><a href="https://projects.parabolagnulinux.org/" title="Git Projects">Projects</a></li> + <li><a href="//projects.parabolagnulinux.org/" title="Git Projects">Projects</a></li> <li><a href="{% url news-list as newsl %}{{ newsl }}" title="Manage news articles">News</a></li> <li><a href="/packages/signoffs/" title="Package signoffs">Signoffs</a></li> <li><a href="/todo/" title="Developer todo lists">Todos</a></li> <li><a href="/packages/differences/" title="Package architecture differences">Architecture Differences</a></li> <li><a - href="http://lists.parabolagnulinux.org/pipermail/dev/" + href="//lists.parabolagnulinux.org/pipermail/dev/" title="dev mailing list archives">Archives</a></li> <li><a href="/devel/clock/" title="Developer world clocks">Dev Clocks</a></li> {% if user.is_staff %} diff --git a/templates/packages/flag.html b/templates/packages/flag.html index 4bb23b85..ea199618 100644 --- a/templates/packages/flag.html +++ b/templates/packages/flag.html @@ -29,7 +29,7 @@ <h2>Flag Package: {{ package.pkgname }} {{ package.full_version }} ({{ package.a <p><strong>Note:</strong> Do <em>not</em> use this facility if the package is broken! The package will be unflagged and the report will be ignored! - <a href="https://bugs.parabolagnulinux.org/" title="Parabola Bugtracker">Use the + <a href="//bugs.parabolagnulinux.org/" title="Parabola Bugtracker">Use the bugtracker to file a bug</a> instead.</p> <p>Please confirm your flag request for {{package.pkgname}}:</p> diff --git a/templates/packages/flaghelp.html b/templates/packages/flaghelp.html index d60018fa..eac13f83 100644 --- a/templates/packages/flaghelp.html +++ b/templates/packages/flaghelp.html @@ -25,12 +25,12 @@ <h3>Flagging Packages</h3> <p>The message box portion of the flag utility is optional, and meant for short messages only. If you need more than 200 characters for your message, then file a bug report, email the maintainer directly, or send - an email to the <a target="_blank" href="https://lists.parabolagnulinux.org/mailman/listinfo/dev" + an email to the <a target="_blank" href="//lists.parabolagnulinux.org/mailman/listinfo/dev" title="Visit the parabola dev mailing list">parabola mailing list</a> with your additional text.</p> <p><strong>Note:</strong> Please do <em>not</em> use this facility if the - package is broken! Use the <a target="_blank" href="https://bugs.parabolagnulinux.org" + package is broken! Use the <a target="_blank" href="//bugs.parabolagnulinux.org" title="Parabola Bugtracker">bugtracker</a> instead.</p> </body> diff --git a/templates/packages/search.html b/templates/packages/search.html index 4a61298e..bb5c1c8b 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -165,7 +165,7 @@ <h3>Package Search</h3> <p>You are browsing the Parabola package database. From here you can find detailed information about packages located in the official supported repositories. If you need the sourceball from where a package is built, you can look at our <a - href='http://repo.parabolagnulinux.org/sources/packages' + href='//repo.parabolagnulinux.org/sources/packages' title='Sourceballed packages'>sources repo</a>.</p> </div> <script type="text/javascript" src="/jsi18n/"></script> diff --git a/templates/public/about.html b/templates/public/about.html index a01a33fe..099d5513 100644 --- a/templates/public/about.html +++ b/templates/public/about.html @@ -53,7 +53,7 @@ <h3>Participate</h3> <li>Host repositories. Mirrors are not abundant.</li> - <li>Take a look at our <a href="http://wiki.parabolagnulinux.org/TODO" title="TODO">TODO list</a></li> + <li>Take a look at our <a href="//wiki.parabolagnulinux.org/TODO" title="TODO">TODO list</a></li> </ul> </div> diff --git a/templates/public/donate.html b/templates/public/donate.html index ef7f252d..c6e055f5 100644 --- a/templates/public/donate.html +++ b/templates/public/donate.html @@ -18,7 +18,7 @@ <h3>We don't accept any money donations</h3> anything, because we are a really small community of hackers.</p> <p>If you want, we have a pretty nice <a - href='http://wiki.parabolagnulinux.org/TODO' title='The TODO + href='//wiki.parabolagnulinux.org/TODO' title='The TODO list!'>TODO list</a> you can check to help us by donating some of your time. That will be very much appreciated by us :)</p> diff --git a/templates/public/download.html b/templates/public/download.html index 207414dc..2e1024b0 100644 --- a/templates/public/download.html +++ b/templates/public/download.html @@ -23,14 +23,14 @@ <h3>Release Info</h3> <li><strong>Resources:</strong> <ul> <li><a - href="https://lists.parabolagnulinux.org/mailman/listinfo/dev" + href="//lists.parabolagnulinux.org/mailman/listinfo/dev" title="Parabola Hackers Discussion List">Mailing List</a></li> </ul> </li> <li><strong>Instructions:</strong> <ul> <li><a - href="http://wiki.parabolagnulinux.org/installation_guide" + href="//wiki.parabolagnulinux.org/installation_guide" title="Official Installation Guide">Parabola Install Guide</a>. </li> </ul> @@ -42,7 +42,7 @@ <h3>Existing Arch Users</h3> <p>If you are an Arch user, there is no need to download the ISO to update your existing system to Parabola. You can just follow the instructions in our wiki to convert your existing Arch system into a free - as in freedom one. <a href='http://wiki.parabolagnulinux.org/migration' + as in freedom one. <a href='//wiki.parabolagnulinux.org/migration' title='Migration Guide'>More here.</a></p> <h3>BitTorrent Download (recommended)</h3> @@ -68,12 +68,12 @@ <h3>BitTorrent Download (recommended)</h3> </td> <td class="cpu-arch"> - <a href="http://repo.parabolagnulinux.org/isos/i686/parabola-{{version}}-netinstall-i686.iso.torrent" + <a href="//repo.parabolagnulinux.org/isos/i686/parabola-{{version}}-netinstall-i686.iso.torrent" title="Download for i686 architecture">Download</a> </td> <td class="cpu-arch"> - <a href="http://repo.parabolagnulinux.org/isos/x86_64/parabola-{{version}}-netinstall-x86_64.iso.torrent" + <a href="//repo.parabolagnulinux.org/isos/x86_64/parabola-{{version}}-netinstall-x86_64.iso.torrent" title="Download for x86-64 architecture">Download</a> </td> @@ -94,10 +94,10 @@ <h3>BitTorrent Download (recommended)</h3> <td> Core Image </td><td class="cpu-arch"> - <a href="http://repo.parabolagnulinux.org/isos/i686/parabola-{{version}}-core-i686.iso.torrent" + <a href="//repo.parabolagnulinux.org/isos/i686/parabola-{{version}}-core-i686.iso.torrent" title="Download for i686 architecture">Download</a> </td><td class="cpu-arch"> - <a href="http://repo.parabolagnulinux.org/isos/x86_64/parabola-{{version}}-core-x86_64.iso.torrent" + <a href="//repo.parabolagnulinux.org/isos/x86_64/parabola-{{version}}-core-x86_64.iso.torrent" title="Download for x86-64 architecture">Download</a> </td><td class="magnet-link"> <a href="magnet:?xt=urn:btih:d9bb9f9641a222d2d302988da95225f570bcdb6d&dn=parabola-2010.12.29-core-i686.iso&tr=http%3A%2F%2Ftracker.publicbt.com%2Fannounce" @@ -119,7 +119,7 @@ <h3>HTTP/FTP Direct Downloads</h3> image matches the checksum from the MD5SUMS or SHA256SUMS file in the same directory as the image.</p> - <p><a href='http://repo.parabolagnulinux.org/isos/' title='Parabola ISOs + <p><a href='//repo.parabolagnulinux.org/isos/' title='Parabola ISOs directory'>Go to the Parabola ISOs directory.</a></p> {%endwith%} diff --git a/templates/public/feeds.html b/templates/public/feeds.html index da70e6ee..69789150 100644 --- a/templates/public/feeds.html +++ b/templates/public/feeds.html @@ -17,10 +17,10 @@ <h3>News and Activity Feeds</h3> the Parabola staff.</p> <p>The <a - href="https://wiki.parabolagnulinux.org/index.php?title=Special:RecentChanges&feed=atom" + href="//wiki.parabolagnulinux.org/index.php?title=Special:RecentChanges&feed=atom" title="ParabolaWiki Recent Changes feed" class="rss">Parabola Wiki: Recent changes feed</a> is also available to track document changes from the - <a href="http://wiki.parabolagnulinux.org/" title="Parabola Wiki community + <a href="//wiki.parabolagnulinux.org/" title="Parabola Wiki community documentation">Parabola Wiki</a>.</p> <h3>Package Feeds</h3> diff --git a/templates/public/https.html b/templates/public/https.html index 7cfe44e9..e53dc8e9 100644 --- a/templates/public/https.html +++ b/templates/public/https.html @@ -19,9 +19,8 @@ <h2 class="title">Parabola GNU/Linux-libre</h2> <h3>I just want to get the ISOs</h3> <p>You can proceed to our <a - href="http://wiki.parabolagnulinux.org/get">ISOs download page</a> on <a - href="http://wiki.parabolagnulinux.org/">our wiki</a> (which isn't secured - yet, sadly).</p> + href="https://wiki.parabolagnulinux.org/get">ISOs download page</a> on <a + href="https://wiki.parabolagnulinux.org/">our wiki</a>.</p> <h3>I want to do this the right way</h3> diff --git a/templates/public/index.html b/templates/public/index.html index 044b586f..188c572f 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -112,22 +112,22 @@ <h3>Recent Updates <span class="more">(<a href="/packages/?sort=-last_update" <h4>Documentation</h4> <ul> - <li><a href="http://wiki.parabolagnulinux.org/" + <li><a href="//wiki.parabolagnulinux.org/" title="Community documentation">Wiki</a></li> - <li><a href="http://wiki.parabolagnulinux.org/installation_guide" + <li><a href="//wiki.parabolagnulinux.org/installation_guide" title="Parabola Installation Guide">Official Parabola Installation Guide</a></li> - <li><a href="http://wiki.parabolagnulinux.org/Migration" + <li><a href="//wiki.parabolagnulinux.org/Migration" title="Free your Arch instalation">Migration from Archlinux</a></li> </ul> <h4>Community</h4> <ul> - <li><a href="http://lists.parabolagnulinux.org/" + <li><a href="//lists.parabolagnulinux.org/" title="Community and developer mailing lists">Mailing Lists</a></li> - <li><a href="https://lists.parabolagnulinux.org/pipermail/dev/" + <li><a href="//lists.parabolagnulinux.org/pipermail/dev/" title="dev mailing list archives">Dev Archives</a></li> - <li><a href="http://wiki.parabolagnulinux.org/IRC_Channels" + <li><a href="//wiki.parabolagnulinux.org/IRC_Channels" title="Official and regional IRC communities">IRC Channels</a></li> <li><a href="http://identi.ca/group/parabola" title="Parabola at identi.ca">Identi.ca group</a></li> </ul> @@ -152,9 +152,9 @@ <h4>Development</h4> title="View/search the package repository database">Packages</a></li> <li><a href="/groups/" title="View the available package groups">Package Groups</a></li> - <li><a href="https://projects.parabolagnulinux.org" + <li><a href="//projects.parabolagnulinux.org" title="Official Parabola projects (git)">Projects in Git</a></li> - <li><a href="https://bugs.parabolagnulinux.org/" + <li><a href="//bugs.parabolagnulinux.org/" title="Parabola's Issue Tracker">Issue Tracker</a></li> <li><a href="/todolists/" title="Hacker Todo Lists">Todo Lists</a></li> @@ -166,7 +166,7 @@ <h4>About</h4> <li><a href="{% url page-about %}" title="Learn more about Parabola">About Parabola</a></li> <li><a href="/download/" title="Get Parabola">Download Parabola</a></li> - <li><a href="http://wiki.parabolagnulinux.org/Media" + <li><a href="//wiki.parabolagnulinux.org/Media" title="Parabola in the media">Media Appearances</a></li> <li><a href="{% url page-art %}" title="Parabola logos and other artwork for promotional use">Logos & Artwork</a></li> <li><a href="{% url news-list %}" title="News Archives">News Archives</a></li> diff --git a/templates/public/svn.html b/templates/public/svn.html index 80367eaf..4321f7c2 100644 --- a/templates/public/svn.html +++ b/templates/public/svn.html @@ -4,7 +4,7 @@ <div class="box"> <h2 class="title">SVN Repositories</h2> <p>Parabola doesn't use any SVN repositories. But you can find our <a - href="https://projects.parabolagnulinux.org" title="Projects + href="//projects.parabolagnulinux.org" title="Projects page">Projects</a> on git! </p> -- cgit v1.2.3-54-g00ecf From d265eb8b328fc58879618d20177967c51fde383e Mon Sep 17 00:00:00 2001 From: Luke Shumaker <LukeShu@sbcglobal.net> Date: Fri, 2 Dec 2011 00:13:47 -0500 Subject: These for references to arch slipped through. --- packages/management/commands/signoff_report.py | 2 +- packages/views/flag.py | 2 +- releng/views.py | 2 +- templates/packages/flag.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index 3b67f518..f822c8ad 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -119,7 +119,7 @@ def generate_report(email, repo_name): 'old_days': old_days, 'leaders': leaders, }) - from_addr = 'Arch Website Notification <nobody@archlinux.org>' + from_addr = 'Parabola Website Notification <nobody@parabolagnulinux.org>' send_mail(subject, t.render(c), from_addr, [email]) # vim: set ts=4 sw=4 et: diff --git a/packages/views/flag.py b/packages/views/flag.py index 7e9d87c7..5db2ea69 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -71,7 +71,7 @@ def flag(request, name, repo, arch): }) send_mail(subject, tmpl.render(ctx), - 'Arch Website Notification <nobody@archlinux.org>', + 'Parabola Website Notification <nobody@parabolagnulinux.org>', toemail, fail_silently=True) diff --git a/releng/views.py b/releng/views.py index 2b3d0936..e17a6e9c 100644 --- a/releng/views.py +++ b/releng/views.py @@ -42,7 +42,7 @@ class TestForm(forms.ModelForm): success = forms.BooleanField( help_text="Only check this if everything went fine. " \ "If you ran into problems please create a ticket on <a " \ - "href=\"https://bugs.archlinux.org/index.php?project=6\">the " \ + "href=\"//bugs.parabolagnulinux.org/\">the " \ "bugtracker</a> (or check that one already exists) and link to " \ "it in the comments.", required=False) diff --git a/templates/packages/flag.html b/templates/packages/flag.html index ea199618..bb6b274f 100644 --- a/templates/packages/flag.html +++ b/templates/packages/flag.html @@ -23,8 +23,8 @@ <h2>Flag Package: {{ package.pkgname }} {{ package.full_version }} ({{ package.a <p>The message box portion of the flag utility is optional, and meant for short messages only. If you need more than 200 characters for your message, then file a bug report, email the maintainer directly, or send - an email to the <a href="http://mailman.archlinux.org/mailman/listinfo/arch-general" - title="Visit the arch-general mailing list">arch-general mailing list</a> + an email to the <a href="//lists.parabolagnulinux.org/mailman/listinfo/dev" + title="Visit the dev mailing list">Parabola Development mailing list</a> with your additional text.</p> <p><strong>Note:</strong> Do <em>not</em> use this facility if the -- cgit v1.2.3-54-g00ecf From 8ceb83e52897c1c0bccc6322cffb0e864664afd1 Mon Sep 17 00:00:00 2001 From: Johannes Krampf <johannes.krampf@gmail.com> Date: Fri, 2 Dec 2011 19:46:36 +0100 Subject: Fix download link. Solution looks a bit unclean to me. --- packages/templatetags/package_extras.py | 12 ++++++++++++ templates/packages/details.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index bcbda210..c31990d7 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -72,6 +72,18 @@ def userpkgs(user): ) return '' +@register.simple_tag +def get_download_link(package): + parts = { + "repo": package.repo.name.lower(), + "arch": package.arch.name, + "pkgfile": package.filename + } + if parts["arch"] == "any": + parts["arch"] = "i686" + linkbase = "https://repo.parabolagnulinux.org/%(repo)s/os/%(arch)s/%(pkgfile)s" + return linkbase % parts + @register.simple_tag def get_wiki_link(package): url = "https://wiki.parabolagnulinux.org/index.php" diff --git a/templates/packages/details.html b/templates/packages/details.html index ef501c83..4570627f 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -39,7 +39,7 @@ <h4>Package Actions</h4> onclick="return !window.open('/packages/flaghelp/','FlagHelp', 'height=350,width=450,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no');">(?)</a></li> {% endif %} - <li><a href="download/" rel="nofollow" title="Download {{ pkg.pkgname }} from mirror">Download From Mirror</a></li> + <li><a href="{% get_download_link pkg %}" rel="nofollow" title="Download {{ pkg.pkgname }} from mirror">Download From Mirror</a></li> </ul> {% if perms.main.change_package %} -- cgit v1.2.3-54-g00ecf From 183c4d9cefa95f46c3fa3a6936f837542426eac2 Mon Sep 17 00:00:00 2001 From: Johannes Krampf <johannes.krampf@gmail.com> Date: Sat, 3 Dec 2011 14:44:42 +0100 Subject: Allow architecure selection for difference view --- packages/views/__init__.py | 5 +++-- templates/packages/differences.html | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/packages/views/__init__.py b/packages/views/__init__.py index e3264161..bbfe7c9f 100644 --- a/packages/views/__init__.py +++ b/packages/views/__init__.py @@ -226,13 +226,14 @@ def download(request, name, repo, arch): def arch_differences(request): # TODO: we have some hardcoded magic here with respect to the arches. - arch_a = Arch.objects.get(name='i686') - arch_b = Arch.objects.get(name='x86_64') + arch_a = Arch.objects.get(name=request.GET.get('arch_a', 'i686')) + arch_b = Arch.objects.get(name=request.GET.get('arch_b', 'x86_64')) differences = get_differences_info(arch_a, arch_b) context = { 'arch_a': arch_a, 'arch_b': arch_b, 'differences': differences, + 'arches': Arch.objects.filter(agnostic=False) } return direct_to_template(request, 'packages/differences.html', context) diff --git a/templates/packages/differences.html b/templates/packages/differences.html index d9b5f088..0412f8c2 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -6,6 +6,35 @@ {% if differences %} <div id="differences-filter" class="box filter-criteria"> <h2>Package Differences by Architecture</h2> + <h3>Select architectures</h3> + <form id="arch_selector" method="get" action="."> + <fieldset> + <legend>Select arches</legend> + <div><label for="arch_a" title="Architecture A">Architecture A</label> + <select name="arch_a" id="arch_a"> + {% for arch in arches %} + <option + {% if arch == arch_a %} + selected="selected" + {% endif %} + >{{ arch }}</option> + {% endfor %} + </select> + </div> + <div><label for="arch_b" title="Architecture B">Architecture B</label> + <select name="arch_b" id="arch_b"> + {% for arch in arches %} + <option + {% if arch == arch_b %} + selected="selected" + {% endif %} + >{{ arch }}</option> + {% endfor %} + </select> + </div> + <div><label> </label><input type="submit" title="Show difference between selected architectures"></div> + </fieldset> + </form> <h3>Filter Differences View</h3> <form id="diff_filter" method="post" action="."> <fieldset> -- cgit v1.2.3-54-g00ecf