From 8af4d27cd67157b4f53286913d886d8896f7010a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 27 Jan 2014 13:17:49 -0600 Subject: Fix linebreak issues in preformatted code blocks In text blocks that have preformatted code, such as news items, we don't handle the overflow case very well. Let the browser do the job and wrap things if absolutely required. Fixes FS#35649. Signed-off-by: Dan McGee --- sitestatic/archweb.css | 1 + 1 file changed, 1 insertion(+) (limited to 'sitestatic') diff --git a/sitestatic/archweb.css b/sitestatic/archweb.css index b7d6e1ee..53fa6274 100644 --- a/sitestatic/archweb.css +++ b/sitestatic/archweb.css @@ -79,6 +79,7 @@ pre { pre code { display: block; background: none; + overflow: auto; } blockquote { -- cgit v1.2.3-54-g00ecf From 81a2051e346bb41fb9756695566f735d5035bfd8 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 9 Mar 2014 11:12:40 -0500 Subject: Allow filesize sorter to match   character This gets the sorter working correctly again on the developer reports pages where we show file sizes. Apparently the Django filesizeformat tag now uses non-breaking spaces. Signed-off-by: Dan McGee --- sitestatic/archweb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sitestatic') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 800c5add..209d6f67 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -103,7 +103,7 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { $.tablesorter.addParser({ id: 'filesize', - re: /^(\d+(?:\.\d+)?) (bytes?|[KMGTPEZY]i?B)$/, + re: /^(\d+(?:\.\d+)?)[ \u00a0](bytes?|[KMGTPEZY]i?B)$/, is: function(s) { return this.re.test(s); }, -- cgit v1.2.3-54-g00ecf From 2e06e74d3a2a09cbb2a2521cdd55d6543cb56674 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 9 Mar 2014 11:40:58 -0500 Subject: Use localStorage to save/restore signoffs filters Signed-off-by: Dan McGee --- sitestatic/archweb.js | 18 ++++++++++++++++++ templates/packages/signoffs.html | 1 + 2 files changed, 19 insertions(+) (limited to 'sitestatic') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 209d6f67..8212e85b 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -444,6 +444,7 @@ function filter_signoffs() { $('#filter-count').text(rows.length); /* make sure we update the odd/even styling from sorting */ $('.results').trigger('applyWidgets', [false]); + filter_signoffs_save(); } function filter_signoffs_reset() { $('#signoffs_filter .arch_filter').attr('checked', 'checked'); @@ -451,6 +452,23 @@ function filter_signoffs_reset() { $('#id_pending').removeAttr('checked'); filter_signoffs(); } +function filter_signoffs_save() { + var state = $('#signoffs_filter').serializeArray(); + localStorage['filter_signoffs'] = JSON.stringify(state); +} +function filter_signoffs_load() { + var state = localStorage['filter_signoffs']; + if (!state) + return; + state = JSON.parse(state); + $('#signoffs_filter .arch_filter').removeAttr('checked'); + $('#signoffs_filter .repo_filter').removeAttr('checked'); + $('#id_pending').removeAttr('checked'); + $.each(state, function (i, v) { + // this assumes our only filters are checkboxes + $('#signoffs_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); + }); +} function collapseNotes(elements) { // Remove any trailing
tags from the note contents diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 83f81d39..1c133f15 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -93,6 +93,7 @@

Filter Displayed Signoffs

$('#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_load(); filter_signoffs(); }); $(document).ready(function() { -- cgit v1.2.3-54-g00ecf From 697a2b15c1e402c1c624af1ffeaf5123d7fb0e9f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 9 Mar 2014 11:49:22 -0500 Subject: Use localStorage to save/restore todolist filters Signed-off-by: Dan McGee --- sitestatic/archweb.js | 19 +++++++++++++++++++ templates/todolists/view.html | 6 +++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'sitestatic') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 8212e85b..457e334c 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -367,6 +367,25 @@ function filter_pkgs_reset(callback) { callback(); } +function filter_todolist_save(list_id) { + var state = $('#todolist_filter').serializeArray(); + localStorage['filter_todolist_' + list_id] = JSON.stringify(state); +} +function filter_todolist_load(list_id) { + var state = localStorage['filter_todolist_' + list_id]; + if (!state) + return; + state = JSON.parse(state); + $('#todolist_filter .arch_filter').removeAttr('checked'); + $('#todolist_filter .repo_filter').removeAttr('checked'); + $('#id_incomplete').removeAttr('checked'); + $('#id_mine_only').removeAttr('checked'); + $.each(state, function (i, v) { + // this assumes our only filters are checkboxes + $('#todolist_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); + }); +} + /* signoffs.html */ function signoff_package() { // TODO: fix usage of this diff --git a/templates/todolists/view.html b/templates/todolists/view.html index a3ee5479..0045390c 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -118,10 +118,14 @@

Filter Todo List Packages

}); $(document).ready(function() { $('a.status-link').click(todolist_flag); - var filter_func = function() { filter_pkgs_list('#todolist_filter', '#dev-todo-pkglist tbody'); }; + var filter_func = function() { + filter_pkgs_list('#todolist_filter', '#dev-todo-pkglist tbody'); + filter_todolist_save({{ list.id }}); + }; $('#todolist_filter input').change(filter_func); $('#criteria_reset').click(function() { filter_pkgs_reset(filter_func); }); // fire function on page load to ensure the current form selections take effect + filter_todolist_load({{ list.id }}); filter_func(); }); -- cgit v1.2.3-54-g00ecf From 268317dd331bcdbe1c2828583034c0274a19eea3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 9 Mar 2014 11:58:51 -0500 Subject: Use localStorage to save/restore developer report filters Signed-off-by: Dan McGee --- devel/views.py | 1 + sitestatic/archweb.js | 16 ++++++++++++++++ templates/devel/packages.html | 6 +++++- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'sitestatic') diff --git a/devel/views.py b/devel/views.py index c53da668..972d0abb 100644 --- a/devel/views.py +++ b/devel/views.py @@ -201,6 +201,7 @@ def report(request, report_name, username=None): context = { 'all_maintainers': maints, 'title': report.description, + 'report': report, 'maintainer': user, 'packages': report.packages(packages, username), 'arches': sorted(arches), diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 457e334c..0a979494 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -386,6 +386,22 @@ function filter_todolist_load(list_id) { }); } +function filter_report_save(report_id) { + var state = $('#report_filter').serializeArray(); + localStorage['filter_report_' + report_id] = JSON.stringify(state); +} +function filter_report_load(report_id) { + var state = localStorage['filter_report_' + report_id]; + if (!state) + return; + state = JSON.parse(state); + $('#report_filter input[type="checkbox"]').removeAttr('checked') + $.each(state, function (i, v) { + // this assumes our only filters are checkboxes + $('#report_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); + }); +} + /* signoffs.html */ function signoff_package() { // TODO: fix usage of this diff --git a/templates/devel/packages.html b/templates/devel/packages.html index 74aebf20..c190ab08 100644 --- a/templates/devel/packages.html +++ b/templates/devel/packages.html @@ -84,10 +84,14 @@

Filter Packages

$(".results").tablesorter({widgets: ['zebra']}); }); $(document).ready(function() { - var filter_func = function() { filter_pkgs_list('#report_filter', '#dev-report-results tbody'); }; + var filter_func = function() { + filter_pkgs_list('#report_filter', '#dev-report-results tbody'); + filter_report_save('{{ report.slug }}'); + }; $('#report_filter input').change(filter_func); $('#criteria_reset').click(function() { filter_pkgs_reset(filter_func); }); // run on page load to ensure current form selections take effect + filter_report_load('{{ report.slug }}'); filter_func(); }); -- cgit v1.2.3-54-g00ecf From 3f1ca4da2a0e29850eadec7a8d69444081da099c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 9 Mar 2014 12:02:00 -0500 Subject: Simplify filter reload code Signed-off-by: Dan McGee --- sitestatic/archweb.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sitestatic') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 0a979494..0c4059a9 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -376,10 +376,7 @@ function filter_todolist_load(list_id) { if (!state) return; state = JSON.parse(state); - $('#todolist_filter .arch_filter').removeAttr('checked'); - $('#todolist_filter .repo_filter').removeAttr('checked'); - $('#id_incomplete').removeAttr('checked'); - $('#id_mine_only').removeAttr('checked'); + $('#todolist_filter input[type="checkbox"]').removeAttr('checked'); $.each(state, function (i, v) { // this assumes our only filters are checkboxes $('#todolist_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); @@ -395,7 +392,7 @@ function filter_report_load(report_id) { if (!state) return; state = JSON.parse(state); - $('#report_filter input[type="checkbox"]').removeAttr('checked') + $('#report_filter input[type="checkbox"]').removeAttr('checked'); $.each(state, function (i, v) { // this assumes our only filters are checkboxes $('#report_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); @@ -496,9 +493,7 @@ function filter_signoffs_load() { if (!state) return; state = JSON.parse(state); - $('#signoffs_filter .arch_filter').removeAttr('checked'); - $('#signoffs_filter .repo_filter').removeAttr('checked'); - $('#id_pending').removeAttr('checked'); + $('#signoffs_filter input[type="checkbox"]').removeAttr('checked'); $.each(state, function (i, v) { // this assumes our only filters are checkboxes $('#signoffs_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); -- cgit v1.2.3-54-g00ecf