From 0ecbc0e210c34fda64e9905f4b4a4b25d3e1149e Mon Sep 17 00:00:00 2001 From: "Brian D. Caruso" Date: Fri, 19 Apr 2019 11:38:00 -0400 Subject: [PATCH 01/29] Fixes an author list display bug Fixes 1902.05884 /abs page list of long authors showing '0 additional authors' Also fixes off by one bug in split_long_author_list() Adds some changes to legacy comparision tests. ARXIVNG-2085 --- browse/services/search/search_authors.py | 10 +++- .../ftp/arxiv/papers/1902/1902.05884.abs | 46 +++++++++++++++ .../legacy_comparison/abs_page_comparison.py | 36 +++++++----- tests/legacy_comparison/html_comparisons.py | 58 ++++++++++++------- tests/test_browse.py | 31 ++++++---- tests/test_search_authors.py | 36 ++++++++++-- 6 files changed, 165 insertions(+), 52 deletions(-) create mode 100644 tests/data/abs_files/ftp/arxiv/papers/1902/1902.05884.abs diff --git a/browse/services/search/search_authors.py b/browse/services/search/search_authors.py index da2b60b74..9fb21e885 100644 --- a/browse/services/search/search_authors.py +++ b/browse/services/search/search_authors.py @@ -49,7 +49,7 @@ def split_long_author_list( count = 0 back_count = 0 for item in authors: - if count > size: + if count >= size: back.append(item) if isinstance(item, tuple): back_count = back_count + 1 @@ -57,6 +57,14 @@ def split_long_author_list( front.append(item) if isinstance(item, tuple): count = count + 1 + + # handle case where back doesn't have much ARXIVNG-2083 + authors_in_back = len(list(filter(lambda x: isinstance(x, tuple), back))) + if authors_in_back < 2: + front = front + back + back = [] + back_count = 0 + return front, back, back_count diff --git a/tests/data/abs_files/ftp/arxiv/papers/1902/1902.05884.abs b/tests/data/abs_files/ftp/arxiv/papers/1902/1902.05884.abs new file mode 100644 index 000000000..e7d26ea87 --- /dev/null +++ b/tests/data/abs_files/ftp/arxiv/papers/1902/1902.05884.abs @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +\\ +arXiv:1902.05884 +From: Alberto Correa dos Reis +Date: Fri, 15 Feb 2019 16:48:58 GMT (980kb,D) + +Title: Dalitz plot analysis of the $D^+\to K^-K^+K^+$ decay +Authors: LHCb Collaboration: R. Aaij, B. Adeva, M. Adinolfi, Z. Ajaltouni, S. + Akar, J. Albrecht, F. Alessio, M. Alexander, A. Alfonso Albero, S. Ali, G. + Alkhazov, P. Alvarez Cartelle, A.A. Alves Jr, S. Amato, S. Amerio, Y. Amhis, + L. An, L. Anderlini, G. Andreassi, M. Andreotti, J.E. Andrews, R.B. Appleby, + F. Archilli, J. Arnau Romeu, A. Artamonov, M. Artuso, E. Aslanides, M. + Atzeni, G. Auriemma, M. Baalouch, I. Babuschkin, S. Bachmann, J.J. Back, A. + Badalov, C. Baesso, S. Baker, V. Balagura, W. Baldini, A. Baranov, R.J. + Barlow, C. Barschel, S. Barsuk, W. Barter, F. Baryshnikov, V. Batozskaya, V. + Battista, A. Bay, L. Beaucourt, J. Beddow, F. Bedeschi, I. Bediaga, A. + Beiter, L.J. Bel, N. Beliy, V. Bellee, N. Belloli, K. Belous, I. Belyaev, G. + Bencivenni, E. Ben-Haim, S. Benson, S. Beranek, A. Berezhnoy, R. Bernet, D. + Berninghoff, E. Bertholet, A. Bertolin, C. Betancourt, F. Betti, M.O. + Bettler, Ia. Bezshyiko, S. Bifani, P. Billoir, A. Birnkraut, A. Bizzeti, M. + Bj{\o}rn, T. Blake, F. Blanc, S. Blusk, V. Bocci, T. Boettcher, A. Bondar, N. + Bondar, I. Bordyuzhin, S. Borghi, M. Borisyak, M. Borsato, F. Bossu, M. + Boubdir, T.J.V. Bowcock, E. Bowen, C. Bozzi, S. Braun, J. Brodzicka, D. + Brundu, E. Buchanan, C. Burr, A. Bursche, J. Buytaert, W. Byczynski, (750 + additional authors not shown) +Categories: hep-ex +Comments: 37 pages, 14 figures. All figures and tables, along with any + supplementary material and additional information, are available at + https://cern.ch/lhcbproject/Publications/p/LHCb-PAPER-2018-039.html +Report-no: LHCb-PAPER-2018-039, CERN-EP-2018-336 +Journal-ref: Journal of High Energy Physics 04 (2019) 063 +DOI: 10.1007/JHEP04(2019)063 +License: http://creativecommons.org/licenses/by/4.0/ +\\ + The resonant structure of the doubly Cabibbo-suppressed decay $D^+ \to +K^-K^+K^+$ is studied for the first time. The measurement is based on a sample +of pp-collision data, collected at a centre-of-mass energy of 8 TeV with the +LHCb detector and corresponding to an integrated luminosity of 2 fb$^-1$. The +amplitude analysis of this decay is performed with the isobar model and a +phenomenological model based on an effective chiral Lagrangian. In both models +the S-wave component in the $K^-K^+$ system is dominant, with a small +contribution of the $\phi(1020)$ meson and a negligible contribution from +tensor resonances. The $K^-K^+$ scattering amplitudes for the considered +combinations of spin (0,1) and isospin (0,1) of the two-body system are +obtained from the Dalitz plot fit with the phenomenological decay amplitude. +\\ diff --git a/tests/legacy_comparison/abs_page_comparison.py b/tests/legacy_comparison/abs_page_comparison.py index c1a6ae417..d14a897c1 100644 --- a/tests/legacy_comparison/abs_page_comparison.py +++ b/tests/legacy_comparison/abs_page_comparison.py @@ -18,20 +18,20 @@ sys.path.append('') sys.setrecursionlimit(10000) -from tests.legacy_comparison.comparison_types import res_comparison_fn, \ +from comparison_types import res_comparison_fn, \ text_comparison_fn, html_comparison_fn, res_arg_dict, text_arg_dict, \ html_arg_dict, BadResult -from tests.legacy_comparison.html_comparisons import author_similarity, \ +from html_comparisons import author_similarity, \ dateline_similarity, history_similarity,\ title_similarity, subject_similarity, comments_similarity, \ head_similarity, extra_full_text_similarity, \ ancillary_similarity, extra_ref_cite_similarity, extra_general_similarity, \ dblp_similarity, bookmarks_similarity -from tests.legacy_comparison.response_comparisons import compare_status -from tests.legacy_comparison.text_comparisons import text_similarity +from response_comparisons import compare_status +from text_comparisons import text_similarity + from browse.services.document.metadata import AbsMetaSession -from tests import path_of_for_test """ Script to compare abs pages from NG and beta.arxiv.org @@ -59,7 +59,7 @@ logging.basicConfig(filename="abs_page_comparison.log", level=logging.DEBUG) -ABS_FILES = path_of_for_test('data/abs_files') +ABS_FILES = 'tests/data/abs_files' LOG_FILE_NAME = 'legacy_comparison.org' VISITED_ABS_FILE_NAME = 'visited.log' @@ -78,13 +78,15 @@ title_similarity, subject_similarity, comments_similarity, - head_similarity, + # in 2019-04-16: not checking head due to changes to css and feedback collector etc +# head_similarity, # extra_full_text_similarity, ancillary_similarity, extra_ref_cite_similarity, extra_general_similarity, dblp_similarity, - bookmarks_similarity +# in 2019-04-16: not checking bookmarks due to dropping delicious +# bookmarks_similarity ] @@ -151,10 +153,12 @@ def fetch_abs(compare_res_fn: Callable[[res_arg_dict], List[BadResult]], paper_i 'legacy_url': legacy_url, 'ng_res': requests.get(ng_url), 'legacy_res': requests.get(legacy_url), - 'paper_id': paper_id} + 'paper_id': paper_id, + 'id': paper_id} compare_config = {'ng_url': ng_url, 'legacy_url': legacy_url, - 'paper_id': paper_id} + 'paper_id': paper_id, + 'id': paper_id} return compare_config, list(compare_res_fn(res_dict)) @@ -291,7 +295,7 @@ def done()->bool: logging.debug(f'Opened {VISITED_ABS_FILE_NAME} to find visited abs') with open(LOG_FILE_NAME, 'w', buffering=1)as report_fh: logging.debug(f'Opened {LOG_FILE_NAME} to write report to') - with Pool(10) as pool: + with Pool(5) as pool: fetch_and_compare_fn = partial(fetch_abs, run_selected_compare_response) completed_jobs = pool.imap_unordered(fetch_and_compare_fn, papers) @@ -317,8 +321,14 @@ def write_comparison(report_fh, result: Tuple[Dict, List[BadResult]])-> None: (config, bad_results) = result logging.debug("writing report for %s", config['paper_id']) if bad_results: - data = json.dumps( [ config, bad_results], sort_keys=True, default=_serialize) - report_fh.write( data + "\n") + # data = json.dumps( [ config, bad_results], sort_keys=True, default=_serialize) + # report_fh.write( data + "\n") + + report_fh.write(f"* paper {config['paper_id']}\n") + for br in bad_results: + if 'GOOD' not in br.message: + report_fh.write( format_bad_result( br ) ) + def format_bad_result(bad: BadResult)->str: diff --git a/tests/legacy_comparison/html_comparisons.py b/tests/legacy_comparison/html_comparisons.py index f130db375..acf75d9f2 100644 --- a/tests/legacy_comparison/html_comparisons.py +++ b/tests/legacy_comparison/html_comparisons.py @@ -60,6 +60,7 @@ def _element_similarity(name: str, min_sim: float, required: bool, check_counts: bool, + text_trans: Callable[[str],str], html_arg: html_arg_dict) -> BadResult: """ Uses get_element to select an element of the BS doc on both NG and Legacy do a similarity. @@ -98,8 +99,8 @@ def _element_similarity(name: str, legacy_ele_txt = '' if len(ng) > 0 and len(legacy) > 0: - ng_ele_txt = ng[0].prettify() - legacy_ele_txt = legacy[0].prettify() + ng_ele_txt = text_trans(ng[0].prettify()) + legacy_ele_txt = text_trans(legacy[0].prettify()) sim = lev_similarity(ng_ele_txt, legacy_ele_txt) if sim < min_sim: @@ -140,33 +141,46 @@ def _strip_script_and_noscript( eles: List[BeautifulSoup]): return eles +def ident(x): + return x + author_similarity = partial( _element_similarity, 'authors div', lambda bs: _strip_href(_strip_script_and_noscript(bs.select('.authors'))), - 0.9, True, True) + 0.9, True, True, ident) dateline_similarity = partial( - _element_similarity, 'dateline div', lambda bs: _strip_href(bs.select('.dateline')), 0.8, True, True) + _element_similarity, 'dateline div', lambda bs: _strip_href(bs.select('.dateline')), 0.8, True, True, ident) + + + +def normalize_history(sin): + return sin\ + .replace('GMT', '[normalized_gmt_utc]').replace('UTC', '[normalized_gmt_utc]')\ + .replace(' KB)', ' [normalized_kb])').replace('kb)', ' [normalized_kb])') history_similarity = partial( - _element_similarity, 'submission-history div', lambda bs: _strip_href(bs.select('.submission-history')), 0.9, True, True) + _element_similarity, 'submission-history div', + lambda bs: _strip_href(bs.select('.submission-history')), + 0.9, True, True, + normalize_history) title_similarity = partial( - _element_similarity, 'title div', lambda bs: bs.select('.title'), 0.9, True, True) + _element_similarity, 'title div', lambda bs: bs.select('.title'), 0.9, True, True, ident) subject_similarity = partial( - _element_similarity, 'subjects td', lambda bs: bs.select('.subjects'), 0.98, True, True) + _element_similarity, 'subjects td', lambda bs: bs.select('.subjects'), 0.98, True, True, ident) comments_similarity = partial( - _element_similarity, 'comments td', lambda bs: bs.select('.comments'), 0.9, False, True) + _element_similarity, 'comments td', lambda bs: bs.select('.comments'), 0.9, False, True, ident) head_similarity = partial( - _element_similarity, 'head element', lambda bs: _strip_href(bs.select('head')), 0.80, True, True) + _element_similarity, 'head element', lambda bs: _strip_href(bs.select('head')), 0.80, True, True, ident) ############ div.extra-services Checks ################# @@ -176,57 +190,57 @@ def ex_strip(eles: List[BeautifulSoup]): extra_full_text_similarity = partial(_element_similarity, 'extra full-text div', lambda bs: ex_strip(bs.select('div.full-text')), - 0.9,True,True) + 0.9,True,True, ident) ancillary_similarity = partial(_element_similarity, 'extra ancillary div', lambda bs: ex_strip(bs.select('div.ancillary')), - 0.9, False, True) + 0.9, False, True, ident) extra_ref_cite_similarity = partial(_element_similarity, 'extra ref_cite div', lambda bs: ex_strip(bs.select('div.extra-ref-cite')), - 0.9, False, True) + 0.9, False, True, ident) extra_general_similarity = partial(_element_similarity, 'extra extra-general div', lambda bs: ex_strip(bs.select('div.extra-general')), - 0.9, False, True) + 0.9, False, True, ident) extra_browse_similarity = partial(_element_similarity, 'extra browse div', lambda bs: ex_strip(bs.select('div.browse')), - 0.9, True, True) + 0.9, True, True, ident) dblp_similarity = partial(_element_similarity, 'extra DBLP div', lambda bs: ex_strip(bs.select('.dblp')), - 0.9, False, True) + 0.9, False, True, ident) bookmarks_similarity = partial(_element_similarity, 'extra bookmarks div', lambda bs: ex_strip(bs.select('.bookmarks')), - 0.9, False, True) + 0.9, False, True, ident) ################# /archive checks ################################ archive_h1_similarity = partial(_element_similarity, 'top heading', lambda bs: ex_strip(bs.select('#content > h1')), - 0.99, True, True) + 0.99, True, True, ident) archive_browse = partial(_element_similarity, 'browse', lambda bs: ex_strip(bs.select('#content > ul > li:nth-child(1)')), - 0.99, True, True) + 0.99, True, True, ident) archive_catchup = partial(_element_similarity, 'archive catchup', lambda bs: ex_strip(bs.select('#content > ul > li:nth-child(2)')), - 0.99, True, True) + 0.99, True, True, ident) archive_search= partial(_element_similarity, 'archive_search', lambda bs: ex_strip(bs.select('#content > ul > li:nth-child(3)')), - 0.99, True, True) + 0.99, True, True, ident) archive_by_year= partial(_element_similarity, 'archive_by_year', lambda bs: ex_strip(bs.select('#content > ul > li:nth-child(4)')), - 0.99, True, True) + 0.99, True, True, ident) archive_bogus= partial(_element_similarity, 'bogus_should_fail', lambda bs: ex_strip(bs.select('.bogusClass')), - 0.99, True, True) + 0.99, True, True, ident) diff --git a/tests/test_browse.py b/tests/test_browse.py index d14bc12cb..a71ea609a 100644 --- a/tests/test_browse.py +++ b/tests/test_browse.py @@ -92,7 +92,8 @@ def test_stats_today(self): self.assertEqual(rv.status_code, 200) html = BeautifulSoup(rv.data.decode('utf-8'), 'html.parser') - csv_dl_elmt = html.find('a', {'href': '/stats/get_hourly?date=20190102'}) + csv_dl_elmt = html.find( + 'a', {'href': '/stats/get_hourly?date=20190102'}) self.assertIsNotNone(csv_dl_elmt, 'csv download link exists') @@ -112,11 +113,11 @@ def test_stats_monthly_submissions(self): self.assertEqual(rv.status_code, 200) html = BeautifulSoup(rv.data.decode('utf-8'), 'html.parser') - csv_dl_elmt = html.find('a', {'href': '/stats/get_monthly_submissions'}) + csv_dl_elmt = html.find( + 'a', {'href': '/stats/get_monthly_submissions'}) self.assertIsNotNone(csv_dl_elmt, 'csv download link exists') - def test_abs_without_license_field(self): f1 = ABS_FILES + '/ftp/arxiv/papers/0704/0704.0001.abs' m = AbsMetaSession.parse_abs_file(filename=f1) @@ -421,28 +422,34 @@ def test_year(self): self.assertEqual(rv.status_code, 200) rv = self.app.get('/year/astro-ph/') - self.assertEqual( rv.status_code, 200) + self.assertEqual(rv.status_code, 200) rv = self.app.get('/year/astro-ph') - self.assertEqual( rv.status_code, 200) + self.assertEqual(rv.status_code, 200) rv = self.app.get('/year/astro-ph/09/') self.assertEqual(rv.status_code, 200) rv = self.app.get('/year') - self.assertEqual( rv.status_code, 404) + self.assertEqual(rv.status_code, 404) rv = self.app.get('/year/astro-ph/9999') - self.assertEqual(rv.status_code, 307, 'Future year should cause temporary redirect') + self.assertEqual(rv.status_code, 307, + 'Future year should cause temporary redirect') rv = self.app.get('/year/fakearchive/01') self.assertNotEqual(rv.status_code, 200) - self.assertLess( rv.status_code, 500, 'should not cause a 5XX') + self.assertLess(rv.status_code, 500, 'should not cause a 5XX') rv = self.app.get('/year/002/0000') - self.assertLess( rv.status_code, 500, 'should not cause a 5XX') + self.assertLess(rv.status_code, 500, 'should not cause a 5XX') rv = self.app.get('/year/astro-py/9223372036854775808') - self.assertLess( rv.status_code, 500, 'should not cause a 5XX') - - + self.assertLess(rv.status_code, 500, 'should not cause a 5XX') + + def test_secondary_order(self): + rv = self.app.get('/abs/0906.3421') + self.assertIn( + 'Statistical Mechanics (cond-mat.stat-mech); Mathematical Physics (math-ph)', + rv.data.decode('utf-8'), + 'Secondary categories should be orderd by category id ARXIVNG-2066') diff --git a/tests/test_search_authors.py b/tests/test_search_authors.py index b46be69c1..803ff6ee9 100644 --- a/tests/test_search_authors.py +++ b/tests/test_search_authors.py @@ -47,9 +47,11 @@ def test_basic(self): out, [('C. de la Fuente Marcos', 'de la Fuente Marcos, C')]) def test_split_long_author_list(self): - f1 = path_of_for_test('data/abs_files/ftp/arxiv/papers/1411/1411.4413.abs') + f1 = path_of_for_test( + 'data/abs_files/ftp/arxiv/papers/1411/1411.4413.abs') meta: metadata = AbsMetaSession.parse_abs_file(filename=f1) - alst = split_long_author_list(queries_for_authors(str(meta.authors)), 20) + alst = split_long_author_list( + queries_for_authors(str(meta.authors)), 20) self.assertIs(type(alst), tuple) self.assertIs(len(alst), 3) self.assertIs(type(alst[0]), list) @@ -58,12 +60,38 @@ def test_split_long_author_list(self): self.assertIs(type(alst[2]), int) def test_split_with_collaboration(self): - f1 = path_of_for_test('data/abs_files/ftp/arxiv/papers/0808/0808.4142.abs') + f1 = path_of_for_test( + 'data/abs_files/ftp/arxiv/papers/0808/0808.4142.abs') meta: metadata = AbsMetaSession.parse_abs_file(filename=f1) split = split_authors(str(meta.authors)) - self.assertListEqual(split, ['D0 Collaboration', ':', 'V. Abazov', ',', 'et al']) + self.assertListEqual( + split, ['D0 Collaboration', ':', 'V. Abazov', ',', 'et al']) alst = queries_for_authors(str(meta.authors)) self.assertListEqual(alst, [('D0 Collaboration', 'D0 Collaboration'), ': ', ('V. Abazov', 'Abazov, V'), ', ', 'et al']) + + def test_split_strange_author_list(self): + """Test odd author list that shows '0 additional authors' ARXIVNG-2083""" + f1 = path_of_for_test( + 'data/abs_files/ftp/arxiv/papers/1902/1902.05884.abs') + meta: metadata = AbsMetaSession.parse_abs_file(filename=f1) + alst = split_long_author_list( + queries_for_authors(str(meta.authors)), 100) + + self.assertIs(type(alst), tuple) + self.assertIs(len(alst), 3) + + self.assertIs(type(alst[0]), list) + self.assertIs(type(alst[1]), list) + self.assertIs(type(alst[2]), int) + + self.assertEqual( + len(list(filter(lambda x: isinstance(x, tuple), alst[0]))), + 101) + + self.assertEqual( + len(alst[1]), 0, "Back list on 1902.05884 should be empty") + self.assertEqual( + alst[2], 0, "Back list size on 1902.05884 should be empty") From 0c8fbd76c5ae9816017c13509f7087dfe103cb93 Mon Sep 17 00:00:00 2001 From: Martin Lessmeister Date: Fri, 19 Apr 2019 13:32:46 -0400 Subject: [PATCH 02/29] wip, can't use stylesheet from base without breaking layout --- browse/templates/base.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/browse/templates/base.html b/browse/templates/base.html index 7f7b15f93..6591685c9 100644 --- a/browse/templates/base.html +++ b/browse/templates/base.html @@ -1,3 +1,4 @@ +{%- import 'base/macros.html' as base_macros -%} @@ -7,6 +8,7 @@ {% block title %}{% endblock %} + {# disable for now #} {%- if config['BROWSE_ANALYTICS_ENABLED'] %} @@ -57,9 +59,8 @@ {% block header_h1 %}

{{ config['BROWSE_SITE_LABEL'] or 'arXiv.org' }}

{% endblock header_h1%} {% block login_link %}{% endblock %} - + {{ base_macros.compactsearch() }} + {% endblock header %} From 49bf26c7675b647e3a2d438669c14767f356edda Mon Sep 17 00:00:00 2001 From: Martin Lessmeister Date: Mon, 22 Apr 2019 14:43:48 -0400 Subject: [PATCH 03/29] allow trailing slashes for /archive// [ARXIVNG-2098] --- browse/routes/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browse/routes/ui.py b/browse/routes/ui.py index 237eb0eeb..6bad527ce 100644 --- a/browse/routes/ui.py +++ b/browse/routes/ui.py @@ -310,7 +310,7 @@ def form(arxiv_id: str) -> Response: @blueprint.route('archive/', defaults={'archive': None}) -@blueprint.route('archive/') +@blueprint.route('archive/', strict_slashes=False) def archive(archive: str): # type: ignore """Landing page for an archive.""" response, code, headers = archive_page.get_archive(archive) # type: ignore From 668c8d991fe0114121aab563d1a1c23e7f68e361 Mon Sep 17 00:00:00 2001 From: Martin Lessmeister Date: Mon, 22 Apr 2019 14:47:41 -0400 Subject: [PATCH 04/29] add test --- tests/test_archive.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_archive.py b/tests/test_archive.py index b4b80b7e8..cab1540cc 100644 --- a/tests/test_archive.py +++ b/tests/test_archive.py @@ -14,6 +14,10 @@ def test_astroph_archive(self): self.assertEqual(rv.status_code, 200) self.assertIn('Expires', rv.headers, 'Should have expires header') + rv = self.app.get("/archive/astro-ph/") + self.assertEqual(rv.status_code, 200, + 'Trailing slash should be allowed') + src = rv.data.decode("utf-8") self.assertIn("Astrophysics", src) self.assertIn("/year/astro-ph/92", src) @@ -66,6 +70,3 @@ def test_single_archive(self): self.assertIn("High Energy Physics", src) self.assertNotIn("Categories within", src) - - - From 1eb2559f240a17a6428af30f9887ecc466eb2c77 Mon Sep 17 00:00:00 2001 From: Martin Lessmeister Date: Tue, 23 Apr 2019 09:47:32 -0400 Subject: [PATCH 05/29] add CSS for search box [Liz, ARXIVNG-2088] --- browse/static/css/search.css | 78 ++++++++++++++++++++++++++++++++++++ browse/templates/base.html | 3 +- 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 browse/static/css/search.css diff --git a/browse/static/css/search.css b/browse/static/css/search.css new file mode 100644 index 000000000..c2abc5568 --- /dev/null +++ b/browse/static/css/search.css @@ -0,0 +1,78 @@ +.search-block.level-right { + display: flex; + justify-content: flex-end; + clear: right; +} + +.search-block form.level-item, +.field.has-addons { + display: flex; +} + +.search-block p.help { + margin-bottom: 0; +} + +.search-block .input, +.search-block select, +.search-block .button { + font-size: 0.75rem; + line-height: 1.5; + height: 2.25em; + border-radius: 2px; + border: 1px solid transparent; +} + +.search-block .input { + border-color: transparent; + box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); + border-bottom-right-radius: 0; + border-top-right-radius: 0; + border: 0; + width: 100%; + max-width: 100%; + padding: 0 0.5em; +} + +.search-block select { + -webkit-appearance: listbox; + border-color: #ccc; + padding-left: 0.5em; + box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); +} + +.search-block .control { + position: relative; +} + +/* creates downward caret */ +.search-block .select::after { + position: absolute; + display: block; + z-index: 4; + top: 50%; + right: 1.125em; + width: 0.5em; + height: 0.5em; + content: " "; + border: 3px solid #0068AC; + border-radius: 2px; + border-right: 0; + border-top: 0; + transform: rotate(-45deg); + transform-origin: center; + pointer-events: none; + margin-top: -1.125em; +} + +.search-block .button { + background-color: #711111; + color: #FFF; + border-color: transparent; +} + +.search-block .button:hover, +.search-block .button:focus { + background-color: #440A0A; + color: #FFF; +} diff --git a/browse/templates/base.html b/browse/templates/base.html index 6591685c9..b8261f760 100644 --- a/browse/templates/base.html +++ b/browse/templates/base.html @@ -8,7 +8,7 @@ {% block title %}{% endblock %} - + {# disable for now #} {%- if config['BROWSE_ANALYTICS_ENABLED'] %} @@ -60,7 +60,6 @@ {% block header_h1 %}

{{ config['BROWSE_SITE_LABEL'] or 'arXiv.org' }}

{% endblock header_h1%} {% block login_link %}{% endblock %} {{ base_macros.compactsearch() }} - {% endblock header %} From 9de4c92357acf54c5e0a4133925e606fa34077fd Mon Sep 17 00:00:00 2001 From: Martin Lessmeister Date: Tue, 23 Apr 2019 16:49:37 -0400 Subject: [PATCH 06/29] add padding to css, rename file, update templates --- browse/static/css/{search.css => browse_search.css} | 4 ++++ browse/templates/abs/abs.html | 7 ++----- browse/templates/base.html | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) rename browse/static/css/{search.css => browse_search.css} (95%) diff --git a/browse/static/css/search.css b/browse/static/css/browse_search.css similarity index 95% rename from browse/static/css/search.css rename to browse/static/css/browse_search.css index c2abc5568..cdf9d092b 100644 --- a/browse/static/css/search.css +++ b/browse/static/css/browse_search.css @@ -76,3 +76,7 @@ background-color: #440A0A; color: #FFF; } + +#header form select, #header form input { + padding: 0 0.5em; +} diff --git a/browse/templates/abs/abs.html b/browse/templates/abs/abs.html index 086db3f6b..dd6f4f281 100644 --- a/browse/templates/abs/abs.html +++ b/browse/templates/abs/abs.html @@ -18,12 +18,9 @@ {% block body_id %}{% endblock %} {% block header_class %}{% endblock %} -{% block header %} +{% block header_h1 %}

{{ config['BROWSE_SITE_LABEL'] }} > {{ abs_meta.primary_archive.id }} > arXiv:{{ requested_id }}

- -{% endblock header %} +{% endblock header_h1 %} {%- block content %} {%- include "abs/trackback_rdf.html" %} diff --git a/browse/templates/base.html b/browse/templates/base.html index b8261f760..21f5a7ee5 100644 --- a/browse/templates/base.html +++ b/browse/templates/base.html @@ -9,7 +9,6 @@ - {# disable for now #} {%- if config['BROWSE_ANALYTICS_ENABLED'] %} + {%- include "feedback_collector_js.html" -%} {{- generate_scholar_tags() }} {{- generate_social_media_tags() }} diff --git a/browse/templates/abs/bookmarking.html b/browse/templates/abs/bookmarking.html index d2ba29e9e..e4d040cf3 100644 --- a/browse/templates/abs/bookmarking.html +++ b/browse/templates/abs/bookmarking.html @@ -1,5 +1,5 @@
-

Bookmark

+

Bookmark

{%- set absUrl = canonical_url( abs_meta.arxiv_id ) -%} {%- set title = abs_meta.title -%} {%- block head -%} {% block title %}{% endblock %} - - + + {%- if config['BROWSE_ANALYTICS_ENABLED'] %} @@ -29,9 +29,9 @@ {% endif -%} {% if config['BROWSE_USER_BANNER_ENABLED'] and (config['BROWSE_USER_BANNER_START_DATE'] < request_datetime) and (config['BROWSE_USER_BANNER_END_DATE'] > request_datetime) %} - + - + {% endif -%} {%- endblock head -%} @@ -45,7 +45,7 @@ {% endif -%}
We gratefully acknowledge support from
the Simons Foundation and {{ session['institution'] if ('institution' in session and session['institution'] != None) else 'member institutions' }}.
diff --git a/browse/templates/stats/base.html b/browse/templates/stats/base.html index f36e88a98..e835ba930 100644 --- a/browse/templates/stats/base.html +++ b/browse/templates/stats/base.html @@ -3,8 +3,7 @@ {% block head %} {{ super() -}} - {# TODO: upgrade d3 to v5.x? #} - + {% endblock head %} {% block header_h1 %}

{{ config['BROWSE_SITE_LABEL'] }} > stats > server usage

{% endblock %} diff --git a/browse/templates/tb/base.html b/browse/templates/tb/base.html index e86a302b5..6db1cda69 100644 --- a/browse/templates/tb/base.html +++ b/browse/templates/tb/base.html @@ -3,7 +3,7 @@ {% block head %} {{ super() -}} - +