├── .editorconfig ├── .eslintrc.yaml ├── .github └── workflows │ └── pre-commit.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .stylelintrc.yaml ├── CHANGELOG.md ├── README.md ├── Vagrantfile ├── __init__.py ├── conf ├── celerybeat ├── celerybeat.conf ├── celerybeat.service ├── celeryconfig.py ├── celeryd ├── celeryd.conf ├── celeryd.service ├── chronam-apache2_4.conf ├── chronam-canonical.conf ├── chronam.conf ├── chronam.pth ├── chronam.wsgi ├── default.vcl ├── load_essays_cron.sh └── my.cnf ├── core ├── __init__.py ├── batch_loader.py ├── context_processors.py ├── decorator.py ├── essay_loader.py ├── feeds │ ├── __init__.py │ └── newspapers.py ├── fixtures │ ├── awardee.json │ ├── batch.json │ ├── countries.json │ ├── essay_titles.json │ ├── ethnicities.json │ ├── initial_data.json │ ├── institutions.json │ ├── issue.json │ ├── labor_presses.json │ ├── languages.json │ ├── material_types.json │ ├── page.json │ ├── place_links.json │ ├── titles.json │ ├── uuml_thys_sample.json │ └── uuml_thys_sample.py ├── forms.py ├── holding_loader.py ├── index.py ├── manage.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ ├── batches.py │ │ ├── chronam_sync.py │ │ ├── commit_index.py │ │ ├── diff_batches.py │ │ ├── dump_batch_ocr.py │ │ ├── dump_ocr.py │ │ ├── dump_page_iiif_urls.py │ │ ├── ethnicities_with_issues.py │ │ ├── flickr.py │ │ ├── index.py │ │ ├── index_missing_pages.py │ │ ├── index_pages.py │ │ ├── index_titles.py │ │ ├── link_places.py │ │ ├── load_batch.py │ │ ├── load_batches.py │ │ ├── load_essays.py │ │ ├── load_holdings.py │ │ ├── load_institutions.py │ │ ├── load_titles.py │ │ ├── make_countries_fixture.py │ │ ├── optimize_mysql.py │ │ ├── optimize_solr.py │ │ ├── process_coordinates.py │ │ ├── pull_titles.py │ │ ├── purge_batch.py │ │ ├── purge_django_cache.py │ │ ├── purge_essays.py │ │ ├── purge_etitles.py │ │ ├── queue_load_batch.py │ │ ├── queue_process_coordinates.py │ │ ├── queue_purge_batch.py │ │ ├── reconcile.py │ │ ├── release.py │ │ ├── title_sync.py │ │ ├── update_has_issues.py │ │ └── zap_index.py ├── middleware.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20160405_0900.py │ ├── 0003_auto_20160928_0840.py │ ├── 0004_auto_20170712_1312.py │ ├── 0005_remove_languagetext_text.py │ ├── 0006_auto_20180116_1142.py │ ├── 0007_index_issue_titles_with_dates.py │ ├── 0008_auto_20211130_1437.py │ └── __init__.py ├── models.py ├── ocr_extractor.py ├── rdf.py ├── sitemaps.py ├── static │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap-responsive.css │ │ │ ├── bootstrap-responsive.min.css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.min.css │ │ │ └── datepicker.css │ │ ├── img │ │ │ ├── glyphicons-halflings-white.png │ │ │ └── glyphicons-halflings.png │ │ ├── js │ │ │ ├── bootstrap-datepicker.js │ │ │ ├── bootstrap.js │ │ │ └── bootstrap.min.js │ │ └── less │ │ │ └── datepicker.less │ ├── css │ │ ├── ca_reports.css │ │ ├── loading.gif │ │ ├── tablesort.css │ │ ├── ui_overwrite.css │ │ └── ui_tabs.css │ ├── images │ │ ├── asc.gif │ │ ├── bg.gif │ │ ├── calendar_icon.gif │ │ ├── desc.gif │ │ ├── fullpage_grouphover.png │ │ ├── fullpage_hover.png │ │ ├── fullpage_pressed.png │ │ ├── fullpage_rest.png │ │ ├── home_grouphover.png │ │ ├── home_hover.png │ │ ├── home_pressed.png │ │ ├── home_rest.png │ │ ├── item_btn_next.png │ │ ├── item_btn_prev.png │ │ ├── item_clip_icon.png │ │ ├── next_grouphover.png │ │ ├── next_hover.png │ │ ├── next_pressed.png │ │ ├── next_rest.png │ │ ├── previous_grouphover.png │ │ ├── previous_hover.png │ │ ├── previous_pressed.png │ │ ├── previous_rest.png │ │ ├── tab-prime-bg.png │ │ ├── tab-prime.png │ │ ├── tab.png │ │ ├── tab2.png │ │ ├── ui-anim_basic_16x16.gif │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ ├── ui-icons_cd0a0a_256x240.png │ │ ├── zoomin_grouphover.png │ │ ├── zoomin_hover.png │ │ ├── zoomin_pressed.png │ │ ├── zoomin_rest.png │ │ ├── zoomout_grouphover.png │ │ ├── zoomout_hover.png │ │ ├── zoomout_pressed.png │ │ └── zoomout_rest.png │ ├── jquery-ui.css │ ├── js │ │ ├── highlight.js │ │ ├── page.js │ │ └── search.js │ └── vendor │ │ ├── jquery-ui.js │ │ ├── jquery.ba-bbq.min.js │ │ ├── jquery.jcarousel.min.js │ │ ├── jquery.min.js │ │ └── jquery.tablesorter.min.js ├── tasks.py ├── templates │ ├── 404.html │ ├── 500.html │ ├── about.html │ ├── about_api.html │ ├── base.html │ ├── disclaimer.html │ ├── help.html │ ├── holdings.html │ ├── home.html │ ├── includes │ │ ├── disclaimer.html │ │ ├── footer.html │ │ ├── issue_frontpages_ctrl.html │ │ ├── issue_pages_ctrl.html │ │ ├── lc_metadata.html │ │ ├── results_ctrl.html │ │ ├── tabs.html │ │ ├── titles_browse_ctrl.html │ │ └── titles_results_ctrl.html │ ├── issue_pages.html │ ├── issues.html │ ├── marc.html │ ├── news_directory.html │ ├── newspaper.html │ ├── newspapers.html │ ├── newspapers.txt │ ├── page.html │ ├── page_print.html │ ├── page_text.html │ ├── reports │ │ ├── awardee.html │ │ ├── awardees.html │ │ ├── batch.html │ │ ├── batch_summary.html │ │ ├── batch_summary.txt │ │ ├── batches.html │ │ ├── batches.xml │ │ ├── cities.html │ │ ├── city.html │ │ ├── counties.html │ │ ├── county.html │ │ ├── essay.html │ │ ├── essays.html │ │ ├── events.html │ │ ├── events.xml │ │ ├── institution.html │ │ ├── institution_titles.html │ │ ├── institutions.html │ │ ├── language_batch_pages.html │ │ ├── language_batches.html │ │ ├── language_title_pages.html │ │ ├── language_titles.html │ │ ├── languages.html │ │ ├── ocr.html │ │ ├── ocr.xml │ │ ├── pages_on_flickr.html │ │ ├── reel.html │ │ ├── reels.html │ │ ├── reports.html │ │ ├── state.html │ │ ├── states.html │ │ ├── states_counties.html │ │ ├── status.html │ │ └── terms.html │ ├── search_advanced.html │ ├── search_pages_opensearch.xml │ ├── search_pages_results.html │ ├── search_pages_results.xml │ ├── search_titles_opensearch.xml │ ├── search_titles_results.html │ ├── search_titles_results.xml │ ├── site.html │ ├── site_base.html │ ├── site_base_alt.html │ ├── title.html │ ├── title.xml │ └── titles.html ├── templatetags │ ├── __init__.py │ └── custom_filters.py ├── test-data │ ├── bib-with-vague-dates.xml │ ├── essay.html │ ├── etitle.xml │ ├── holdings.xml │ ├── ocr.txt │ ├── ocr.xml │ ├── rda.xml │ ├── sn86069873.xml │ ├── title-delete.xml │ ├── title.xml │ └── uuml_thys_ocr.txt ├── tests │ ├── __init__.py │ ├── api_tests.py │ ├── batch_loader_tests.py │ ├── browse_tests.py │ ├── caching_tests.py │ ├── essay_loader_tests.py │ ├── holding_loader_tests.py │ ├── index_tests.py │ ├── jp2_tests.py │ ├── json_tests.py │ ├── ocr_dump_tests.py │ ├── ocr_extractor_tests.py │ ├── rdf_tests.py │ ├── system_tests.py │ ├── title_loader_tests.py │ └── title_pull_tests.py ├── title_loader.py ├── title_pull.py ├── utils │ ├── __init__.py │ ├── url.py │ └── utils.py ├── views │ ├── __init__.py │ ├── browse.py │ ├── directory.py │ ├── home.py │ ├── image.py │ ├── reports.py │ ├── search.py │ └── static.py └── worldcat_overrides │ ├── __init__.py │ └── request.py ├── example ├── __init__.py ├── screenshots │ ├── screenshot-issues.jpg │ └── screenshot-splash.jpg ├── static │ └── images │ │ └── dbrunton.jpeg └── templates │ └── site.html ├── install_redhat.md ├── install_ubuntu.md ├── loc ├── __init__.py ├── models.py ├── static │ ├── base.css │ ├── css │ │ ├── ca_head.css │ │ ├── ca_ie.css │ │ ├── ca_print.css │ │ ├── ca_reports.css │ │ ├── ca_reset.css │ │ └── loc_footer_v2.css │ ├── images │ │ ├── bg_item_ctrl.png │ │ ├── btn_browse.png │ │ ├── btn_browse_sel.png │ │ ├── btn_go.png │ │ ├── btn_submit_bg.gif │ │ ├── btn_usnews.png │ │ ├── btn_usnews_sel.png │ │ ├── btn_x.gif │ │ ├── center.gif │ │ ├── divider_neh.png │ │ ├── dot.gif │ │ ├── dot_v.gif │ │ ├── fullpage_grouphover.png │ │ ├── fullpage_hover.png │ │ ├── fullpage_pressed.png │ │ ├── fullpage_rest.png │ │ ├── home_grouphover.png │ │ ├── home_hover.png │ │ ├── home_pressed.png │ │ ├── home_rest.png │ │ ├── i_clip_download.gif │ │ ├── i_clip_print.gif │ │ ├── i_home_flickr.jpg │ │ ├── i_home_highlights.jpg │ │ ├── i_home_newsboy.jpg │ │ ├── i_view_browse.png │ │ ├── i_view_list.png │ │ ├── icon-ext-gray.gif │ │ ├── item_dot_divider.png │ │ ├── item_text_icon.png │ │ ├── left-img-head.gif │ │ ├── leftnav.jpg │ │ ├── line2.gif │ │ ├── logo_chron_top.png │ │ ├── logo_loc.gif │ │ ├── logo_loc_cobrand.gif │ │ ├── logo_neh.gif │ │ ├── logo_neh.png │ │ ├── next_grouphover.png │ │ ├── next_hover.png │ │ ├── next_page.gif │ │ ├── next_pressed.png │ │ ├── next_rest.png │ │ ├── no_thumbnail.gif │ │ ├── pag_next_off.gif │ │ ├── pag_next_on.gif │ │ ├── pag_prev_off.gif │ │ ├── pag_prev_on.gif │ │ ├── prev_page.gif │ │ ├── previous_grouphover.png │ │ ├── previous_hover.png │ │ ├── previous_pressed.png │ │ ├── previous_rest.png │ │ ├── red_60.png │ │ ├── table_dot.gif │ │ ├── table_dot_first.gif │ │ ├── table_dot_last.gif │ │ ├── transparent.gif │ │ ├── xml.png │ │ ├── zoomin_grouphover.png │ │ ├── zoomin_hover.png │ │ ├── zoomin_pressed.png │ │ ├── zoomin_rest.png │ │ ├── zoomout_grouphover.png │ │ ├── zoomout_hover.png │ │ ├── zoomout_pressed.png │ │ └── zoomout_rest.png │ ├── img-foot │ │ ├── Thumbs.db │ │ ├── arrow-dbl-gray-right.gif │ │ ├── facebook.gif │ │ ├── flickr.gif │ │ ├── icon-ext-foot.gif │ │ ├── line.gif │ │ ├── speech.gif │ │ ├── twitter.gif │ │ └── youtube.gif │ ├── img-head │ │ ├── Thumbs.db │ │ ├── ask.gif │ │ ├── btns-about.gif │ │ ├── btns-asklib.gif │ │ ├── btns-help.gif │ │ ├── catalog.gif │ │ ├── digitalcoll.gif │ │ ├── line-top.gif │ │ ├── line.gif │ │ ├── loc.gif │ │ ├── logo-ca.gif │ │ ├── logo-loc.gif │ │ ├── logo-neh.gif │ │ ├── rule.gif │ │ └── vert_dots.gif │ ├── img-std │ │ ├── arrow-dbl-gray-left.gif │ │ ├── arrow-dbl-gray-right.gif │ │ ├── arrow-dbl-left.gif │ │ ├── arrow-dbl-right.gif │ │ ├── btn-input-clear.gif │ │ ├── btn-input-continue.gif │ │ ├── btn-input-go.gif │ │ ├── btn-input-reset.gif │ │ ├── btn-input-search.gif │ │ ├── btn-input-submit.gif │ │ ├── bullet.gif │ │ ├── bullet_blue.gif │ │ ├── bullet_blue_dash.gif │ │ ├── dot.gif │ │ ├── dot_v.gif │ │ ├── dotted-h1-bot-rh.gif │ │ ├── dotted-h1-bot.gif │ │ ├── dotted-h1-top-rh.gif │ │ ├── dotted-h1-top.gif │ │ ├── fav.ico │ │ ├── get_adobe_reader.gif │ │ ├── i_arrow.gif │ │ ├── i_arrow_down.gif │ │ ├── i_arrow_grey.gif │ │ ├── i_arrow_o.gif │ │ ├── i_arrow_up.gif │ │ ├── i_audio.gif │ │ ├── i_audio2.gif │ │ ├── i_backtotop.gif │ │ ├── i_backtotop_g.gif │ │ ├── i_disclaimer.gif │ │ ├── i_enlarge.gif │ │ ├── i_external.gif │ │ ├── i_gallery.gif │ │ ├── i_grid.gif │ │ ├── i_list.gif │ │ ├── i_newwindow.gif │ │ ├── i_permalink.gif │ │ ├── i_podcast.gif │ │ ├── i_print.gif │ │ ├── i_rss.gif │ │ ├── i_slideshow.gif │ │ ├── i_video.gif │ │ ├── i_video2.gif │ │ ├── ph_bot.gif │ │ ├── ph_bot2.gif │ │ ├── ph_top.gif │ │ ├── ph_top2.gif │ │ ├── slideshow.gif │ │ └── speech.gif │ ├── js │ │ ├── head.min.js │ │ ├── jquery.mousewheel.js │ │ └── main.js │ ├── next-horizontal.png │ ├── next-vertical.png │ ├── prev-horizontal.png │ ├── prev-vertical.png │ └── ui_carousel.css ├── templates │ ├── base.html │ ├── home.html │ ├── includes │ │ ├── results_ctrl.html │ │ └── tabs.html │ ├── page.html │ ├── page_print.html │ ├── page_text.html │ ├── search_pages_results.html │ ├── search_pages_results_list.html │ ├── site.html │ └── site_base_alt.html ├── tests.py └── views.py ├── loc_cts ├── __init__.py ├── cts.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ ├── bag_instances.py │ │ ├── poll_cts.py │ │ ├── poll_purge.py │ │ └── service_requests.py ├── tasks.py └── tests │ ├── __init__.py │ └── cts_tests.py ├── package-lock.json ├── package.json ├── pyproject.toml ├── requirements-dev.txt ├── requirements.pip ├── requirements_loc.pip ├── scripts ├── __init__.py └── extract_marc_values.py ├── settings_jenkins.py ├── settings_loc.py ├── settings_template.py ├── settings_test.py ├── setup.cfg ├── solr ├── Dockerfile └── conf │ ├── jetty-logging.xml │ ├── jetty-redhat │ ├── jetty-ubuntu │ ├── jetty6.sh │ ├── jetty7.sh │ ├── schema.xml │ ├── solr-tomcat.xml │ ├── solrconfig-centos.xml │ ├── solrconfig-ubuntu.xml │ └── solrconfig.xml ├── static └── robots.txt ├── urls.py └── vagrant ├── centos ├── root_setup.sh └── user_setup.sh └── runserver.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | # See https://editorconfig.org for format details and 2 | # https://editorconfig.org/#download for editor / IDE integration 3 | 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 4 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | end_of_line = lf 12 | charset = utf-8 13 | 14 | # Makefiles always use tabs for indentation 15 | [Makefile] 16 | indent_style = tab 17 | 18 | # We don't want to apply our defaults to third-party code or minified bundles: 19 | [**/{external,vendor}/**,**.min.{js,css}] 20 | indent_style = ignore 21 | indent_size = ignore 22 | -------------------------------------------------------------------------------- /.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | root: true 2 | extends: eslint:recommended 3 | plugins: 4 | - prettier 5 | rules: 6 | indent: 7 | # https://eslint.org/docs/4.0.0/rules/indent 8 | # Match defaults & Crockford but enable indentation for switch statement cases: 9 | - 2 10 | - 4 11 | - SwitchCase: 1 12 | env: 13 | browser: true 14 | es6: true 15 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | # https://pre-commit.com 2 | # This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file. 3 | # Using pre-commit.ci is even better that using GitHub Actions for pre-commit. 4 | name: pre-commit 5 | on: [push] 6 | jobs: 7 | pre-commit: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: actions/setup-python@v4 12 | with: 13 | python-version: 3.x 14 | - run: pip install pre-commit 15 | - run: pre-commit --version 16 | - run: pre-commit install 17 | - run: pre-commit run --all-files 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | ENV 3 | settings.py 4 | *.log 5 | data/batches 6 | data/ocr 7 | data/word_coordinates 8 | .static-media/ 9 | .vagrant/ 10 | .idea* 11 | batches 12 | storage 13 | -------------------------------------------------------------------------------- /.stylelintrc.yaml: -------------------------------------------------------------------------------- 1 | extends: 2 | - stylelint-config-recommended 3 | - stylelint-config-prettier 4 | rules: 5 | no-descending-specificity: null 6 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/__init__.py -------------------------------------------------------------------------------- /conf/celerybeat: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # celerybeat init file for starting celerybeat 4 | # 5 | # chkconfig: - 20 80 6 | # description: Starts and stops the celerybeat daemon 7 | 8 | # Source function library. 9 | . /etc/rc.d/init.d/functions 10 | 11 | name="chronam-celerybeat" 12 | home="/opt/chronam" 13 | user="ndnp" 14 | 15 | virtualenv_dir="$home/ENV" 16 | source $virtualenv_dir/bin/activate 17 | 18 | cd "$home" 19 | export PYTHONPATH="$PYTHONPATH:/opt/chronam/conf" 20 | 21 | lockfile="/var/log/celery/subsys/celerybeat.lock" 22 | logfile="/var/log/celery/celerybeat.log" 23 | pidfile="/var/log/celery/celerybeat.pid" 24 | 25 | start() { 26 | echo -n $"Starting $name: " 27 | daemon --user $user "django-admin.py celerybeat --pidfile $pidfile --logfile $logfile --detach --settings=celeryconfig" 28 | retval=$? 29 | echo 30 | [ $retval -eq 0 ] && touch $lockfile 31 | return $retval 32 | } 33 | 34 | stop() { 35 | echo -n $"Stopping $name: " 36 | killproc -p $pidfile $name 37 | retval=$? 38 | echo 39 | [ $retval -eq 0 ] && rm -f $lockfile 40 | return $retval 41 | } 42 | 43 | restart() { 44 | stop 45 | start 46 | } 47 | 48 | reload() { 49 | false 50 | } 51 | 52 | rh_status() { 53 | status -p $pidfile $name 54 | } 55 | 56 | rh_status_q() { 57 | rh_status >/dev/null 2>&1 58 | } 59 | 60 | 61 | case "$1" in 62 | start) 63 | rh_status_q && exit 0 64 | $1 65 | ;; 66 | stop) 67 | rh_status_q || exit 0 68 | $1 69 | ;; 70 | restart) 71 | $1 72 | ;; 73 | reload) 74 | rh_status_q || exit 7 75 | $1 76 | ;; 77 | force-reload) 78 | force_reload 79 | ;; 80 | status) 81 | rh_status 82 | ;; 83 | condrestart|try-restart) 84 | rh_status_q || exit 0 85 | restart 86 | ;; 87 | *) 88 | echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" 89 | exit 2 90 | esac 91 | exit $? 92 | -------------------------------------------------------------------------------- /conf/celerybeat.conf: -------------------------------------------------------------------------------- 1 | description "celerybeat for chronam" 2 | author "John Scancella " 3 | 4 | start on runlevel [2345] 5 | stop on runlevel [!2345] 6 | 7 | respawn 8 | 9 | post-stop exec sleep 10 10 | 11 | console log 12 | setuid ndnp 13 | setgid ndnp 14 | 15 | script 16 | set -a 17 | export DJANGO_SETTINGS_MODULE=chronam.settings 18 | . /opt/chronam/ENV/bin/activate 19 | django-admin.py celerybeat --pidfile /var/log/celery/celerybeat.pid --logfile /var/log/celery/celerybeat.log --workdir=/var/log/celery --schedule=/var/log/celery/celerybeat-schedule 20 | end script 21 | -------------------------------------------------------------------------------- /conf/celerybeat.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=ChronAm celerybeat 3 | 4 | [Service] 5 | Type=simple 6 | Restart=on-failure 7 | RestartSec=10s 8 | User=ndnp 9 | Group=ndnp 10 | Environment=DJANGO_SETTINGS_MODULE=chronam.settings 11 | ExecStart=/bin/bash -c ". /opt/chronam/ENV/bin/activate && exec django-admin.py celerybeat --pidfile /var/log/celery/celerybeat.pid --logfile /var/log/celery/celerybeat.log --workdir=/var/log/celery --schedule=/var/log/celery/celerybeat-schedule" 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /conf/celeryconfig.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import logging 3 | import os 4 | 5 | from celery.schedules import crontab 6 | 7 | from chronam.settings import * # NOQA 8 | from chronam.settings import INSTALLED_APPS 9 | 10 | APP_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) 11 | 12 | 13 | CELERY_IMPORTS = ("chronam.core.tasks",) 14 | CELERYD_LOG_FILE = os.path.join("/var/log/celery", "celery.log") 15 | CELERYD_LOG_LEVEL = logging.INFO 16 | CELERYD_CONCURRENCY = 2 17 | 18 | CELERYBEAT_SCHEDULE = { 19 | "delete_django_cache": { 20 | "task": "chronam.core.tasks.delete_django_cache", 21 | "schedule": crontab(hour=5, minute=0), 22 | }, 23 | } 24 | 25 | if "chronam.loc_cts" in INSTALLED_APPS: 26 | CELERY_IMPORTS += ("chronam.loc_cts.tasks",) 27 | CELERYBEAT_SCHEDULE["poll_cts"] = { 28 | "task": "chronam.loc_cts.tasks.poll_cts", 29 | "schedule": datetime.timedelta(hours=1), 30 | "args": (), 31 | } 32 | 33 | CELERYBEAT_SCHEDULE["poll_purge"] = { 34 | "task": "chronam.loc_cts.tasks.poll_purge", 35 | "schedule": crontab(hour=3, minute=0), 36 | "args": (), 37 | } 38 | 39 | 40 | CELERYBEAT_LOG_FILE = os.path.join("/var/log/celery", "celerybeat.log") 41 | CELERYBEAT_LOG_LEVEL = logging.INFO 42 | -------------------------------------------------------------------------------- /conf/celeryd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # celeryd init file for starting chronam-celeryd 4 | # 5 | # chkconfig: - 20 80 6 | # description: Starts and stops the celeryd daemon 7 | 8 | # Source function library. 9 | . /etc/rc.d/init.d/functions 10 | 11 | name="chronam-celeryd" 12 | home="/opt/chronam" 13 | user="ndnp" 14 | 15 | virtualenv_dir="$home/ENV" 16 | source $virtualenv_dir/bin/activate 17 | 18 | cd "$home" 19 | export PYTHONPATH="$PYTHONPATH:/opt/chronam/conf" 20 | 21 | lockfile="/var/log/celery/celeryd.lock" 22 | logfile="/var/log/celery/celeryd.log" 23 | pidfile="/var/log/celery/celeryd.pid" 24 | 25 | 26 | start() { 27 | echo -n $"Starting $name: " 28 | daemon --user $user "django-admin.py celeryd_detach -c 2 --pidfile $pidfile --logfile $logfile --settings=celeryconfig" 29 | retval=$? 30 | echo 31 | [ $retval -eq 0 ] && touch $lockfile 32 | return $retval 33 | } 34 | 35 | stop() { 36 | echo -n $"Stopping $name: " 37 | killproc -p $pidfile $name 38 | retval=$? 39 | echo 40 | [ $retval -eq 0 ] && rm -f $lockfile 41 | return $retval 42 | } 43 | 44 | restart() { 45 | stop 46 | start 47 | } 48 | 49 | reload() { 50 | false 51 | } 52 | 53 | rh_status() { 54 | status -p $pidfile $name 55 | } 56 | 57 | rh_status_q() { 58 | rh_status >/dev/null 2>&1 59 | } 60 | 61 | 62 | case "$1" in 63 | start) 64 | rh_status_q && exit 0 65 | $1 66 | ;; 67 | stop) 68 | rh_status_q || exit 0 69 | $1 70 | ;; 71 | restart) 72 | $1 73 | ;; 74 | reload) 75 | rh_status_q || exit 7 76 | $1 77 | ;; 78 | force-reload) 79 | force_reload 80 | ;; 81 | status) 82 | rh_status 83 | ;; 84 | condrestart|try-restart) 85 | rh_status_q || exit 0 86 | restart 87 | ;; 88 | *) 89 | echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" 90 | exit 2 91 | esac 92 | exit $? 93 | -------------------------------------------------------------------------------- /conf/celeryd.conf: -------------------------------------------------------------------------------- 1 | description "celeryd for chronam" 2 | author "John Scancella " 3 | 4 | start on runlevel [2345] 5 | stop on runlevel [!2345] 6 | 7 | respawn 8 | 9 | post-stop exec sleep 10 10 | 11 | console log 12 | setuid ndnp 13 | setgid ndnp 14 | 15 | script 16 | set -a 17 | export DJANGO_SETTINGS_MODULE=chronam.settings 18 | . /opt/chronam/ENV/bin/activate 19 | django-admin.py celeryd -c 2 --pidfile /var/log/celery/celeryd.pid --logfile /var/log/celery/celeryd.log 20 | end script 21 | -------------------------------------------------------------------------------- /conf/celeryd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=ChronAm celeryd 3 | 4 | [Service] 5 | Type=simple 6 | Restart=on-failure 7 | RestartSec=10s 8 | User=ndnp 9 | Group=ndnp 10 | Environment=DJANGO_SETTINGS_MODULE=chronam.settings 11 | ExecStart=/bin/bash -c ". /opt/chronam/ENV/bin/activate && exec django-admin.py celeryd -c 2 --pidfile /var/log/celery/celeryd.pid --logfile /var/log/celery/celeryd.log" 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /conf/chronam-canonical.conf: -------------------------------------------------------------------------------- 1 | RewriteCond %{HTTP_HOST} !^chroniclingamerica\.loc\.gov [NC] 2 | RewriteCond %{HTTP_HOST} !^ndn02blp\.loc\.gov [NC] 3 | RewriteCond %{HTTP_HOST} !^$ 4 | RewriteRule ^/(.*) https://chroniclingamerica.loc.gov/$1 [redirect,last] 5 | -------------------------------------------------------------------------------- /conf/chronam.pth: -------------------------------------------------------------------------------- 1 | /opt 2 | -------------------------------------------------------------------------------- /conf/chronam.wsgi: -------------------------------------------------------------------------------- 1 | import os, sys 2 | 3 | os.environ['CELERY_LOADER'] = 'django' 4 | os.environ['DJANGO_SETTINGS_MODULE'] = "chronam.settings" 5 | 6 | from django.core.wsgi import get_wsgi_application 7 | application = get_wsgi_application() 8 | 9 | -------------------------------------------------------------------------------- /conf/load_essays_cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /opt/chronam/ 4 | source ENV/bin/activate 5 | 6 | django-admin.py load_essays --settings chronam.settings 2>/dev/null 7 | -------------------------------------------------------------------------------- /core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/__init__.py -------------------------------------------------------------------------------- /core/context_processors.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | 3 | from chronam.core.forms import _fulltext_range 4 | 5 | 6 | def extra_request_info(request): 7 | """ 8 | Add some extra useful stuff into the RequestContext. 9 | """ 10 | fulltext_range = _fulltext_range() 11 | return { 12 | "site_title": "Chronicling America", 13 | "adobe_analytics_url": getattr(settings, "ADOBE_ANALYTICS_URL", None), 14 | "sharetool_url": getattr(settings, "SHARETOOL_URL", None), 15 | "SENTRY_PUBLIC_DSN": getattr(settings, "SENTRY_PUBLIC_DSN", None), 16 | "ENVIRONMENT": getattr( 17 | settings, "ENVIRONMENT", "production" if settings.IS_PRODUCTION else "testing" 18 | ), 19 | "RELEASE": getattr(settings, "RELEASE", "unknown"), 20 | "fulltext_startdate": fulltext_range[0], 21 | "fulltext_enddate": fulltext_range[1], 22 | } 23 | 24 | 25 | def site_navigation(request): 26 | data = {} 27 | 28 | if request.resolver_match: 29 | data["VIEW_NAME"] = request.resolver_match.view_name 30 | data["VIEW_NAME_FOR_CSS"] = data["VIEW_NAME"].replace(":", "--") 31 | 32 | path_components = request.path.strip("/").split("/") 33 | for i, component in enumerate(path_components, start=1): 34 | data["PATH_LEVEL_%d" % i] = component 35 | 36 | return data 37 | -------------------------------------------------------------------------------- /core/feeds/__init__.py: -------------------------------------------------------------------------------- 1 | from newspapers import NewspaperFeedAtom 2 | -------------------------------------------------------------------------------- /core/feeds/newspapers.py: -------------------------------------------------------------------------------- 1 | from django.db.models import Max 2 | from django.contrib.syndication.views import Feed 3 | from django.core.urlresolvers import reverse 4 | from django.utils.feedgenerator import Atom1Feed 5 | 6 | from chronam.core.models import Title 7 | 8 | 9 | class NewspaperFeedAtom(Feed): 10 | title = "Recent Titles from Chronicling America" 11 | subtitle = ( 12 | "This feed lists newspaper titles that have had new content added to them." 13 | ) 14 | feed_type = Atom1Feed 15 | link = "/newspapers/" 16 | feed_guid = "info:lc/ndnp/newspapers" 17 | author_name = "Library of Congress" 18 | author_link = "https://www.loc.gov" 19 | 20 | def items(self): 21 | return ( 22 | Title.objects.filter(has_issues=True, issues__batch__released__isnull=False) 23 | .annotate(last_release=Max("issues__batch__released")) 24 | .order_by("-last_release") 25 | .only("lccn", "publisher", "place_of_publication", "name") 26 | ) 27 | 28 | def item_link(self, item): 29 | return reverse("chronam_title", args=[item.lccn]) 30 | 31 | def item_updateddate(self, item): 32 | return item.last_release 33 | 34 | def item_author_name(self, item): 35 | return item.publisher 36 | 37 | def item_description(self, item): 38 | updated = item.last_release.strftime("%Y-%m-%d") 39 | return "Issues were added on %s for %s" % (updated, item.name) 40 | 41 | def item_title(self, item): 42 | return "Updated content for %s (%s)" % (item.name, item.place_of_publication) 43 | -------------------------------------------------------------------------------- /core/fixtures/awardee.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pk": "curiv", 4 | "model": "core.awardee", 5 | "fields": { 6 | "name": "University of California, Riverside", 7 | "created": "2009-02-09 06:44:45" 8 | } 9 | }, 10 | { 11 | "pk": "dlc", 12 | "model": "core.awardee", 13 | "fields": { 14 | "name": "Library of Congress, Washington, DC", 15 | "created": "2009-02-09 06:44:45" 16 | } 17 | }, 18 | { 19 | "pk": "uuml", 20 | "model": "core.awardee", 21 | "fields": { 22 | "name": "University of Utah, Marriott Library", 23 | "created": "2009-02-09 06:44:45" 24 | } 25 | }, 26 | { 27 | "pk": "iune", 28 | "model": "core.awardee", 29 | "fields": { 30 | "name": "University of Illinois at Urbana-Champaign Library, Urbana, IL", 31 | "created": "2009-02-09 06:44:45" 32 | } 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /core/fixtures/batch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pk": "batch_curiv_ahwahnee_ver01", 4 | "model": "core.batch", 5 | "fields": { 6 | "validated_batch_file": "BATCH_1.xml", 7 | "awardee": "curiv", 8 | "created": "2009-03-26 20:59:28" 9 | } 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /core/fixtures/issue.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pk": 1, 4 | "model": "core.issue", 5 | "fields": { 6 | "title": "sn83030214", 7 | "date_issued": "1898-01-01", 8 | "batch": "batch_curiv_ahwahnee_ver01", 9 | "number": "32", 10 | "volume": "83", 11 | "edition": 1, 12 | "created": "2009-03-26 20:59:28", 13 | "edition_label": "" 14 | } 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /core/fixtures/material_types.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pk": "Online Resource", 4 | "model": "core.materialtype", 5 | "fields": {} 6 | }, 7 | { 8 | "pk": "Microfilm Master", 9 | "model": "core.materialtype", 10 | "fields": {} 11 | }, 12 | { 13 | "pk": "Microfilm Print Master", 14 | "model": "core.materialtype", 15 | "fields": {} 16 | }, 17 | { 18 | "pk": "Microfilm Service Copy", 19 | "model": "core.materialtype", 20 | "fields": {} 21 | }, 22 | { 23 | "pk": "Microform", 24 | "model": "core.materialtype", 25 | "fields": {} 26 | }, 27 | { 28 | "pk": "Original", 29 | "model": "core.materialtype", 30 | "fields": {} 31 | }, 32 | { 33 | "pk": "Unspecified", 34 | "model": "core.materialtype", 35 | "fields": {} 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /core/fixtures/page.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pk": 5551212, 4 | "model": "core.reel", 5 | "fields": { 6 | "number": 5551212, 7 | "batch": "batch_curiv_ahwahnee_ver01", 8 | "created": "2009-03-26 20:59:28" 9 | } 10 | }, 11 | { 12 | "pk": 1, 13 | "model": "core.page", 14 | "fields": { 15 | "created": "2009-03-26 20:59:28", 16 | "jp2_width": 6394, 17 | "sequence": 1, 18 | "jp2_length": 8677, 19 | "number": "", 20 | "tiff_filename": "sn83030214/00175037652/1898010101/0005.tif", 21 | "jp2_filename": "sn83030214/00175037652/1898010101/0005.jp2", 22 | "pdf_filename": "sn83030214/00175037652/1898010101/0005.pdf", 23 | "indexed": 1, 24 | "ocr_filename": "sn83030214/00175037652/1898010101/0005.xml", 25 | "issue": 1, 26 | "section_label": "", 27 | "reel": 5551212 28 | } 29 | } 30 | ] 31 | -------------------------------------------------------------------------------- /core/fixtures/uuml_thys_sample.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | this is a script that dumps an issue from batch batch_uuml_thys_ver01 5 | including all its page and ocr models as a json fixture for testing purposes 6 | """ 7 | 8 | import json 9 | 10 | from django.core import serializers 11 | 12 | from chronam.core.models import OCR, Batch, LanguageText, Reel, Title 13 | 14 | TITLE_ID = "sn83045396" 15 | BATCH_NAME = "batch_uuml_thys_ver01" 16 | 17 | b = Batch.objects.get(name=BATCH_NAME) 18 | i = b.issues.all()[0] 19 | 20 | # create the django json serializer 21 | j = serializers.get_serializer("json")() 22 | 23 | # collect a list of json objects while jumping through hoops to pass 24 | # the serializer a queryset, which it expects instead of instance data 25 | data = [] 26 | data.extend(json.loads(j.serialize(Title.objects.filter(pk=TITLE_ID)))) 27 | data.extend(json.loads(j.serialize(Batch.objects.filter(name=BATCH_NAME)))) 28 | data.extend(json.loads(j.serialize(Reel.objects.filter(pages__issue=i).distinct()))) 29 | data.extend(json.loads(j.serialize(b.issues.filter(id=i.id)))) 30 | data.extend(json.loads(j.serialize(i.pages.all()))) 31 | data.extend(json.loads(j.serialize(OCR.objects.filter(page__issue=i)))) 32 | data.extend(json.loads(j.serialize(LanguageText.objects.filter(ocr__page__issue=i)))) 33 | 34 | # write out the collected objects 35 | open("uuml_thys_sample.json", "w").write(json.dumps(data)) 36 | -------------------------------------------------------------------------------- /core/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chronam.settings") 7 | from django.core.management import execute_from_command_line 8 | 9 | execute_from_command_line(sys.argv) 10 | -------------------------------------------------------------------------------- /core/management/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /core/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from django.core.management.base import BaseCommand 6 | 7 | 8 | class LoggingCommand(BaseCommand): 9 | def execute(self, *args, **options): 10 | verbosity = options.get("verbosity", 0) 11 | 12 | if verbosity > 0: 13 | log_level = logging.DEBUG if verbosity > 1 else logging.INFO 14 | loggers = [logging.getLogger(), logging.getLogger("chronam")] 15 | for logger in loggers: 16 | logger.setLevel(log_level) 17 | for handler in logger.handlers: 18 | handler.setLevel(log_level) 19 | 20 | return super(LoggingCommand, self).execute(*args, **options) 21 | -------------------------------------------------------------------------------- /core/management/commands/batches.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | from chronam.core import models 4 | 5 | from . import LoggingCommand 6 | 7 | 8 | class Command(LoggingCommand): 9 | help = "Displays information about batches" # NOQA: A003 10 | args = '' 11 | 12 | def handle(self, *args, **options): 13 | 14 | for batch in models.Batch.objects.all().order_by('name'): 15 | self.stdout.write(batch.name) 16 | -------------------------------------------------------------------------------- /core/management/commands/commit_index.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from django.conf import settings 4 | from solr import SolrConnection 5 | 6 | from . import LoggingCommand 7 | 8 | 9 | class Command(LoggingCommand): 10 | help = "send a commit message to the solr index" # NOQA: A003 11 | 12 | def handle(self, **options): 13 | solr = SolrConnection(settings.SOLR) 14 | solr.commit() 15 | -------------------------------------------------------------------------------- /core/management/commands/dump_batch_ocr.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | import os 5 | from optparse import make_option 6 | 7 | from django.conf import settings 8 | 9 | from chronam.core.models import Batch, OcrDump 10 | 11 | from . import LoggingCommand 12 | 13 | 14 | class Command(LoggingCommand): 15 | help = 'dump OCR for one or more batches' # NOQA:A003 16 | args = '' 17 | 18 | option_list = LoggingCommand.option_list + ( 19 | make_option('--overwrite', action='store_true', default=False, help='Replace existing OCR dumps'), 20 | ) 21 | 22 | def handle(self, *args, **options): 23 | overwrite = options['overwrite'] 24 | 25 | if not os.path.isdir(settings.OCR_DUMP_STORAGE): 26 | os.makedirs(settings.OCR_DUMP_STORAGE) 27 | 28 | for batch_name in args: 29 | batch = Batch.objects.get(name=batch_name) 30 | logging.info('Starting to dump OCR for batch %s', batch_name) 31 | 32 | if hasattr(batch, 'ocr_dump'): 33 | if overwrite: 34 | logging.info('Deleting existing dump file %s before recreating it', batch.ocr_dump.path) 35 | batch.ocr_dump.delete() 36 | else: 37 | logging.warning( 38 | 'Skipping batch %s because dump %s exists and --overwrite was not specified', 39 | batch_name, 40 | batch.ocr_dump.path, 41 | ) 42 | continue 43 | 44 | dump = OcrDump.new_from_batch(batch) 45 | logging.info('Created OCR dump for batch %s: %s', batch_name, dump) 46 | -------------------------------------------------------------------------------- /core/management/commands/dump_ocr.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | import os 4 | 5 | from django.conf import settings 6 | 7 | from chronam.core.models import Batch 8 | from chronam.core.tasks import dump_ocr 9 | 10 | from . import LoggingCommand 11 | 12 | 13 | class Command(LoggingCommand): 14 | help = "looks for batches that need to have ocr dump files created" # NOQA: A003 15 | 16 | def handle(self, *args, **options): 17 | if not os.path.isdir(settings.OCR_DUMP_STORAGE): 18 | os.makedirs(settings.OCR_DUMP_STORAGE) 19 | 20 | for batch in Batch.objects.filter(ocr_dump__isnull=True): 21 | self.stdout.write(u"queueing %s for ocr dump" % batch) 22 | dump_ocr.delay(batch) 23 | -------------------------------------------------------------------------------- /core/management/commands/dump_page_iiif_urls.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | """ 3 | Dump IIIF Image API base URLs for random pages 4 | """ 5 | 6 | from __future__ import absolute_import, print_function 7 | 8 | from urllib import quote 9 | 10 | from django.conf import settings 11 | 12 | from chronam.core.models import Page 13 | 14 | from . import LoggingCommand 15 | 16 | 17 | class Command(LoggingCommand): 18 | help = __doc__.strip() # NOQA: A003 19 | args = "" 20 | 21 | def handle(self, *args, **options): 22 | if len(args) != 1: 23 | self.stderr.write("Using the first 500 items") 24 | limit = 500 25 | else: 26 | limit = int(args[0]) 27 | 28 | pages = ( 29 | Page.objects.exclude(jp2_filename=None) 30 | .order_by("?") 31 | .values_list("issue__batch__name", "jp2_filename") 32 | ) 33 | 34 | pages = pages[:limit] 35 | 36 | for batch_name, jp2_filename in pages.iterator(): 37 | identifier = quote("%s/data/%s" % (batch_name, jp2_filename), safe="") 38 | self.stdout.write("%s/%s/info.json" % (settings.IIIF_IMAGE_BASE_URL.rstrip("/"), identifier)) 39 | -------------------------------------------------------------------------------- /core/management/commands/ethnicities_with_issues.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | from chronam.core import models 4 | 5 | from . import LoggingCommand 6 | 7 | 8 | class Command(LoggingCommand): 9 | def handle(self, *args, **options): 10 | for e in models.Ethnicity.objects.all(): 11 | self.stdout.write("%s: %s" % (e.name, e.has_issues)) 12 | -------------------------------------------------------------------------------- /core/management/commands/index.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from chronam.core.index import index_pages, index_titles 6 | 7 | from . import LoggingCommand 8 | 9 | LOGGER = logging.getLogger(__name__) 10 | 11 | 12 | class Command(LoggingCommand): 13 | help = "index all titles and pages ; " + "you may (or may not) want to zap_index before" # NOQA: A003 14 | 15 | def handle(self, **options): 16 | 17 | LOGGER.info("indexing titles") 18 | index_titles() 19 | LOGGER.info("finished indexing titles") 20 | 21 | LOGGER.info("indexing pages") 22 | index_pages() 23 | LOGGER.info("finished indexing pages") 24 | -------------------------------------------------------------------------------- /core/management/commands/index_missing_pages.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from chronam.core.index import index_missing_pages 4 | 5 | from . import LoggingCommand 6 | 7 | 8 | class Command(LoggingCommand): 9 | def handle(self, **options): 10 | index_missing_pages() 11 | -------------------------------------------------------------------------------- /core/management/commands/index_pages.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from chronam.core.index import index_pages 4 | 5 | from . import LoggingCommand 6 | 7 | 8 | class Command(LoggingCommand): 9 | def handle(self, **options): 10 | index_pages() 11 | -------------------------------------------------------------------------------- /core/management/commands/index_titles.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from chronam.core.index import index_titles 6 | 7 | from . import LoggingCommand 8 | 9 | LOGGER = logging.getLogger(__name__) 10 | 11 | 12 | class Command(LoggingCommand): 13 | def handle(self, **options): 14 | LOGGER.info("indexing titles") 15 | index_titles() 16 | LOGGER.info("finished indexing titles") 17 | -------------------------------------------------------------------------------- /core/management/commands/load_batch.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | import os 5 | from optparse import make_option 6 | 7 | from django.core.management.base import CommandError 8 | 9 | from chronam.core.batch_loader import BatchLoader 10 | 11 | from . import LoggingCommand 12 | 13 | LOGGER = logging.getLogger(__name__) 14 | 15 | 16 | class Command(LoggingCommand): 17 | option_list = LoggingCommand.option_list + ( 18 | make_option( 19 | "--skip-process-ocr", 20 | action="store_false", 21 | dest="process_ocr", 22 | default=True, 23 | help="Do not generate ocr, and index", 24 | ), 25 | make_option( 26 | "--skip-coordinates", 27 | action="store_false", 28 | dest="process_coordinates", 29 | default=True, 30 | help="Do not out word coordinates", 31 | ), 32 | ) 33 | help = "Load a batch" # NOQA: A003 34 | args = "" 35 | 36 | def handle(self, batch_path, *args, **options): 37 | if len(args) != 0: 38 | raise CommandError("Usage is load_batch %s" % self.args) 39 | 40 | if not os.path.isdir(batch_path): 41 | raise CommandError("Path %s does not exist" % batch_path) 42 | 43 | batch_path = os.path.realpath(batch_path) 44 | 45 | loader = BatchLoader( 46 | process_ocr=options["process_ocr"], process_coordinates=options["process_coordinates"] 47 | ) 48 | 49 | try: 50 | loader.load_batch(batch_path) 51 | except Exception: 52 | LOGGER.exception("Unable to load batch from %s", batch_path) 53 | -------------------------------------------------------------------------------- /core/management/commands/load_batches.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from optparse import make_option 4 | 5 | from django.core.management.base import CommandError 6 | 7 | from chronam.core import batch_loader 8 | 9 | from . import LoggingCommand 10 | 11 | 12 | class Command(LoggingCommand): 13 | option_list = LoggingCommand.option_list + ( 14 | make_option( 15 | '--skip-process-ocr', 16 | action='store_false', 17 | dest='process_ocr', 18 | default=True, 19 | help='Do not generate ocr, and index', 20 | ), 21 | make_option( 22 | '--skip-process-coordinates', 23 | action='store_false', 24 | dest='process_coordinates', 25 | default=True, 26 | help='Do not write out word coordinates', 27 | ), 28 | ) 29 | help = "Load batches by name from a batch list file" # NOQA: A003 30 | args = '' 31 | 32 | def handle(self, batch_list_filename, *args, **options): 33 | if len(args) != 0: 34 | raise CommandError('Usage is load_batch %s' % self.args) 35 | 36 | loader = batch_loader.BatchLoader() 37 | loader.PROCESS_OCR = options['process_ocr'] 38 | loader.PROCESS_COORDINATES = options['process_coordinates'] 39 | 40 | batch_list = open(batch_list_filename) 41 | self.stdout.write("batch_list_filename: %s" % batch_list_filename) 42 | for line in batch_list: 43 | batch_name = line.strip() 44 | self.stdout.write("batch_name: %s" % batch_name) 45 | loader.load_batch(batch_name, strict=False) 46 | -------------------------------------------------------------------------------- /core/management/commands/load_essays.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from django.conf import settings 4 | 5 | from chronam.core.essay_loader import load_essays 6 | 7 | from . import LoggingCommand 8 | 9 | 10 | class Command(LoggingCommand): 11 | help = "load all the essays" # NOQA: A003 12 | 13 | def handle(self, *args, **options): 14 | load_essays(settings.ESSAYS_FEED, index=True) 15 | -------------------------------------------------------------------------------- /core/management/commands/load_holdings.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | import os 5 | 6 | from django.core import management 7 | 8 | from chronam.core import models 9 | from chronam.core.holding_loader import HoldingLoader 10 | from chronam.core.utils.utils import validate_bib_dir 11 | 12 | from . import LoggingCommand 13 | 14 | LOGGER = logging.getLogger(__name__) 15 | 16 | 17 | class Command(LoggingCommand): 18 | help = "Load a holdings records after title records are all loaded" # NOQA: A003 19 | args = '' 20 | 21 | bib_in_settings = validate_bib_dir() 22 | if bib_in_settings: 23 | default_location = bib_in_settings + '/holdings' 24 | else: 25 | default_location = None 26 | 27 | def handle(self, holdings_source=default_location, *args, **options): 28 | 29 | if not os.path.exists(holdings_source): 30 | LOGGER.error("There is no valid holdings source folder defined.") 31 | set_holdings = [ 32 | 'To load holdings - Add a folder called "holdings"', 33 | 'to the bib directory that is set in settings', 34 | 'or pass the location of holdings as an arguement to the loader.', 35 | ] 36 | LOGGER.error(' '.join(set_holdings)) 37 | return 38 | 39 | # First we want to make sure that our material types are up to date 40 | material_types = models.MaterialType.objects.all() 41 | [m.delete() for m in material_types] 42 | management.call_command('loaddata', 'material_types.json') 43 | 44 | holding_loader = HoldingLoader() 45 | holding_loader.main(holdings_source) 46 | -------------------------------------------------------------------------------- /core/management/commands/load_institutions.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import codecs 4 | import csv 5 | 6 | from chronam.core.models import Institution 7 | 8 | from . import LoggingCommand 9 | 10 | 11 | """ 12 | Loads the institutions based on a CSV file in the form of: 13 | , , , , 14 | """ 15 | 16 | 17 | class Command(LoggingCommand): 18 | help = 'loads institution csv data into Institution table' # NOQA: A003 19 | args = '' 20 | 21 | def handle(self, csv_file, *args, **options): 22 | for row in unicode_csv_reader(codecs.open(csv_file, encoding='utf-8')): 23 | i = Institution() 24 | i.code = row[0].upper() 25 | i.name = row[1] 26 | i.address1 = "" 27 | i.address2 = "" 28 | i.city = row[2] 29 | i.state = row[3] 30 | i.zip = row[4] 31 | i.save() 32 | 33 | 34 | # some hoops to get csv reader to emit unicode 35 | # http://www.python.org/doc/2.5.2/lib/csv-examples.html 36 | 37 | 38 | def unicode_csv_reader(unicode_csv_data, dialect=csv.excel, **kwargs): 39 | csv_reader = csv.reader(utf8_encoder(unicode_csv_data), dialect=dialect, **kwargs) 40 | for row in csv_reader: 41 | yield [unicode(cell, 'utf-8') for cell in row] 42 | 43 | 44 | def utf8_encoder(unicode_csv_data): 45 | for line in unicode_csv_data: 46 | yield line.encode('utf-8') 47 | -------------------------------------------------------------------------------- /core/management/commands/make_countries_fixture.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | import urllib 4 | from xml.etree import ElementTree 5 | 6 | from . import LoggingCommand 7 | 8 | try: 9 | import simplejson as json 10 | except ImportError: 11 | import json 12 | 13 | 14 | class Command(LoggingCommand): 15 | help = "loads MARC Country list XML from the web, and dumps JSON fixture to stdout" # NOQA: A003 16 | 17 | def handle(self, *args, **options): 18 | uri = "https://www.loc.gov/standards/codelists/countries.xml" 19 | xml = urllib.urlopen(uri) 20 | doc = ElementTree.parse(xml) 21 | countries = [] 22 | 23 | for country in doc.findall(".//{info:lc/xmlns/codelist-v1}country"): 24 | name = country.findtext("./{info:lc/xmlns/codelist-v1}name") 25 | code = country.findtext("./{info:lc/xmlns/codelist-v1}code") 26 | region = country.findtext("./{info:lc/xmlns/codelist-v1}region") 27 | countries.append( 28 | {"pk": code, "model": "core.countries", "fields": {"name": name, "region": region}} 29 | ) 30 | 31 | self.stdout.write(json.dumps(countries)) 32 | -------------------------------------------------------------------------------- /core/management/commands/optimize_mysql.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | from timeit import default_timer 5 | 6 | from django.db import connection 7 | 8 | from . import LoggingCommand 9 | 10 | LOGGER = logging.getLogger(__name__) 11 | 12 | 13 | class Command(LoggingCommand): 14 | help = "Optimize MySQL tables" # NOQA: A003 15 | 16 | def handle(self, *args, **options): 17 | self.stdout.write("Optimizing MySQL tables") 18 | 19 | tables = [i for i in connection.introspection.table_names() if i.startswith("core_")] 20 | 21 | cursor = connection.cursor() 22 | 23 | for table in tables: 24 | self.stdout.write("Optimizing %s" % table) 25 | 26 | start_time = default_timer() 27 | cursor.execute("OPTIMIZE TABLE %s" % table) 28 | elapsed = default_timer() - start_time 29 | 30 | self.stdout.write("MySQL took %0.3f seconds to optimize %s" % (elapsed, table)) 31 | -------------------------------------------------------------------------------- /core/management/commands/optimize_solr.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | from timeit import default_timer 5 | 6 | from django.conf import settings 7 | from solr import SolrConnection 8 | 9 | from . import LoggingCommand 10 | 11 | LOGGER = logging.getLogger(__name__) 12 | 13 | 14 | class Command(LoggingCommand): 15 | help = "Optimize Solr Index" # NOQA: A003 16 | 17 | def handle(self, *args, **options): 18 | self.stdout.write("Optimizing Solr index %s" % settings.SOLR) 19 | solr = SolrConnection(settings.SOLR) 20 | start_time = default_timer() 21 | solr.optimize() 22 | elapsed = default_timer() - start_time 23 | self.stdout.write("Solr took %0.3f seconds to optimize %s" % (elapsed, settings.SOLR)) 24 | -------------------------------------------------------------------------------- /core/management/commands/process_coordinates.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | import os 5 | 6 | from django.core.management.base import CommandError 7 | 8 | from chronam.core import batch_loader 9 | 10 | from . import LoggingCommand 11 | 12 | LOGGER = logging.getLogger(__name__) 13 | 14 | 15 | class Command(LoggingCommand): 16 | help = "Process word coordinates for a batch by name from a batch list file" # NOQA: A003 17 | args = "" 18 | 19 | def handle(self, batch_list_filename, *args, **options): 20 | if len(args) != 0: 21 | raise CommandError("Usage is process_coordinates %s" % self.args) 22 | 23 | verbosity = options["verbosity"] 24 | 25 | if verbosity > 0: 26 | log_level = logging.DEBUG if verbosity > 1 else logging.INFO 27 | loggers = [logging.getLogger(), logging.getLogger("chronam")] 28 | for logger in loggers: 29 | logger.setLevel(log_level) 30 | for handler in logger.handlers: 31 | handler.setLevel(log_level) 32 | 33 | loader = batch_loader.BatchLoader() 34 | 35 | if os.path.exists(batch_list_filename): 36 | with open(batch_list_filename) as f: 37 | batches = [i.strip() for i in f] 38 | else: 39 | batches = [batch_list_filename] 40 | 41 | LOGGER.info("Processing %d batches from %s", len(batches), batch_list_filename) 42 | 43 | for batch_name in batches: 44 | LOGGER.info("batch_name: %s" % batch_name) 45 | loader.process_coordinates(batch_name) 46 | -------------------------------------------------------------------------------- /core/management/commands/purge_batch.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from django.core.management.base import CommandError 6 | 7 | from chronam.core.batch_loader import BatchLoader, BatchLoaderException 8 | 9 | from . import LoggingCommand 10 | 11 | LOGGER = logging.getLogger(__name__) 12 | 13 | 14 | class Command(LoggingCommand): 15 | help = "Purge a batch" # NOQA: A003 16 | args = "" 17 | 18 | def handle(self, batch_name=None, *args, **options): 19 | if len(args) != 0: 20 | raise CommandError("Usage is purge_batch %s" % self.args) 21 | 22 | loader = BatchLoader() 23 | try: 24 | LOGGER.info("purging batch %s", batch_name) 25 | loader.purge_batch(batch_name) 26 | except BatchLoaderException: 27 | LOGGER.exception("Unable to purge batch %s", batch_name) 28 | raise CommandError("unable to purge batch. check the log for clues") 29 | -------------------------------------------------------------------------------- /core/management/commands/purge_django_cache.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | from optparse import make_option 5 | 6 | from django.core.cache import cache 7 | from django.core.management.base import CommandError 8 | 9 | from . import LoggingCommand 10 | 11 | LOGGER = logging.getLogger(__name__) 12 | 13 | 14 | class Command(LoggingCommand): 15 | purge_all = make_option( 16 | '--all', 17 | action='store_true', 18 | dest='purge_all', 19 | default=False, 20 | help='Purge everything from the django cache', 21 | ) 22 | 23 | option_list = LoggingCommand.option_list + (purge_all,) 24 | help = "Purge the django cache after ingest/purge of a batch" # NOQA: A003 25 | 26 | def handle(self, *args, **options): 27 | try: 28 | if options['purge_all']: 29 | LOGGER.info("clearing the whole django cache") 30 | cache.clear() 31 | else: 32 | # delete the cached newspaper statistics 33 | LOGGER.info('removing newspaper_info from cache') 34 | cache.delete('newspaper_info') 35 | 36 | # delete the advanced search title list 37 | LOGGER.info('removing titles_states from cache') 38 | cache.delete('titles_states') 39 | 40 | # delete the fulltext date range 41 | LOGGER.info('removing fulltext_range') 42 | cache.delete('fulltext_range') 43 | except Exception: 44 | LOGGER.exception('Unable to purge cache') 45 | raise CommandError("unable to purge the cache. check the purge_batch_cache log for clues") 46 | -------------------------------------------------------------------------------- /core/management/commands/purge_essays.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from chronam.core.essay_loader import purge_essay 4 | from chronam.core.models import Essay 5 | 6 | from . import LoggingCommand 7 | 8 | 9 | class Command(LoggingCommand): 10 | help = "purge all the essays" # NOQA: A003 11 | 12 | def handle(self, *args, **options): 13 | for essay in Essay.objects.all(): 14 | purge_essay(essay.essay_editor_url) 15 | -------------------------------------------------------------------------------- /core/management/commands/purge_etitles.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | from cStringIO import StringIO 4 | from optparse import make_option 5 | 6 | import pymarc 7 | 8 | from chronam.core import index 9 | from chronam.core.models import Title 10 | 11 | from . import LoggingCommand 12 | 13 | 14 | class Command(LoggingCommand): 15 | """ 16 | Management command for purging title records which have an 856 field 17 | containing a link to Chronicling America, and which appear to be records 18 | for an electronic only version of a title 245 $h == [electronic resource]. 19 | 20 | The script is careful not to purge any records that have issues attached 21 | to them. See https://rdc.lctl.gov/trac/ndnp/ticket/375 for context. 22 | 23 | If you want to see the records that will be purged use the --pretend 24 | option. 25 | """ 26 | 27 | option_list = LoggingCommand.option_list + ( 28 | make_option('-p', '--pretend', dest='pretend', action='store_true'), 29 | ) 30 | 31 | def handle(self, **options): 32 | for title in Title.objects.filter(urls__value__icontains='chroniclingamerica'): 33 | record = pymarc.parse_xml_to_array(StringIO(title.marc.xml))[0] 34 | if record['245']['h'] == '[electronic resource].': 35 | if options['pretend']: 36 | self.stdout.write(title) 37 | else: 38 | self.stdout.write("deleting %s [%s] from solr index") 39 | index.delete_title(title) 40 | self.stdout.write("purging %s [%s]" % (title, title.lccn)) 41 | title.delete() 42 | if not options['pretend']: 43 | index.commit() 44 | -------------------------------------------------------------------------------- /core/management/commands/queue_load_batch.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | from optparse import make_option 5 | 6 | from django.core.management.base import CommandError 7 | 8 | from chronam.core import tasks 9 | 10 | from . import LoggingCommand 11 | 12 | LOGGER = logging.getLogger(__name__) 13 | 14 | 15 | class Command(LoggingCommand): 16 | option_list = LoggingCommand.option_list + ( 17 | make_option( 18 | '--skip-coordinates', 19 | action='store_false', 20 | dest='process_coordinates', 21 | default=True, 22 | help="Do not generate word coordinates", 23 | ), 24 | ) 25 | help = "queue a batch to be loaded" # NOQA: A003 26 | args = '' 27 | 28 | def handle(self, batch_name, *args, **options): 29 | if len(args) != 0: 30 | raise CommandError('Usage is queue_load_batch %s' % self.args) 31 | try: 32 | tasks.load_batch.delay(batch_name, process_coordinates=options['process_coordinates']) 33 | except Exception: 34 | LOGGER.exception("Error queuing load for batch %s: %s", batch_name) 35 | raise CommandError("unable to queue load batch. check the queue_load_batch log for clues") 36 | -------------------------------------------------------------------------------- /core/management/commands/queue_process_coordinates.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from django.core.management.base import CommandError 6 | 7 | from chronam.core import tasks 8 | 9 | from . import LoggingCommand 10 | 11 | LOGGER = logging.getLogger(__name__) 12 | 13 | 14 | class Command(LoggingCommand): 15 | option_list = LoggingCommand.option_list + () 16 | help = "queue the word coordinates of a batch to be processed" # NOQA: A003 17 | args = '' 18 | 19 | def handle(self, batch_name, *args, **options): 20 | if len(args) != 0: 21 | raise CommandError('Usage is queue_process_coordinates %s' % self.args) 22 | try: 23 | tasks.process_coordinates.delay(batch_name) 24 | except Exception as e: 25 | LOGGER.exception(e) 26 | raise CommandError("unable to process coordinates. check the queue_load_batch log for clues") 27 | -------------------------------------------------------------------------------- /core/management/commands/queue_purge_batch.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from django.core.management.base import CommandError 6 | 7 | from chronam.core import tasks 8 | 9 | from . import LoggingCommand 10 | 11 | LOGGER = logging.getLogger(__name__) 12 | 13 | 14 | class Command(LoggingCommand): 15 | option_list = LoggingCommand.option_list + () 16 | help = "queue a batch to be purged" # NOQA: A003 17 | args = '' 18 | 19 | def handle(self, batch_name, *args, **options): 20 | if len(args) != 0: 21 | raise CommandError('Usage is queue_purge_batch %s' % self.args) 22 | try: 23 | tasks.purge_batch.delay(batch_name) 24 | except Exception as e: 25 | LOGGER.exception(e) 26 | raise CommandError("unable to queue purge batch. check the queue_purge_batch log for clues") 27 | -------------------------------------------------------------------------------- /core/management/commands/reconcile.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | import json 4 | from urllib import urlopen 5 | 6 | from chronam.core.models import Batch 7 | 8 | from . import LoggingCommand 9 | 10 | 11 | class Command(LoggingCommand): 12 | help = "compares batches loaded with the public site" # NOQA: A003 13 | 14 | def handle(self, *args, **options): 15 | url = 'https://chroniclingamerica.loc.gov/batches.json' 16 | missing_batches = [] 17 | missing_pages = [] 18 | while url: 19 | batch_info = json.loads(urlopen(url).read()) 20 | for batch in batch_info['batches']: 21 | self.stdout.write("comparing %(name)s with %(page_count)s pages" % batch) 22 | try: 23 | my_batch = Batch.objects.get(name=batch['name']) 24 | if my_batch.page_count != batch['page_count']: 25 | batch['my_page_count'] = my_batch.page_count 26 | missing_pages.append(batch) 27 | except Batch.DoesNotExist: 28 | missing_batches.append(batch) 29 | url = batch_info.get('next', None) 30 | 31 | if len(missing_batches) > 0: 32 | self.stdout.write("missing batches:") 33 | for batch in missing_batches: 34 | self.stdout.write(" %s" % batch['name']) 35 | self.stdout.write() 36 | 37 | if len(missing_pages) > 0: 38 | self.stdout.write("batches that are missing pages:") 39 | for batch in missing_pages: 40 | self.stdout.write( 41 | " %s has %s instead of %s pages" 42 | % (batch['name'], batch['my_page_count'], batch['page_count']) 43 | ) 44 | self.stdout.write() 45 | -------------------------------------------------------------------------------- /core/management/commands/update_has_issues.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | from chronam.core import models as m 4 | 5 | from . import LoggingCommand 6 | 7 | 8 | class Command(LoggingCommand): 9 | help = "Updates the Title.has_issues property appropriately" # NOQA: A003 10 | 11 | def handle(self, *args, **options): 12 | q = m.Title.objects.filter(pk__in=m.Issue.objects.values("title")) 13 | q = q.distinct() 14 | for t in q: 15 | self.stdout.write(u"%s has issues" % t) 16 | t.has_issues = True 17 | t.save() 18 | -------------------------------------------------------------------------------- /core/management/commands/zap_index.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import optparse 4 | 5 | from django.conf import settings 6 | from solr import SolrConnection 7 | 8 | from . import LoggingCommand 9 | 10 | 11 | class Command(LoggingCommand): 12 | batch_option = optparse.make_option( 13 | '--batch', action='store', dest='batch', help='the batch name for pages you want to purge from index' 14 | ) 15 | option_list = LoggingCommand.option_list + (batch_option,) 16 | help = ( # NOQA: A003 17 | "remove all documents, or only documents related to a particular batch from the solr index" 18 | ) 19 | args = 'an optional batch' 20 | 21 | def handle(self, **options): 22 | solr = SolrConnection(settings.SOLR) 23 | if options['batch']: 24 | solr.delete_query('batch: %s' % options['batch']) 25 | else: 26 | solr.delete_query('id:[* TO *]') 27 | solr.commit() 28 | -------------------------------------------------------------------------------- /core/middleware.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | import logging 3 | import os 4 | 5 | from django.conf import settings 6 | from django.http import HttpResponse 7 | 8 | from chronam.core.utils.utils import add_cache_tag 9 | 10 | 11 | class CloudflareCacheHeader(object): 12 | def process_response(self, request, response): 13 | return add_cache_tag(response, "project=chronam") 14 | 15 | 16 | class HttpResponseServiceUnavailable(HttpResponse): 17 | status_code = 503 18 | 19 | 20 | class TooBusyMiddleware(object): 21 | BUSY_MESSAGE = u""" 22 | 23 | 24 | 25 | 26 | Server Too Busy — Chronicling America (The Library of Congress) 27 | 28 | 29 |
30 |

Server Too Busy

31 |
32 |

33 | The Chronicling America server is currently too busy to serve your request. 34 | Please try your request again shortly. 35 |

36 |

37 | 38 | 39 | 40 |

41 |
42 |
43 | 44 | 45 | """.strip() 46 | 47 | def process_request(self, request): 48 | # FIXME: this adds per-request file I/O which could be removed by 49 | # calling the Linux-specific sysinfo() call directly or simply by removing 50 | # it and letting Varnish handle erroring backends at that level 51 | 52 | try: 53 | one, five, fifteen = os.getloadavg() 54 | too_busy = one > settings.TOO_BUSY_LOAD_AVERAGE 55 | except OSError: 56 | logging.exception("os.getloadavg() failed!") 57 | too_busy = True 58 | 59 | if too_busy: 60 | return HttpResponseServiceUnavailable(self.BUSY_MESSAGE) 61 | -------------------------------------------------------------------------------- /core/migrations/0002_auto_20160405_0900.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='page', 16 | name='indexed', 17 | field=models.BooleanField(default=False), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /core/migrations/0003_auto_20160928_0840.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0002_auto_20160405_0900'), 11 | ] 12 | 13 | operations = [ 14 | migrations.RemoveField( 15 | model_name='topic', 16 | name='category', 17 | ), 18 | migrations.RemoveField( 19 | model_name='topicpages', 20 | name='page', 21 | ), 22 | migrations.RemoveField( 23 | model_name='topicpages', 24 | name='topic', 25 | ), 26 | migrations.DeleteModel( 27 | name='Topic', 28 | ), 29 | migrations.DeleteModel( 30 | name='TopicCategory', 31 | ), 32 | migrations.DeleteModel( 33 | name='TopicPages', 34 | ), 35 | ] 36 | -------------------------------------------------------------------------------- /core/migrations/0004_auto_20170712_1312.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0003_auto_20160928_0840'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='page', 16 | name='section_label', 17 | field=models.CharField(max_length=250), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /core/migrations/0005_remove_languagetext_text.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0004_auto_20170712_1312'), 11 | ] 12 | 13 | operations = [ 14 | migrations.RemoveField( 15 | model_name='languagetext', 16 | name='text', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /core/migrations/0006_auto_20180116_1142.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0005_remove_languagetext_text'), 11 | ] 12 | 13 | operations = [ 14 | migrations.RemoveField( 15 | model_name='batch', 16 | name='sitemap_indexed', 17 | ), 18 | migrations.RemoveField( 19 | model_name='title', 20 | name='sitemap_indexed', 21 | ), 22 | migrations.AlterField( 23 | model_name='essay', 24 | name='loaded', 25 | field=models.DateTimeField(auto_now=True), 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /core/migrations/0007_index_issue_titles_with_dates.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0006_auto_20180116_1142'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterIndexTogether( 15 | name='issue', 16 | index_together=set([('title', 'date_issued')]), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /core/migrations/0008_auto_20211130_1437.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('core', '0007_index_issue_titles_with_dates'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='issuenote', 16 | name='text', 17 | field=models.TextField(default=b'', blank=True), 18 | ), 19 | migrations.AlterField( 20 | model_name='note', 21 | name='text', 22 | field=models.TextField(default=b'', blank=True), 23 | ), 24 | migrations.AlterField( 25 | model_name='pagenote', 26 | name='text', 27 | field=models.TextField(default=b'', blank=True), 28 | ), 29 | migrations.AlterField( 30 | model_name='physicaldescription', 31 | name='text', 32 | field=models.TextField(default=b'', blank=True), 33 | ), 34 | migrations.AlterField( 35 | model_name='publicationdate', 36 | name='text', 37 | field=models.CharField(default=b'', max_length=500, blank=True), 38 | ), 39 | ] 40 | 41 | -------------------------------------------------------------------------------- /core/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/migrations/__init__.py -------------------------------------------------------------------------------- /core/sitemaps.py: -------------------------------------------------------------------------------- 1 | from django.contrib import sitemaps 2 | 3 | from chronam.core.models import Batch, Issue, Page, Title 4 | 5 | 6 | class BatchesSitemap(sitemaps.Sitemap): 7 | changefreq = "daily" 8 | 9 | def items(self): 10 | return Batch.objects.all() 11 | 12 | def lastmod(self, batch): 13 | return batch.released 14 | 15 | def location(self, batch): 16 | return batch.url 17 | 18 | 19 | class IssuesSitemap(sitemaps.Sitemap): 20 | changefreq = "daily" 21 | 22 | def items(self): 23 | return Issue.objects.prefetch_related("title") 24 | 25 | def lastmod(self, issue): 26 | return issue.created 27 | 28 | def location(self, issue): 29 | return issue.url 30 | 31 | 32 | class PagesSitemap(sitemaps.Sitemap): 33 | changefreq = "daily" 34 | # Reduce the number of pages from the default 50,0000 to reduce the size of 35 | # some of the database queries: 36 | limit = 10000 37 | 38 | def items(self): 39 | return Page.objects.order_by("pk").prefetch_related("issue", "issue__title") 40 | 41 | def lastmod(self, page): 42 | return page.created 43 | 44 | def location(self, page): 45 | return page.url 46 | 47 | 48 | class TitlesSitemap(sitemaps.Sitemap): 49 | changefreq = "daily" 50 | 51 | def items(self): 52 | return Title.objects.filter(has_issues=True) 53 | 54 | def lastmod(self, title): 55 | return title.created 56 | 57 | def location(self, title): 58 | return title.url 59 | -------------------------------------------------------------------------------- /core/static/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /core/static/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /core/static/css/ca_reports.css: -------------------------------------------------------------------------------- 1 | /* */ -------------------------------------------------------------------------------- /core/static/css/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/css/loading.gif -------------------------------------------------------------------------------- /core/static/css/tablesort.css: -------------------------------------------------------------------------------- 1 | table.tablesorter { border-collapse:collapse; } 2 | 3 | table.tablesorter td, table.tablesorter th { 4 | border-left: 1px solid #ccc 5 | } 6 | 7 | table.tablesorter .left_no_border { 8 | border-left: None 9 | } 10 | 11 | table.tablesorter tbody tr.odd td { 12 | background-color:#fdfeee; 13 | } 14 | 15 | table.tablesorter thead tr .header { 16 | background-image: url(../images/bg.gif); 17 | background-repeat: no-repeat; 18 | background-position: left center; 19 | cursor: pointer; 20 | padding-left: 20px; 21 | } 22 | 23 | table.tablesorter thead tr .headerSortUp { 24 | background-image: url(../images/asc.gif); 25 | } 26 | 27 | table.tablesorter thead tr .headerSortDown { 28 | background-image: url(../images/desc.gif); 29 | } 30 | -------------------------------------------------------------------------------- /core/static/images/asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/asc.gif -------------------------------------------------------------------------------- /core/static/images/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/bg.gif -------------------------------------------------------------------------------- /core/static/images/calendar_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/calendar_icon.gif -------------------------------------------------------------------------------- /core/static/images/desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/desc.gif -------------------------------------------------------------------------------- /core/static/images/fullpage_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/fullpage_grouphover.png -------------------------------------------------------------------------------- /core/static/images/fullpage_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/fullpage_hover.png -------------------------------------------------------------------------------- /core/static/images/fullpage_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/fullpage_pressed.png -------------------------------------------------------------------------------- /core/static/images/fullpage_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/fullpage_rest.png -------------------------------------------------------------------------------- /core/static/images/home_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/home_grouphover.png -------------------------------------------------------------------------------- /core/static/images/home_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/home_hover.png -------------------------------------------------------------------------------- /core/static/images/home_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/home_pressed.png -------------------------------------------------------------------------------- /core/static/images/home_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/home_rest.png -------------------------------------------------------------------------------- /core/static/images/item_btn_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/item_btn_next.png -------------------------------------------------------------------------------- /core/static/images/item_btn_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/item_btn_prev.png -------------------------------------------------------------------------------- /core/static/images/item_clip_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/item_clip_icon.png -------------------------------------------------------------------------------- /core/static/images/next_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/next_grouphover.png -------------------------------------------------------------------------------- /core/static/images/next_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/next_hover.png -------------------------------------------------------------------------------- /core/static/images/next_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/next_pressed.png -------------------------------------------------------------------------------- /core/static/images/next_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/next_rest.png -------------------------------------------------------------------------------- /core/static/images/previous_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/previous_grouphover.png -------------------------------------------------------------------------------- /core/static/images/previous_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/previous_hover.png -------------------------------------------------------------------------------- /core/static/images/previous_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/previous_pressed.png -------------------------------------------------------------------------------- /core/static/images/previous_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/previous_rest.png -------------------------------------------------------------------------------- /core/static/images/tab-prime-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/tab-prime-bg.png -------------------------------------------------------------------------------- /core/static/images/tab-prime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/tab-prime.png -------------------------------------------------------------------------------- /core/static/images/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/tab.png -------------------------------------------------------------------------------- /core/static/images/tab2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/tab2.png -------------------------------------------------------------------------------- /core/static/images/ui-anim_basic_16x16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-anim_basic_16x16.gif -------------------------------------------------------------------------------- /core/static/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /core/static/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /core/static/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /core/static/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /core/static/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /core/static/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /core/static/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /core/static/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /core/static/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /core/static/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /core/static/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /core/static/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /core/static/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /core/static/images/zoomin_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomin_grouphover.png -------------------------------------------------------------------------------- /core/static/images/zoomin_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomin_hover.png -------------------------------------------------------------------------------- /core/static/images/zoomin_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomin_pressed.png -------------------------------------------------------------------------------- /core/static/images/zoomin_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomin_rest.png -------------------------------------------------------------------------------- /core/static/images/zoomout_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomout_grouphover.png -------------------------------------------------------------------------------- /core/static/images/zoomout_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomout_hover.png -------------------------------------------------------------------------------- /core/static/images/zoomout_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomout_pressed.png -------------------------------------------------------------------------------- /core/static/images/zoomout_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/static/images/zoomout_rest.png -------------------------------------------------------------------------------- /core/static/js/search.js: -------------------------------------------------------------------------------- 1 | /* globals $ */ 2 | 3 | var ChronAmSearch = {}; 4 | 5 | (function() { 6 | var highlightNoiseRegEx = new RegExp( 7 | /^[/.,/#!$%^&*;:{}=\-_`~()]+|[/.,/#!$%^&*;:{}=\-_`~()]+$|'s$/ 8 | ); 9 | ChronAmSearch.highlightNoiseRegEx = highlightNoiseRegEx; 10 | 11 | ChronAmSearch.matchWords = function(searchWords, all_coordinates) { 12 | var matchedWords = []; 13 | 14 | $.each(searchWords.split(" "), function(index, word) { 15 | // don't do anything if the word is blank 16 | if (word) { 17 | word = word.toLocaleLowerCase().trim(); 18 | 19 | for (var word_on_page in all_coordinates["coords"]) { 20 | var match_word = word_on_page 21 | .toLocaleLowerCase() 22 | .replace(highlightNoiseRegEx, " ") 23 | .replace(/\s+/, " ") 24 | .trim(); 25 | 26 | if ( 27 | match_word === word && 28 | matchedWords.indexOf(word_on_page) < 0 29 | ) { 30 | matchedWords.push(word_on_page); 31 | } 32 | } 33 | } 34 | }); 35 | return matchedWords; 36 | }; 37 | })(); 38 | -------------------------------------------------------------------------------- /core/templates/404.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base_alt.html" %} 2 | 3 | {% block sub_page_head %} 4 |

Not Found

5 | {% endblock %} 6 | 7 | {% block box-tabs %} 8 | {% endblock %} 9 | 10 | {% block subcontent %} 11 |
12 |
13 | Requested resource could not be found. 14 |
15 |
16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /core/templates/500.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base_alt.html" %} 2 | 3 | {% block sub_page_head %} 4 |

Unexpected Error

5 | {% endblock %} 6 | 7 | {% block box-tabs %} 8 | {% endblock %} 9 | 10 | {% block subcontent %} 11 |
12 |
13 | Chronicling America has encountered an unexpected error while 14 | processing your request. The details of this error have been 15 | logged, and our troubleshooting specialists will be notified. We 16 | apologize for any inconvenience. 17 |
18 |
19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /core/templates/base.html: -------------------------------------------------------------------------------- 1 | {% extends "site.html" %} 2 | 3 | {% load static from staticfiles %} 4 | {% load humanize %} 5 | 6 | {% block head_content %}{{ block.super }}{% block lc_metadata %}{% endblock lc_metadata %} 7 | 9 | 11 | 12 | 13 | 14 | {% block extrahead %}{% endblock extrahead %}{% endblock head_content %} 15 | 16 | {% block content %}{% block page_head_container %}{% block page_head %}{% block sub_page_head %}{% if page_title %} 17 |

{{ page_title }}

{% endif %}{% endblock sub_page_head %}{% endblock page_head%}{% endblock page_head_container %} 18 |
19 | {% block main_content %}{% endblock main_content %} 20 |
{% block subcontent %}{% endblock subcontent %}{% endblock content %} 21 | -------------------------------------------------------------------------------- /core/templates/disclaimer.html: -------------------------------------------------------------------------------- 1 | {% load static from staticfiles %} 2 |
3 | 4 |
5 | -------------------------------------------------------------------------------- /core/templates/holdings.html: -------------------------------------------------------------------------------- 1 | {% extends "newspaper.html" %} 2 | 3 | {% load static from staticfiles %} 4 | 5 | {% block newspaper_content %} 6 | 7 | {% if not holdings %} 8 |

No holding information available.

9 | 10 |

Check OCLC WorldCat for more information on this title.

11 | 12 | {% endif %} 13 | 14 | {% regroup holdings by institution as inst_holdings %} 15 | 16 | {% for inst_holding in inst_holdings %} 17 | {% if not forloop.first %} 18 |
19 | {% endif %} 20 |
21 |

HOLDING: {{inst_holding.grouper.name}}, {{inst_holding.grouper.city}}, {{inst_holding.grouper.state}}

22 | 23 |

24 | 25 | View more titles from this institution 26 |

27 | 28 | {% for holding in inst_holding.list %} 29 |

Available as: {% if holding.type %}{{ holding.type }}{% else %}Unspecified{% endif %}

30 | 31 | {% if holding.notes %} 32 |

{{ holding.notes }}

33 | {% endif %} 34 | 35 | {% if holding.description %} 36 |

Dates:

37 |
    38 | {% for description in holding.description_as_list %} 39 |
  • {{ description }}
  • 40 | {% endfor %} 41 |
42 | {% endif %} 43 |

Last updated: {{ holding.last_updated }}

44 | {% endfor %} 45 |
46 | {% endfor %} 47 | 48 | 49 |
50 |

51 | Top 52 |

53 |
54 | {% endblock %} 55 | -------------------------------------------------------------------------------- /core/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base.html" %} 2 | 3 | {% load static from staticfiles %} 4 | {% load humanize %} 5 | 6 | {% block content %} 7 |
8 |
9 |

100 Years Ago Today

10 |

{{ date|date:"F j, Y" }} ({{pages|length}})

11 |
12 | 23 |
24 |
25 | {% endblock content %} 26 | 27 | 28 | {% block javascript %}{{ block.super }} 29 | 34 | {% endblock %} 35 | -------------------------------------------------------------------------------- /core/templates/includes/disclaimer.html: -------------------------------------------------------------------------------- 1 | {% load static from staticfiles %} 2 |
3 | 4 |
5 | -------------------------------------------------------------------------------- /core/templates/includes/issue_frontpages_ctrl.html: -------------------------------------------------------------------------------- 1 | {% load static from staticfiles %} 2 | 3 |
4 | Back to Browse All Available Issues 5 | | Show all front pages 6 | {% if paginator.num_pages > 1 %} 7 | 8 | | 9 | {% if paginator_page.has_previous %} 10 | 13 | {% endif %} 14 | {% for page_number in page_range_short %} 15 | {% if not forloop.first %}|{% endif %} 16 | {% ifequal page_number "..." %} 17 | ... 18 | {% else %} 19 | 20 | {% ifequal page_number paginator_page.number %} 21 | {{page_number}} 22 | {% else %} 23 | {{page_number}} 24 | {% endifequal %} 25 | 26 | {% endifequal %} 27 | 28 | {% endfor %} 29 | 30 | {% if paginator_page.has_next %} 31 | 33 | {% endif %} 34 | 35 |
36 | 37 | 38 |
39 | {% endif %} 40 |
41 | -------------------------------------------------------------------------------- /core/templates/includes/tabs.html: -------------------------------------------------------------------------------- 1 | {% load custom_filters %} 2 | {% load static from staticfiles %} 3 | {% load humanize %} 4 | 5 |
6 | 11 | 12 |
13 | 33 | 34 |
...
35 |
36 |
37 | 46 | -------------------------------------------------------------------------------- /core/templates/issues.html: -------------------------------------------------------------------------------- 1 | {% extends "newspaper.html" %} 2 | 3 | {% block lc_metadata %} 4 | {% include "includes/lc_metadata.html" %} 5 | {% endblock %} 6 | 7 | {% block javascript %} 8 | {{ block.super }} 9 | 25 | {% endblock %} 26 | 27 | {% block extra_nav %} 28 |
29 |
30 |   {{select_year_form.year}} 31 |
32 | 33 |

Show all front pages

34 |

Single edition:
dates in bold.

35 |

Multiple editions:
dates in bold italics.

36 |
37 | {% endblock %} 38 | 39 | {% block newspaper_content %} 40 |
41 | {{year_view|safe}} 42 |
43 | {% endblock %} 44 | -------------------------------------------------------------------------------- /core/templates/marc.html: -------------------------------------------------------------------------------- 1 | {% extends "newspaper.html" %} 2 | 3 | {% load static from staticfiles %} 4 | 5 | {% block extrahead %} 6 | {{ block.super }} 7 | 10 | 11 | {% endblock %} 12 | 13 | {% block newspaper_content %} 14 | 15 | {% autoescape off %} 16 | {{title.marc.html}} 17 | {% endautoescape %} 18 | 19 |
20 | 21 |
22 | 23 | 24 | 25 |
26 | 27 |
28 | 29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /core/templates/newspapers.txt: -------------------------------------------------------------------------------- 1 | Persistent Link | State | Title | LCCN | OCLC | ISSN | No. of Issues | First Issue Date | Last Issue Date | More Info 2 | {% for state, titles in newspapers_by_state %} 3 | {% for title in titles %}{{ request.scheme }}://{{host}}{% url 'chronam_issues' title.lccn %} | {{state}} | {{title}} | {{title.lccn|default:""}} | {{title.oclc|default:""}} | {{title.issn|default:""}} | {{title.issues.count}} | {{title.first}} | {{title.last}} | {% if title.has_essays %}{{ request.scheme }}://{{host}}{% url 'chronam_title_essays' title.lccn %}{% endif %} 4 | {% endfor %}{% endfor %} 5 | -------------------------------------------------------------------------------- /core/templates/page_print.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base.html" %} 2 | 3 | {% block content %} 4 |

5 | 6 |

7 | 8 |

Image provided by {{ issue.batch.awardee.name }}

9 |

Persistent link: https://{{ host }}{{ url }}

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /core/templates/page_text.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base_alt.html" %} 2 | {% load static from staticfiles %} 3 | 4 | {% block subcontent %} 5 | 6 |
7 |

8 | Below is the OCR text representation 9 | for this newspapers page. It is also available as 10 | plain text as well as 11 | XML. 12 |

13 |
14 | 15 |
16 | {{page.ocr.text|escape}} 17 |
18 | 19 |

20 | {% endblock %} 21 | 22 | -------------------------------------------------------------------------------- /core/templates/reports/awardee.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load humanize %} 3 | 4 | {% block extra_link_types %} 5 | 6 | 7 | {% endblock %} 8 | 9 | 10 | {% block subcontent %} 11 | 12 |

Below is some summary information about contributions to Chronicling America 13 | from the NDNP Awardee, {{ awardee }}. Summary information about all awardees is also available.

14 | 15 |

Batches

16 | 17 | 18 | 19 | 20 | 21 | 22 | {% for batch in batches %} 23 | 24 | 25 | 26 | 27 | 28 | {% endfor %} 29 |
IngestedBatch NameTotal Pages
{{batch.created }}{{ batch.name }}{{ batch.page_count|intcomma }}
30 | 31 |
32 | 33 | {% if awardee.essays.all.count > 0 %} 34 |

Essays

35 | 36 | 37 | 38 | 39 | {% for essay in awardee.essays.all %} 40 | 41 | 42 | 43 | 44 | {% endfor %} 45 |
Essay TitleCreated
{{ essay.title }}{{ essay.created|date }}
46 | {% endif %} 47 | 48 | {% endblock %} 49 | -------------------------------------------------------------------------------- /core/templates/reports/awardees.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load humanize %} 3 | 4 | {% block subcontent %} 5 | 6 |

7 | Below is a list of NDNP Awardees that have content in the Chronicling 8 | America Web Application. Clicking on the name will bring you to a 9 | detail page for the awardee, and clicking on the organization code will 10 | perform a search of the MARC Organization database. 11 |

12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {% for awardee in awardees %} 22 | 23 | 24 | 29 | 34 | 37 | 40 | 41 | 42 | {% endfor %} 43 | 44 |
NameMARC Organization CodeTotal PagesTotal Essays
25 | 26 | {{ awardee.name }} 27 | 28 | 30 | 31 | {{ awardee.org_code }} 32 | 33 | 35 | {{ awardee.page_count|intcomma }} 36 | 38 | {{ awardee.essays.count|intcomma }} 39 |
45 | 46 |
47 | 48 | {% endblock %} 49 | -------------------------------------------------------------------------------- /core/templates/reports/batch_summary.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | 3 | {% block subcontent %} 4 | 5 |

6 | This report is also available as a 7 | comma separated text file. 8 |

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {% for row in batch_details %} 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {% endfor %} 29 | 30 |
Batch NameLCCNEarliestLatestPages
{{ row.0 }}{{ row.1 }}{{ row.2 }}{{ row.3 }}{{ row.4 }}
31 | 32 |
33 | 34 | {% endblock %} 35 | -------------------------------------------------------------------------------- /core/templates/reports/batch_summary.txt: -------------------------------------------------------------------------------- 1 | Batch Name, LCCN, Earliest, Latest, Pages 2 | {% for row in batch_details %}{{ row|join:"," }} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /core/templates/reports/batches.xml: -------------------------------------------------------------------------------- 1 | {% load custom_filters %} 2 | 3 | 4 | NDNP Batches 5 | 6 | 7 | info:lc/ndnp/batches 8 | 9 | Library of Congress 10 | http://loc.gov 11 | 12 | {{ now }} 13 | {% if page.has_previous %}{% endif %} 14 | {% if page.has_next %}{% endif %} 15 | 16 | {% for batch in page.object_list %} 17 | 18 | {{batch.name}} 19 | 20 | 21 | 22 | info:lc/ndnp/batch/{{batch.name}} 23 | 24 | {{batch.awardee.name}} 25 | {{ request.scheme }}://{{ request.get_host }}{% url 'chronam_awardee' batch.awardee.org_code %} 26 | 27 | {% if batch.released %}{{ batch.released|rfc3339 }}{% else %}{{ batch.created|rfc3339 }}{% endif %} 28 | 29 | {% endfor %} 30 | 31 | 32 | -------------------------------------------------------------------------------- /core/templates/reports/cities.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load custom_filters %} 3 | 4 | {% block extra_link_types %} 5 | {% if county %} 6 | 7 | {% else %} 8 | 9 | {% endif %} 10 | {% endblock %} 11 | 12 | {% block subcontent %} 13 | 14 |
15 |
16 |
17 | 18 | {% for city in cities %} 19 | 20 | 21 | 22 | {% endfor %} 23 |
{{city}}
24 |
25 |
26 |
27 | 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /core/templates/reports/counties.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load custom_filters %} 3 | 4 | {% block extra_link_types %} 5 | 6 | {% endblock %} 7 | 8 | {% block subcontent %} 9 | 10 |
11 |
12 |
13 | 14 | {% for county in counties %} 15 | 16 | 17 | 18 | {% endfor %} 19 |
{{county}}
20 |
21 |
22 |
23 | 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /core/templates/reports/essay.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | 3 | {% block subcontent %} 4 | {{essay.html|safe}} 5 | 6 |

7 | Provided by: {{ essay.creator }} 8 |

9 | 10 | {% endblock %} 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /core/templates/reports/essays.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | 3 | {% block subcontent %} 4 | 5 |

6 | Below is a list of essays provided by NDNP Awardees about newspapers that 7 | are available in Chronicling America. 8 |

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {% for essay in essays %} 17 | 18 | 21 | 22 | 23 | 24 | {% endfor %} 25 |
Essay TitleCreatorCreated
19 | {{ essay.title }} 20 | {{ essay.creator.name }}{{ essay.created|date }}
26 | 27 | {% endblock %} 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /core/templates/reports/events.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load static from staticfiles %} 3 | 4 | {% block subcontent %} 5 | 6 | {% ifnotequal paginator.num_pages 1 %} 7 |
8 | 30 |
31 | 32 | {% endifnotequal %} 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | {% for event in page.object_list %} 44 | 45 | 46 | 55 | 56 | 57 | {% endfor %} 58 | 59 |
TimeBatch NameMessage
{{ event.created }} 47 | {% if event.get_batch %} 48 | 49 | {{ event.batch_name }} 50 | 51 | {% else %} 52 | {{ event.batch_name }} 53 | {% endif %} 54 | {{ event.message }}
60 | 61 | {% endblock %} 62 | -------------------------------------------------------------------------------- /core/templates/reports/events.xml: -------------------------------------------------------------------------------- 1 | {% load custom_filters %} 2 | 3 | 4 | Chronicling America Events 5 | 6 | 7 | info:lc/ndnp/events 8 | 9 | Library of Congress 10 | http://loc.gov 11 | 12 | {{ now }} 13 | {% if page.has_previous %}{% endif %} 14 | {% if page.has_next %}{% endif %} 15 | 16 | {% for event in page.object_list %} 17 | 18 | {{event.batch_name}} Event 19 | info:lc/ndnp/event/{{ event.id }} 20 | Library of Congress 21 | {{ event.created|rfc3339 }} 22 | {{ event.message }} 23 | 24 | {% endfor %} 25 | 26 | 27 | -------------------------------------------------------------------------------- /core/templates/reports/institution.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | 3 | {% block subcontent %} 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
Name{{institution.name}}
Address 14 | {% if institution.address1 %} 15 | {{institution.address1}}
16 | {% endif %} 17 | {% if institution.address2 %} 18 | {{institution.address2}}
19 | {% endif %} 20 | {% if institution.city %} 21 | {{institution.city}}
22 | {% endif %} 23 | {% if institution.state %} 24 | {{institution.state}}
25 | {% endif %} 26 | {% if institution.zip %} 27 | {{institution.zip}} 28 | {% endif %} 29 |
OCLC Institution Code{{ institution.code }}
Total Titles{{ titles_count }}
Total Holdings{{ holdings_count }}
44 |
45 | 46 | {% endblock %} 47 | -------------------------------------------------------------------------------- /core/templates/reports/institutions.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load static from staticfiles %} 3 | 4 | 5 | {% block subcontent %} 6 | 7 | {% ifnotequal paginator.num_pages 1 %} 8 | 31 | 32 | {% endifnotequal %} 33 | 34 |
35 | 36 | 37 | 38 | {% for institution in page.object_list %} 39 | 40 | 43 | 44 | {% endfor %} 45 |
41 | {{ institution }} 42 |
46 |
47 | 48 | {% endblock %} 49 | -------------------------------------------------------------------------------- /core/templates/reports/language_batches.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load static from staticfiles %} 3 | 4 | {% block subcontent %} 5 | 6 | {% ifnotequal paginator.num_pages 1 %} 7 |
8 | 30 |
31 | 32 | {% endifnotequal %} 33 | 34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | {% for batch in page.object_list %} 45 | 46 | {% if batch %} 47 | 48 | 49 | 50 | 51 | {% endif %} 52 | 53 | {% endfor %} 54 | 55 |
BatchNumber of {{ language_name }} Pages
{{ batch.name }}{{ batch.count }}
56 | 57 |
58 | 59 | {% endblock %} 60 | -------------------------------------------------------------------------------- /core/templates/reports/language_titles.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load static from staticfiles %} 3 | 4 | {% block subcontent %} 5 | 6 | {% ifnotequal paginator.num_pages 1 %} 7 |
8 | 30 |
31 | 32 | {% endifnotequal %} 33 | 34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | {% for title in page.object_list %} 45 | 46 | {% if title %} 47 | 48 | 49 | 50 | 51 | {% endif %} 52 | 53 | {% endfor %} 54 | 55 |
TitlesNumber of {{ language_name }} Pages
{{ title.lccn }}{{ title.count }}
56 | 57 |
58 | 59 | {% endblock %} 60 | -------------------------------------------------------------------------------- /core/templates/reports/languages.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | 3 | {% block subcontent %} 4 | 5 |

6 | Below is a list of languages found in newspaper text that are available in Chronicling America. 7 |

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {% for l in languages %} 18 | 19 | 22 | 25 | 32 | 39 | 42 | 43 | {% endfor %} 44 |
LanguageCodeBatchesTitlePage Count
20 | {{ l.language__name }} 21 | 23 | {{ l.language__code }} 24 | 26 | {% ifequal l.language__code 'eng' %} 27 | batches 28 | {% else %} 29 | batches 30 | {% endifequal %} 31 | 33 | {% ifequal l.language__code 'eng' %} 34 | titles 35 | {% else %} 36 | titles 37 | {% endifequal %} 38 | 40 | {{ l.count }} 41 |
45 | 46 | {% endblock %} 47 | -------------------------------------------------------------------------------- /core/templates/reports/ocr.xml: -------------------------------------------------------------------------------- 1 | {% load custom_filters %} 2 | 3 | 4 | Chronicling America OCR Data Feed 5 | 6 | info:lc/ndnp/ocr 7 | 8 | Library of Congress 9 | http://loc.gov 10 | 11 | {{ last_updated|rfc3339 }} 12 | 13 | {% for dump in dumps %} 14 | 15 | {{ dump.name }} 16 | 17 | info:lc/ndnp/dump/ocr/{{ dump.name }} 18 | {{ dump.created|rfc3339 }} 19 | 20 |
OCR dump file {{ dump.name }} with size {{ dump.size|filesizeformat }} generated {{ dump.created }}
21 |
22 |
23 | {% endfor %} 24 | 25 |
26 | -------------------------------------------------------------------------------- /core/templates/reports/pages_on_flickr.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | 3 | {% block subcontent %} 4 | 5 |

6 | Periodically pages are selected by curators for upload to Flickr. This report 7 | summarizes which pages have been uploaded. It is periodically updated using the 8 | Flickr API. The last update ran at {{ last_update }}. 9 |

10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {% for flickr_url in flickr_urls %} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {% endfor %} 30 | 31 |
PageFlickr URLHarvested
{{ flickr_url.page }}{{ flickr_url }}{{ flickr_url.created }}
32 | 33 |
34 | 35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /core/templates/reports/reel.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load humanize %} 3 | 4 | {% block subcontent %} 5 | 6 |
7 | 8 |

Summary Information

9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {% for reel in reels %} 19 | 20 | 25 | 30 | 31 | 32 | {% endfor %} 33 | 34 |
BatchTitleDate Range
21 | 22 | {{ reel.batch.name }} 23 | 24 | 26 | {% for title in reel.titles %} 27 | {{ title.display_name }} ({{title.lccn}}) 28 | {% endfor %} 29 | {{ reel.title_range }}
35 | 36 |
37 | 38 | {% endblock %} 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /core/templates/reports/reels.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load static from staticfiles %} 3 | 4 | {% block subcontent %} 5 | 6 | {% ifnotequal paginator.num_pages 1 %} 7 |
8 | 30 |
31 | 32 | {% endifnotequal %} 33 | 34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | {% for reel in page.object_list %} 46 | 47 | {% if reel.number %} 48 | 49 | 50 | 51 | 56 | 57 | {% endif %} 58 | 59 | {% endfor %} 60 | 61 |
Reel NumberTitlesBatch
{{ reel.number }}{% for title in reel.titles %}{{ title.display_name }}{% endfor %} 52 | 53 | {{ reel.batch.name }} 54 | 55 |
62 | 63 |
64 | 65 | {% endblock %} 66 | -------------------------------------------------------------------------------- /core/templates/reports/states.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load custom_filters %} 3 | 4 | {% block subcontent %} 5 | 6 |
7 | 8 |
9 |
10 |
11 | 12 | {% for state in states %} 13 | 14 | 17 | 20 | 23 | 24 | {% endfor %} 25 |
15 | {{state}} 16 | 18 | counties 19 | 21 | cities 22 |
26 |
27 |
28 |
29 |
30 | 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /core/templates/reports/states_counties.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | 3 | {% block extra_link_types %} 4 | 5 | {% endblock %} 6 | 7 | {% block subcontent %} 8 | 9 |
10 |
11 |
12 | 13 | {% for state, county, total in states_counties %} 14 | 15 | 16 | 17 | 18 | 19 | {% endfor %} 20 |
{{state}}{{county}}{{total}}
21 |
22 |
23 |
24 | 25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /core/templates/reports/status.html: -------------------------------------------------------------------------------- 1 | {% extends "reports/reports.html" %} 2 | {% load humanize %} 3 | 4 | {% block subcontent %} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
Batches modeled{{ batch_count|intcomma }}
Titles modeled{{ title_count|intcomma }}
Issues modeled{{ issue_count|intcomma }}
Pages modeled{{ page_count|intcomma }}
Holdings modeled{{ holding_count|intcomma }}
Essays modeled{{ essay_count|intcomma }}
Titles indexed{{ titles_indexed|intcomma }}
Pages indexed*{{ pages_indexed|intcomma }}
40 | 41 |
42 | 43 |

44 | (*) discrepancy between pages modeled and pages indexed is due to duplicate 45 | pages (same lccn, date, edition, sequence) in the database, which are 46 | collapsed down in the solr index 47 |

48 | 49 | 50 | {% endblock %} 51 | -------------------------------------------------------------------------------- /core/templates/search_pages_opensearch.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | Chronicling America Pages Search 6 | Search digital newspaper content from the Library of Congress 7 | UTF-8 8 | https://www.loc.gov/favicon.ico 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /core/templates/search_pages_results.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base.html" %} 2 | {% load static from staticfiles %} 3 | {% load custom_filters %} 4 | 5 | {% block content %} 6 | 7 |
8 |
9 |
10 | 32 |
33 | 34 |
35 | 36 |
    37 | {% for object in page.object_list %} 38 |
  • 39 | 40 | 45 | 46 |
  • 47 | {% endfor %} 48 |
49 | 50 |
51 | 52 | 53 | {% endblock %} 54 | 55 | 56 | {% block javascript %} 57 | {{ block.super }} 58 | 59 | 60 | {% endblock %} 61 | -------------------------------------------------------------------------------- /core/templates/search_pages_results.xml: -------------------------------------------------------------------------------- 1 | {% load custom_filters %} 2 | 4 | 5 | Chronicling America Page Search Results 6 | 7 | {{feed_url}} 8 | {{updated}} 9 | {{paginator.count}} 10 | {{page.start_index}} 11 | 10 12 | 13 | {% if previous_url %}{% endif %} 14 | {% if next_url %}{% endif %} 15 | 16 | {% for p in page.object_list %} 17 | 18 | {{ p }} 19 | 20 | info:lc/ndnp{{ p.url }} 21 | 22 | {{ request.scheme }}://{{host}}{% url 'chronam_awardee' p.issue.batch.awardee.org_code %} 23 | {{ p.issue.batch.awardee.name }} 24 | 25 | {{p.created|rfc3339}} 26 | 27 |
28 | 29 |
30 |
31 |
32 | {% endfor %} 33 | 34 |
35 | -------------------------------------------------------------------------------- /core/templates/search_titles_opensearch.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | Chronicling America Titles 6 | Search Chronicling America Titles 7 | UTF-8 8 | https://www.loc.gov/favicon.ico 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /core/templates/search_titles_results.xml: -------------------------------------------------------------------------------- 1 | {% load custom_filters %} 2 | 3 | Chronicling America Title Search Results 4 | 5 | {{feed_url}} 6 | {{updated}} 7 | {{paginator.count}} 8 | {{page.start_index}} 9 | 50 10 | 11 | {% if previous_url %}{% endif %} 12 | {% if next_url %}{% endif %} 13 | 14 | {% for title in page.object_list %} 15 | 16 | {{title.display_name}} 17 | 18 | info:lccn/{{title.lccn}} 19 | Library of Congress 20 | {{title.created|rfc3339}} 21 | 22 | {% endfor %} 23 | 24 | 25 | -------------------------------------------------------------------------------- /core/templates/site_base.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | -------------------------------------------------------------------------------- /core/templates/site_base_alt.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base.html" %} 2 | -------------------------------------------------------------------------------- /core/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/templatetags/__init__.py -------------------------------------------------------------------------------- /core/templatetags/custom_filters.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | 3 | from rfc3339 import rfc3339 4 | 5 | from chronam.core.utils import url 6 | from chronam.core.utils.utils import label 7 | 8 | 9 | register = template.Library() 10 | 11 | 12 | @register.filter(name='rfc3339') 13 | def rfc3339_filter(d): 14 | return rfc3339(d) 15 | 16 | 17 | @register.filter(name='pack_url') 18 | def pack_url(value, default='-'): 19 | return url.pack_url_path(value, default) 20 | 21 | 22 | @register.filter(name='label') 23 | def _label(value): 24 | return label(value) 25 | -------------------------------------------------------------------------------- /core/tests/__init__.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from api_tests import * 4 | from batch_loader_tests import * 5 | from browse_tests import * 6 | from essay_loader_tests import * 7 | from holding_loader_tests import * 8 | from index_tests import * 9 | from jp2_tests import * 10 | from json_tests import * 11 | from ocr_dump_tests import * 12 | from ocr_extractor_tests import * 13 | from rdf_tests import * 14 | from system_tests import * 15 | from title_loader_tests import * 16 | from title_pull_tests import * 17 | 18 | logging.basicConfig(filename="test.log", level=logging.DEBUG) 19 | -------------------------------------------------------------------------------- /core/tests/holding_loader_tests.py: -------------------------------------------------------------------------------- 1 | import os.path 2 | 3 | from django.test import TestCase 4 | 5 | from chronam.core.models import Title 6 | from chronam.core.title_loader import TitleLoader 7 | from chronam.core.holding_loader import HoldingLoader 8 | 9 | import chronam.core 10 | 11 | 12 | class HoldingLoaderTests(TestCase): 13 | fixtures = ['countries.json', 'languages.json', 'institutions.json'] 14 | 15 | def test_holdings(self): 16 | # title data 17 | titlexml = os.path.join(os.path.dirname(chronam.core.__file__), 18 | 'test-data', 'title.xml') 19 | 20 | # holdings data 21 | holdingsxml = os.path.join(os.path.dirname(chronam.core.__file__), 22 | 'test-data', 'holdings.xml') 23 | 24 | # first need to load the titles so we can link against them 25 | title_loader = TitleLoader() 26 | title_loader.load_file(titlexml) 27 | 28 | # now load the holdings from the same file 29 | holding_loader = HoldingLoader() 30 | holding_loader.load_file(holdingsxml) 31 | 32 | # fetch the title and see that holdings are attached 33 | t = Title.objects.get(lccn='sn83030846') 34 | holdings = list(t.holdings.all()) 35 | self.assertEqual(len(holdings), 10) 36 | h = holdings[1] 37 | self.assertEqual(h.institution.name, 'Colgate Univ') 38 | self.assertEqual(h.type, 'Original') 39 | self.assertEqual(h.description, '<1876:5:18> <1884:1:10> <1885:9:3>') 40 | self.assertEqual(h.description_as_list(), [u'<1876:5:18>', u'<1884:1:10>', u'<1885:9:3>']) 41 | self.assertEqual(str(h.last_updated), '01/1992') 42 | -------------------------------------------------------------------------------- /core/tests/json_tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | try: 4 | import simplejson as json 5 | except ImportError: 6 | import json 7 | 8 | from chronam.core import models as m 9 | 10 | 11 | class JsonTests(TestCase): 12 | fixtures = ['batch.json', "awardee.json"] 13 | 14 | def test_speedups(self): 15 | # simplejson needs to have c bits comiled to be fast enough 16 | self.assertTrue(json._speedups) 17 | 18 | def test_batch(self): 19 | b = m.Batch.objects.get(name='batch_curiv_ahwahnee_ver01') 20 | j = b.json() 21 | x = json.loads(j) 22 | self.assertEqual(x['name'], 'batch_curiv_ahwahnee_ver01') 23 | -------------------------------------------------------------------------------- /core/tests/ocr_extractor_tests.py: -------------------------------------------------------------------------------- 1 | from os.path import dirname, join 2 | 3 | from django.test import TestCase 4 | 5 | from chronam.core.ocr_extractor import ocr_extractor 6 | 7 | 8 | class OcrExtractorTests(TestCase): 9 | 10 | def test_extractor(self): 11 | dir = join(dirname(dirname(__file__)), 'test-data') 12 | ocr_file = join(dir, 'ocr.xml') 13 | text, coord_info = ocr_extractor(ocr_file) 14 | coords = coord_info["coords"] 15 | expected_text = {"eng": file(join(dir, 'ocr.txt')).read().decode('utf-8')} 16 | 17 | self.assertEqual(text, expected_text) 18 | self.assertEqual(len(coords.keys()), 2489) 19 | self.assertEqual(len(coords['place']), 3) 20 | -------------------------------------------------------------------------------- /core/tests/system_tests.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | import django 4 | from django.test import TestCase 5 | 6 | 7 | class SystemTests(TestCase): 8 | 9 | def test_django_version(self): 10 | self.assert_(django.get_version() >= '1.8.12') 11 | 12 | def test_python_version(self): 13 | self.assert_(sys.version_info[0:3] >= (2, 7, 6)) 14 | -------------------------------------------------------------------------------- /core/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # __init__.py 2 | 3 | from django.utils import datetime_safe 4 | 5 | 6 | def strftime(d, fmt): 7 | """works with datetimes with years less than 1900 8 | """ 9 | return datetime_safe.new_datetime(d).strftime(fmt) 10 | -------------------------------------------------------------------------------- /core/utils/url.py: -------------------------------------------------------------------------------- 1 | from urllib import quote, unquote 2 | 3 | 4 | def quote_underscore(s, safe=''): 5 | if ' ' in s: 6 | s = quote(s, safe + ' ') 7 | return s.replace(' ', '_') 8 | return quote(s, safe) 9 | 10 | 11 | def unquote_underscore(s): 12 | """unquote('%7e/abc_def') -> '~/abc def'""" 13 | s = s.replace('_', ' ') 14 | return unquote(s) 15 | 16 | 17 | def pack_url_path(value, none='-'): 18 | if value is None: 19 | value = none 20 | value = value.lower() 21 | if isinstance(value, unicode): 22 | value = value.encode('utf-8') 23 | return quote_underscore(value) 24 | 25 | 26 | def unpack_url_path(path, none='-'): 27 | if path == none: 28 | return None 29 | return unquote_underscore(path) 30 | -------------------------------------------------------------------------------- /core/views/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | import home 4 | import image 5 | from browse import ( 6 | issue_pages, 7 | issue_pages_rdf, 8 | issues, 9 | issues_first_pages, 10 | page, 11 | page_jp2, 12 | page_ocr, 13 | page_ocr_txt, 14 | page_ocr_xml, 15 | page_pdf, 16 | page_print, 17 | page_rdf, 18 | page_words, 19 | title, 20 | title_atom, 21 | title_essays, 22 | title_holdings, 23 | title_marc, 24 | title_marcxml, 25 | title_rdf, 26 | titles, 27 | titles_in_city, 28 | titles_in_county, 29 | titles_in_state, 30 | ) 31 | from directory import newspapers, newspapers_rdf, search_titles_results 32 | from reports import ( 33 | awardee, 34 | awardee_json, 35 | awardee_rdf, 36 | awardees, 37 | awardees_json, 38 | batch, 39 | batch_json, 40 | batch_rdf, 41 | batch_summary, 42 | batches, 43 | batches_atom, 44 | batches_csv, 45 | batches_json, 46 | cities_in_county, 47 | cities_in_state, 48 | counties_in_state, 49 | essay, 50 | essays, 51 | events, 52 | events_atom, 53 | events_csv, 54 | institution, 55 | institution_titles, 56 | institutions, 57 | issue_pages_json, 58 | language_batches, 59 | language_pages, 60 | language_titles, 61 | languages, 62 | ocr, 63 | ocr_atom, 64 | ocr_json, 65 | page_json, 66 | pages_on_flickr, 67 | reel, 68 | reels, 69 | reports, 70 | states, 71 | states_counties, 72 | status, 73 | terms, 74 | title_json, 75 | total_page_count, 76 | ) 77 | from search import ( 78 | search_advanced, 79 | search_pages_navigation, 80 | search_pages_opensearch, 81 | search_pages_results, 82 | search_titles, 83 | search_titles_opensearch, 84 | suggest_titles, 85 | ) 86 | from static import about, about_api, help 87 | -------------------------------------------------------------------------------- /core/worldcat_overrides/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/core/worldcat_overrides/__init__.py -------------------------------------------------------------------------------- /core/worldcat_overrides/request.py: -------------------------------------------------------------------------------- 1 | import urllib2 2 | import urllib 3 | 4 | from worldcat.request.search import SRURequest 5 | 6 | # SRURequestV2 class was created to replace the existing SRURequest class in WorldCat that has an incorrect API URL which is causing 7 | # breakage with our pull_titles.py script. This class is a copy of the existing SRURequest class with the exception of the api_url() 8 | # method which has been updated to use the correct API URL. This class should be removed once the WorldCat API is fixed. 9 | # http_get is also overidden to include User-Agent in request to prevent OCLC API from missclassifying our requests as spam. 10 | class SRURequestV2(SRURequest): 11 | def api_url(self): 12 | # Updated URL to use the correct API URL 13 | self.url = 'https://worldcat.org/webservices/catalog/search/worldcat/sru' 14 | 15 | def http_get(self): 16 | """HTTP Get method for all WorldCatRequests.""" 17 | self.api_url() 18 | _query_url = '%s?%s' % (self.url, urllib.urlencode(self.args)) 19 | # Added User-Agent to request to prevent OCLC API from missclassifying our requests as spam. 20 | request = urllib2.Request(_query_url, headers={'User-Agent' : "ChroniclingAmerica +https://github.com/LibraryOfCongress/chronam"}) 21 | self.response = urllib2.urlopen(request).read() 22 | -------------------------------------------------------------------------------- /example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/example/__init__.py -------------------------------------------------------------------------------- /example/screenshots/screenshot-issues.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/example/screenshots/screenshot-issues.jpg -------------------------------------------------------------------------------- /example/screenshots/screenshot-splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/example/screenshots/screenshot-splash.jpg -------------------------------------------------------------------------------- /example/static/images/dbrunton.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/example/static/images/dbrunton.jpeg -------------------------------------------------------------------------------- /loc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/__init__.py -------------------------------------------------------------------------------- /loc/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /loc/static/css/ca_ie.css: -------------------------------------------------------------------------------- 1 | /* 2 | Project: loc.gov 3 | Variant: ie6 and 7 screen 4 | Date: 01 Apr 2010 5 | ----------------------------------------*/ 6 | 7 | #content, 8 | #main_body, 9 | .fix-float { 10 | height:1%; 11 | } 12 | #left_nav ul, 13 | #left_nav ol, 14 | #left_nav dl { 15 | position: relative; 16 | } 17 | ul.tabnav li { 18 | overflow: hidden; 19 | } 20 | a.external { 21 | /*display:inline-block; 22 | zoom:1;*/ 23 | } 24 | 25 | /******************** 26 | footer 27 | ********************/ 28 | #footer .f_container, 29 | #footer .f_inner_mid, 30 | #footer .f_inner_bot { 31 | height:1%; 32 | } 33 | -------------------------------------------------------------------------------- /loc/static/css/ca_reports.css: -------------------------------------------------------------------------------- 1 | 2 | /* report table */ 3 | table { 4 | margin: 0; 5 | width: auto; 6 | padding: 0; 7 | } 8 | table.data { 9 | background-color: #d7c9b0; 10 | margin: 0 auto 0 10px; 11 | padding: 0; 12 | border-collapse: collapse; 13 | width: 95%; 14 | } 15 | 16 | table.data th { 17 | background-color: #fbf9ee; 18 | border: 1px solid #ccc; 19 | } 20 | 21 | table.data tr { 22 | height: 30px; 23 | } 24 | 25 | table.data tr.lightGray { 26 | background-color: #eee; 27 | } 28 | 29 | table.data tr.white { 30 | background-color: #fff; 31 | } 32 | 33 | table.data td { 34 | font: verdana, helvetica, sans-serif; 35 | padding: 5px; 36 | border: 1px solid #ccc; 37 | vertical-align: top; 38 | color: #333333; 39 | } 40 | 41 | table.data td.label { 42 | font-weight: bold; 43 | } 44 | 45 | /* search results */ 46 | 47 | table.search_results td { 48 | padding: 15px; 49 | font-size: smaller; 50 | } 51 | -------------------------------------------------------------------------------- /loc/static/css/ca_reset.css: -------------------------------------------------------------------------------- 1 | /********************* 2 | RESET 3 | *********************/ 4 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { 5 | margin: 0; 6 | padding: 0; 7 | border: 0; 8 | outline: 0; 9 | font-size: 100%; 10 | font-family: inherit; 11 | vertical-align: baseline; 12 | } 13 | /*:focus { 14 | outline: 0; 15 | }*/ 16 | body { 17 | color: black; 18 | width:100%; 19 | height:100%; 20 | } 21 | table { 22 | border-collapse: separate; 23 | border-spacing: 0; 24 | } 25 | caption, th, td { 26 | text-align: left; 27 | } 28 | blockquote:before, blockquote:after, 29 | q:before, q:after { 30 | content: ""; 31 | } 32 | blockquote, q { 33 | quotes: "" ""; 34 | } 35 | /* Additions */ 36 | body{ 37 | font-size: 100.01%;/*Opera fix*/ 38 | } -------------------------------------------------------------------------------- /loc/static/images/bg_item_ctrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/bg_item_ctrl.png -------------------------------------------------------------------------------- /loc/static/images/btn_browse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/btn_browse.png -------------------------------------------------------------------------------- /loc/static/images/btn_browse_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/btn_browse_sel.png -------------------------------------------------------------------------------- /loc/static/images/btn_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/btn_go.png -------------------------------------------------------------------------------- /loc/static/images/btn_submit_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/btn_submit_bg.gif -------------------------------------------------------------------------------- /loc/static/images/btn_usnews.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/btn_usnews.png -------------------------------------------------------------------------------- /loc/static/images/btn_usnews_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/btn_usnews_sel.png -------------------------------------------------------------------------------- /loc/static/images/btn_x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/btn_x.gif -------------------------------------------------------------------------------- /loc/static/images/center.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/center.gif -------------------------------------------------------------------------------- /loc/static/images/divider_neh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/divider_neh.png -------------------------------------------------------------------------------- /loc/static/images/dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/dot.gif -------------------------------------------------------------------------------- /loc/static/images/dot_v.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/dot_v.gif -------------------------------------------------------------------------------- /loc/static/images/fullpage_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/fullpage_grouphover.png -------------------------------------------------------------------------------- /loc/static/images/fullpage_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/fullpage_hover.png -------------------------------------------------------------------------------- /loc/static/images/fullpage_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/fullpage_pressed.png -------------------------------------------------------------------------------- /loc/static/images/fullpage_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/fullpage_rest.png -------------------------------------------------------------------------------- /loc/static/images/home_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/home_grouphover.png -------------------------------------------------------------------------------- /loc/static/images/home_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/home_hover.png -------------------------------------------------------------------------------- /loc/static/images/home_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/home_pressed.png -------------------------------------------------------------------------------- /loc/static/images/home_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/home_rest.png -------------------------------------------------------------------------------- /loc/static/images/i_clip_download.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/i_clip_download.gif -------------------------------------------------------------------------------- /loc/static/images/i_clip_print.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/i_clip_print.gif -------------------------------------------------------------------------------- /loc/static/images/i_home_flickr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/i_home_flickr.jpg -------------------------------------------------------------------------------- /loc/static/images/i_home_highlights.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/i_home_highlights.jpg -------------------------------------------------------------------------------- /loc/static/images/i_home_newsboy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/i_home_newsboy.jpg -------------------------------------------------------------------------------- /loc/static/images/i_view_browse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/i_view_browse.png -------------------------------------------------------------------------------- /loc/static/images/i_view_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/i_view_list.png -------------------------------------------------------------------------------- /loc/static/images/icon-ext-gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/icon-ext-gray.gif -------------------------------------------------------------------------------- /loc/static/images/item_dot_divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/item_dot_divider.png -------------------------------------------------------------------------------- /loc/static/images/item_text_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/item_text_icon.png -------------------------------------------------------------------------------- /loc/static/images/left-img-head.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/left-img-head.gif -------------------------------------------------------------------------------- /loc/static/images/leftnav.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/leftnav.jpg -------------------------------------------------------------------------------- /loc/static/images/line2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/line2.gif -------------------------------------------------------------------------------- /loc/static/images/logo_chron_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/logo_chron_top.png -------------------------------------------------------------------------------- /loc/static/images/logo_loc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/logo_loc.gif -------------------------------------------------------------------------------- /loc/static/images/logo_loc_cobrand.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/logo_loc_cobrand.gif -------------------------------------------------------------------------------- /loc/static/images/logo_neh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/logo_neh.gif -------------------------------------------------------------------------------- /loc/static/images/logo_neh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/logo_neh.png -------------------------------------------------------------------------------- /loc/static/images/next_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/next_grouphover.png -------------------------------------------------------------------------------- /loc/static/images/next_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/next_hover.png -------------------------------------------------------------------------------- /loc/static/images/next_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/next_page.gif -------------------------------------------------------------------------------- /loc/static/images/next_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/next_pressed.png -------------------------------------------------------------------------------- /loc/static/images/next_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/next_rest.png -------------------------------------------------------------------------------- /loc/static/images/no_thumbnail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/no_thumbnail.gif -------------------------------------------------------------------------------- /loc/static/images/pag_next_off.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/pag_next_off.gif -------------------------------------------------------------------------------- /loc/static/images/pag_next_on.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/pag_next_on.gif -------------------------------------------------------------------------------- /loc/static/images/pag_prev_off.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/pag_prev_off.gif -------------------------------------------------------------------------------- /loc/static/images/pag_prev_on.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/pag_prev_on.gif -------------------------------------------------------------------------------- /loc/static/images/prev_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/prev_page.gif -------------------------------------------------------------------------------- /loc/static/images/previous_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/previous_grouphover.png -------------------------------------------------------------------------------- /loc/static/images/previous_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/previous_hover.png -------------------------------------------------------------------------------- /loc/static/images/previous_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/previous_pressed.png -------------------------------------------------------------------------------- /loc/static/images/previous_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/previous_rest.png -------------------------------------------------------------------------------- /loc/static/images/red_60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/red_60.png -------------------------------------------------------------------------------- /loc/static/images/table_dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/table_dot.gif -------------------------------------------------------------------------------- /loc/static/images/table_dot_first.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/table_dot_first.gif -------------------------------------------------------------------------------- /loc/static/images/table_dot_last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/table_dot_last.gif -------------------------------------------------------------------------------- /loc/static/images/transparent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/transparent.gif -------------------------------------------------------------------------------- /loc/static/images/xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/xml.png -------------------------------------------------------------------------------- /loc/static/images/zoomin_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomin_grouphover.png -------------------------------------------------------------------------------- /loc/static/images/zoomin_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomin_hover.png -------------------------------------------------------------------------------- /loc/static/images/zoomin_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomin_pressed.png -------------------------------------------------------------------------------- /loc/static/images/zoomin_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomin_rest.png -------------------------------------------------------------------------------- /loc/static/images/zoomout_grouphover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomout_grouphover.png -------------------------------------------------------------------------------- /loc/static/images/zoomout_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomout_hover.png -------------------------------------------------------------------------------- /loc/static/images/zoomout_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomout_pressed.png -------------------------------------------------------------------------------- /loc/static/images/zoomout_rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/images/zoomout_rest.png -------------------------------------------------------------------------------- /loc/static/img-foot/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/Thumbs.db -------------------------------------------------------------------------------- /loc/static/img-foot/arrow-dbl-gray-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/arrow-dbl-gray-right.gif -------------------------------------------------------------------------------- /loc/static/img-foot/facebook.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/facebook.gif -------------------------------------------------------------------------------- /loc/static/img-foot/flickr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/flickr.gif -------------------------------------------------------------------------------- /loc/static/img-foot/icon-ext-foot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/icon-ext-foot.gif -------------------------------------------------------------------------------- /loc/static/img-foot/line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/line.gif -------------------------------------------------------------------------------- /loc/static/img-foot/speech.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/speech.gif -------------------------------------------------------------------------------- /loc/static/img-foot/twitter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/twitter.gif -------------------------------------------------------------------------------- /loc/static/img-foot/youtube.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-foot/youtube.gif -------------------------------------------------------------------------------- /loc/static/img-head/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/Thumbs.db -------------------------------------------------------------------------------- /loc/static/img-head/ask.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/ask.gif -------------------------------------------------------------------------------- /loc/static/img-head/btns-about.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/btns-about.gif -------------------------------------------------------------------------------- /loc/static/img-head/btns-asklib.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/btns-asklib.gif -------------------------------------------------------------------------------- /loc/static/img-head/btns-help.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/btns-help.gif -------------------------------------------------------------------------------- /loc/static/img-head/catalog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/catalog.gif -------------------------------------------------------------------------------- /loc/static/img-head/digitalcoll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/digitalcoll.gif -------------------------------------------------------------------------------- /loc/static/img-head/line-top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/line-top.gif -------------------------------------------------------------------------------- /loc/static/img-head/line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/line.gif -------------------------------------------------------------------------------- /loc/static/img-head/loc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/loc.gif -------------------------------------------------------------------------------- /loc/static/img-head/logo-ca.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/logo-ca.gif -------------------------------------------------------------------------------- /loc/static/img-head/logo-loc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/logo-loc.gif -------------------------------------------------------------------------------- /loc/static/img-head/logo-neh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/logo-neh.gif -------------------------------------------------------------------------------- /loc/static/img-head/rule.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/rule.gif -------------------------------------------------------------------------------- /loc/static/img-head/vert_dots.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-head/vert_dots.gif -------------------------------------------------------------------------------- /loc/static/img-std/arrow-dbl-gray-left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/arrow-dbl-gray-left.gif -------------------------------------------------------------------------------- /loc/static/img-std/arrow-dbl-gray-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/arrow-dbl-gray-right.gif -------------------------------------------------------------------------------- /loc/static/img-std/arrow-dbl-left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/arrow-dbl-left.gif -------------------------------------------------------------------------------- /loc/static/img-std/arrow-dbl-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/arrow-dbl-right.gif -------------------------------------------------------------------------------- /loc/static/img-std/btn-input-clear.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/btn-input-clear.gif -------------------------------------------------------------------------------- /loc/static/img-std/btn-input-continue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/btn-input-continue.gif -------------------------------------------------------------------------------- /loc/static/img-std/btn-input-go.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/btn-input-go.gif -------------------------------------------------------------------------------- /loc/static/img-std/btn-input-reset.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/btn-input-reset.gif -------------------------------------------------------------------------------- /loc/static/img-std/btn-input-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/btn-input-search.gif -------------------------------------------------------------------------------- /loc/static/img-std/btn-input-submit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/btn-input-submit.gif -------------------------------------------------------------------------------- /loc/static/img-std/bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/bullet.gif -------------------------------------------------------------------------------- /loc/static/img-std/bullet_blue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/bullet_blue.gif -------------------------------------------------------------------------------- /loc/static/img-std/bullet_blue_dash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/bullet_blue_dash.gif -------------------------------------------------------------------------------- /loc/static/img-std/dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/dot.gif -------------------------------------------------------------------------------- /loc/static/img-std/dot_v.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/dot_v.gif -------------------------------------------------------------------------------- /loc/static/img-std/dotted-h1-bot-rh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/dotted-h1-bot-rh.gif -------------------------------------------------------------------------------- /loc/static/img-std/dotted-h1-bot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/dotted-h1-bot.gif -------------------------------------------------------------------------------- /loc/static/img-std/dotted-h1-top-rh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/dotted-h1-top-rh.gif -------------------------------------------------------------------------------- /loc/static/img-std/dotted-h1-top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/dotted-h1-top.gif -------------------------------------------------------------------------------- /loc/static/img-std/fav.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/fav.ico -------------------------------------------------------------------------------- /loc/static/img-std/get_adobe_reader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/get_adobe_reader.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_arrow.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_arrow_down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_arrow_down.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_arrow_grey.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_arrow_grey.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_arrow_o.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_arrow_o.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_arrow_up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_arrow_up.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_audio.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_audio.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_audio2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_audio2.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_backtotop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_backtotop.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_backtotop_g.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_backtotop_g.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_disclaimer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_disclaimer.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_enlarge.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_enlarge.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_external.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_external.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_gallery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_gallery.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_grid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_grid.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_list.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_list.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_newwindow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_newwindow.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_permalink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_permalink.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_podcast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_podcast.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_print.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_print.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_rss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_rss.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_slideshow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_slideshow.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_video.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_video.gif -------------------------------------------------------------------------------- /loc/static/img-std/i_video2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/i_video2.gif -------------------------------------------------------------------------------- /loc/static/img-std/ph_bot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/ph_bot.gif -------------------------------------------------------------------------------- /loc/static/img-std/ph_bot2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/ph_bot2.gif -------------------------------------------------------------------------------- /loc/static/img-std/ph_top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/ph_top.gif -------------------------------------------------------------------------------- /loc/static/img-std/ph_top2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/ph_top2.gif -------------------------------------------------------------------------------- /loc/static/img-std/slideshow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/slideshow.gif -------------------------------------------------------------------------------- /loc/static/img-std/speech.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/img-std/speech.gif -------------------------------------------------------------------------------- /loc/static/next-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/next-horizontal.png -------------------------------------------------------------------------------- /loc/static/next-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/next-vertical.png -------------------------------------------------------------------------------- /loc/static/prev-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/prev-horizontal.png -------------------------------------------------------------------------------- /loc/static/prev-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc/static/prev-vertical.png -------------------------------------------------------------------------------- /loc/templates/page_print.html: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | {% load static from staticfiles %} 3 | {% url 'chronam_page' title.lccn page.issue.date_issued page.issue.edition page.sequence as url %} 4 | {% endspaceless %} 5 | 6 | 7 | Chronicling America - The Library of Congress 8 | 9 | 10 | {% if adobe_analytics_url %} 11 | 12 | {% endif %} 13 | 14 | 15 |
16 |

{{ page_title }}

17 |

Image provided by {{ issue.batch.awardee.name }}

18 |

Persistent link: https://{{ host }}{{ url }}

19 | 30 |
31 |

32 | 33 |

34 |
35 | 36 | 37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /loc/templates/search_pages_results_list.html: -------------------------------------------------------------------------------- 1 | {% extends "search_pages_results.html" %} 2 | 3 | {% load static from staticfiles %} 4 | {% load custom_filters %} 5 | 6 | {% block search_results_box %} 7 | 8 | {% ifequal paginator.count 0 %} 9 |

No Results

10 | {% else %} 11 | 18 |
19 |

20 | Top 21 |

22 |
23 | {% endifequal %} 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /loc/templates/site_base_alt.html: -------------------------------------------------------------------------------- 1 | {% extends "site_base.html" %} 2 | 3 | {% block left_bits %} 4 | 26 | {% endblock left_bits %} 27 | 28 | {% block page_head_container %} 29 | {% endblock %} 30 | 31 | {% block sub_page_head %} 32 | 37 | {% endblock %} 38 | 39 | {% block subcontent %} 40 | {% endblock subcontent %} 41 | 42 | {% block non_main_content %} 43 | {% endblock %} 44 | -------------------------------------------------------------------------------- /loc/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | 5 | Replace this with more appropriate tests for your application. 6 | """ 7 | 8 | from django.test import TestCase 9 | 10 | 11 | class SimpleTest(TestCase): 12 | def test_basic_addition(self): 13 | """ 14 | Tests that 1 + 1 always equals 2. 15 | """ 16 | self.assertEqual(1 + 1, 2) 17 | -------------------------------------------------------------------------------- /loc/views.py: -------------------------------------------------------------------------------- 1 | # Create your views here. 2 | -------------------------------------------------------------------------------- /loc_cts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/loc_cts/__init__.py -------------------------------------------------------------------------------- /loc_cts/management/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /loc_cts/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from django.core.management.base import BaseCommand 6 | 7 | 8 | class LoggingCommand(BaseCommand): 9 | def execute(self, *args, **options): 10 | verbosity = options.get("verbosity", 0) 11 | 12 | if verbosity > 0: 13 | log_level = logging.DEBUG if verbosity > 1 else logging.INFO 14 | loggers = [logging.getLogger(), logging.getLogger("chronam")] 15 | for logger in loggers: 16 | logger.setLevel(log_level) 17 | for handler in logger.handlers: 18 | handler.setLevel(log_level) 19 | 20 | return super(LoggingCommand, self).execute(*args, **options) 21 | -------------------------------------------------------------------------------- /loc_cts/management/commands/bag_instances.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | from django.conf import settings 4 | 5 | from chronam.loc_cts.cts import CTS 6 | 7 | from . import LoggingCommand 8 | 9 | 10 | class Command(LoggingCommand): 11 | help = "Lookup CTS bag_instance ids for batches" # NOQA: A003 12 | 13 | def handle(self, *args, **options): 14 | cts = CTS(settings.CTS_USERNAME, settings.CTS_PASSWORD, settings.CTS_URL) 15 | ndnp = cts.get_project(settings.CTS_PROJECT_ID) 16 | 17 | for bag in ndnp.get_bags(): 18 | for instance in bag.get_bag_instances(): 19 | for instance_type in instance.data['bagInstanceTypes']: 20 | if instance_type['name'] == 'public access': 21 | self.stdout.write(instance.data['filepath']) 22 | -------------------------------------------------------------------------------- /loc_cts/management/commands/poll_cts.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from django.core.management.base import CommandError 6 | 7 | from chronam.loc_cts.tasks import poll_cts 8 | 9 | from . import LoggingCommand 10 | 11 | LOGGER = logging.getLogger(__name__) 12 | 13 | 14 | class Command(LoggingCommand): 15 | help = "manual command to load new batches from CTS" # NOQA: A003 16 | 17 | def handle(self, *args, **options): 18 | try: 19 | poll_cts.apply() 20 | except Exception: 21 | LOGGER.exception("Unable to load new batches from CTS") 22 | raise CommandError("unable to load batches from CTS") 23 | -------------------------------------------------------------------------------- /loc_cts/management/commands/poll_purge.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import logging 4 | 5 | from django.core.management.base import CommandError 6 | 7 | from chronam.loc_cts.tasks import poll_purge 8 | 9 | from . import LoggingCommand 10 | 11 | LOGGER = logging.getLogger(__name__) 12 | 13 | 14 | class Command(LoggingCommand): 15 | help = "manual command to process purge_batch requests from CTS" # NOQA: A003 16 | 17 | def handle(self, *args, **options): 18 | try: 19 | poll_purge.apply() 20 | except Exception: 21 | LOGGER.exception("Unable to process purge_batch requests:") 22 | raise CommandError("Unable to purge batches") 23 | -------------------------------------------------------------------------------- /loc_cts/management/commands/service_requests.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | 3 | from django.conf import settings 4 | 5 | from chronam.loc_cts.cts import CTS 6 | 7 | from . import LoggingCommand 8 | 9 | 10 | class Command(LoggingCommand): 11 | help = "list service requests that are in the queue" # NOQA: A003 12 | 13 | def handle(self, *args, **options): 14 | cts = CTS(settings.CTS_USERNAME, settings.CTS_PASSWORD, settings.CTS_URL) 15 | for sr in cts.get_service_requests(settings.CTS_QUEUE, settings.CTS_SERVICE_TYPE): 16 | bag_instance_id = sr.data['requestParameters']['baginstancekey'] 17 | bag = cts.get_bag_instance(bag_instance_id) 18 | bag_dir = bag.data['filepath'] 19 | self.stdout.write( 20 | "service request %s with status %s to load %s" % (sr.data['key'], sr.data['status'], bag_dir) 21 | ) 22 | -------------------------------------------------------------------------------- /loc_cts/tests/__init__.py: -------------------------------------------------------------------------------- 1 | from cts_tests import * 2 | -------------------------------------------------------------------------------- /loc_cts/tests/cts_tests.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | from django.test import TestCase 3 | 4 | from chronam.loc_cts.cts import CTS 5 | 6 | 7 | class CTSTest(TestCase): 8 | VERIFY_SSL = False 9 | 10 | def test_settings(self): 11 | self.assertTrue(hasattr(settings, 'IS_PRODUCTION')) 12 | self.assertTrue(settings.CTS_USERNAME) 13 | self.assertTrue(settings.CTS_PASSWORD) 14 | self.assertTrue(settings.CTS_URL) 15 | self.assertTrue(settings.CTS_PROJECT_ID) 16 | self.assertTrue(settings.CTS_QUEUE) 17 | self.assertTrue(settings.CTS_SERVICE_TYPE) 18 | 19 | def test_project(self): 20 | cts = CTS(settings.CTS_USERNAME, 21 | settings.CTS_PASSWORD, 22 | settings.CTS_URL, 23 | CTSTest.VERIFY_SSL) 24 | cts.get_project(settings.CTS_PROJECT_ID) 25 | 26 | def test_bags(self): 27 | cts = CTS(settings.CTS_USERNAME, 28 | settings.CTS_PASSWORD, 29 | settings.CTS_URL, 30 | CTSTest.VERIFY_SSL) 31 | project = cts.get_project(settings.CTS_PROJECT_ID) 32 | bags = list(project.get_bags()) 33 | self.assertTrue(len(bags) > 0) 34 | bag = bags[0] 35 | self.assertTrue(bag.data['id']) 36 | 37 | def test_bag_instances(self): 38 | cts = CTS(settings.CTS_USERNAME, 39 | settings.CTS_PASSWORD, 40 | settings.CTS_URL, 41 | CTSTest.VERIFY_SSL) 42 | project = cts.get_project(settings.CTS_PROJECT_ID) 43 | bag = list(project.get_bags())[0] 44 | 45 | instances = list(bag.get_bag_instances()) 46 | self.assertTrue(len(instances) > 0) 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "eslint": "^8.33.0", 4 | "eslint-plugin-prettier": "^4.2.1", 5 | "prettier": "^2.8.3", 6 | "stylelint": "^14.16.1", 7 | "stylelint-config-prettier": "^9.0.4", 8 | "stylelint-config-recommended": "^9.0.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 110 3 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | --requirement=requirements.pip 2 | 3 | flake8-assertive==1.0.1 4 | flake8-builtins==1.4.1 5 | flake8-logging-format==0.6.0 6 | flake8-comprehensions==1.4.1 7 | -------------------------------------------------------------------------------- /requirements.pip: -------------------------------------------------------------------------------- 1 | Django==1.8.12 2 | MySQL-python==1.2.5 3 | lxml==3.6.0 4 | pymarc==3.1.1 5 | solrpy==0.9.7 6 | Pillow==3.2.0 7 | simplejson==3.8.2 8 | feedparser==5.2.1 9 | rfc3339==5 10 | mimeparse==0.1.3 11 | NativeImaging==0.0.10 12 | html5lib==1.0.1 13 | rdflib==3.2.3 14 | django-celery<4 15 | Celery<4 16 | kombu<4 17 | django-kombu==0.9.4 18 | worldcat==0.3.6 19 | django-sendfile==0.3.11 20 | psutil>=5.4.0 21 | beautifulsoup4==4.6.0 22 | requests==2.9.1 23 | piffle==0.3.0 24 | more-itertools==5.0.0 25 | django-tabular-export==1.1.0 26 | -------------------------------------------------------------------------------- /requirements_loc.pip: -------------------------------------------------------------------------------- 1 | -r requirements.pip 2 | 3 | # Otherwise use git+https, provide user id and password 4 | git+ssh://git@git.loc.gov:7999/ndnp/minicts.git#egg=minicts 5 | git+ssh://git@git.loc.gov:7999/ndnp/django-lc.git#egg=lc 6 | -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LibraryOfCongress/chronam/edccb1c2f2b372b583f7368479769a1dd626c5f2/scripts/__init__.py -------------------------------------------------------------------------------- /settings_jenkins.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from settings_template import * # NOQA 4 | 5 | DATABASES = { 6 | 'default': { 7 | 'ENGINE': 'django.db.backends.mysql', 8 | 'NAME': 'chronam', 9 | 'USER': 'chronam', 10 | 'PASSWORD': 'chronam', 11 | } 12 | } 13 | 14 | IS_PRODUCTION = False 15 | 16 | SOLR = "http://localhost:8080/solr" 17 | 18 | STORAGE = '/var/lib/jenkins/jobs/chronam/chronam/data/' 19 | BATCH_STORAGE = os.path.join(STORAGE, "batches") 20 | BIB_STORAGE = os.path.join(STORAGE, "bib") 21 | OCR_DUMP_STORAGE = os.path.join(STORAGE, "ocr") 22 | COORD_STORAGE = os.path.join(STORAGE, "word_coordinates") 23 | -------------------------------------------------------------------------------- /settings_loc.py: -------------------------------------------------------------------------------- 1 | from settings_template import * 2 | 3 | INSTALLED_APPS = ( 4 | "chronam.loc", 5 | "lc", 6 | ) + INSTALLED_APPS 7 | 8 | 9 | BASE_CRUMBS = [{"label": "Chronicling America", "href": "/"}] 10 | 11 | THUMBNAIL_WIDTH = 200 12 | SEARCH_RESULTS_PER_PAGE = 20 13 | 14 | DEBUG = False 15 | 16 | IS_PRODUCTION = True 17 | ADOBE_ANALYTICS_URL = "https://assets.adobedtm.com/f94f5647937d/624e2240e90d/launch-0610ec681aff.min.js" 18 | SHARETOOL_URL = "https://cdn.loc.gov/sites/chronicling-america.js" 19 | 20 | CTS_USERNAME = "username" 21 | CTS_PASSWORD = "password" 22 | CTS_PROJECT_ID = "ndnp" 23 | CTS_QUEUE = "ndnpingestqueue" 24 | CTS_SERVICE_TYPE = "ingest.NdnpIngest.ingest" 25 | CTS_URL = "https://cts.loc.gov/transfer/" 26 | -------------------------------------------------------------------------------- /settings_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | # DO NOT CHECK-IN WORLDCAT_KEY TO REPO 4 | from settings import WORLDCAT_KEY # NOQA 5 | from settings_template import * # NOQA 6 | from settings_template import DIRNAME, STORAGE 7 | 8 | DATABASES = { 9 | 'default': { 10 | 'ENGINE': 'django.db.backends.mysql', 11 | 'TEST': {'CHARSET': "utf8", 'COLLATION': "utf8_general_ci"}, 12 | } 13 | } 14 | 15 | CTS_URL = "https://transferqa.loctest.gov/transfer/" 16 | # Use different storage pathes to avoid interference with the actual storage for the web app 17 | # some tests purge batch and deletes data (such as word coordinates) 18 | BIB_STORAGE = os.path.join(STORAGE, "test_bib") 19 | OCR_DUMP_STORAGE = os.path.join(STORAGE, "test_ocr") 20 | COORD_STORAGE = os.path.join(STORAGE, "test_word_coordinates") 21 | TEMP_TEST_DATA = os.path.join(STORAGE, "temp_test_data") 22 | DATA_DIR = os.path.join(DIRNAME, "data") 23 | BATCH_STORAGE = os.path.join(DATA_DIR, "batches") 24 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max_line_length = 110 3 | exclude = ENV 4 | enable-extensions=G 5 | 6 | [pycodestyle] 7 | max_line_length = 110 8 | exclude = ENV 9 | ignore = 10 | 11 | [isort] 12 | default_section = THIRDPARTY 13 | force_grid_wrap = 0 14 | include_trailing_comma = True 15 | known_first_party = chronam 16 | line_length = 110 17 | multi_line_output = 3 18 | not_skip = __init__.py 19 | skip = ENV 20 | use_parentheses = True 21 | -------------------------------------------------------------------------------- /solr/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11 AS builder 2 | 3 | RUN useradd --system -d /opt/solr -s /bin/false solr 4 | RUN install -d -o solr -g solr /opt/solr /opt/solr/contrib /opt/solr/logs 5 | 6 | USER solr 7 | 8 | WORKDIR /tmp 9 | 10 | RUN curl -LO https://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4.tgz 11 | RUN tar -xf solr-4.10.4.tgz 12 | RUN mv solr-4.10.4/example/* /opt/solr/ 13 | 14 | COPY conf/schema.xml /opt/solr/solr/collection1/conf/schema.xml 15 | COPY conf/solrconfig.xml /opt/solr/solr/collection1/conf/solrconfig.xml 16 | 17 | RUN curl --fail --silent --location --output /opt/solr/contrib/lucene-analyzers-stempel-4.10.4.jar https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-stempel/4.10.4/lucene-analyzers-stempel-4.10.4.jar 18 | RUN curl --fail --silent --location --output /opt/solr/solr/collection1/conf/lang/stopwords_pl.txt https://raw.githubusercontent.com/apache/lucene-solr/master/lucene/analysis/stempel/src/resources/org/apache/lucene/analysis/pl/stopwords.txt 19 | 20 | FROM openjdk:11 21 | 22 | RUN useradd --system -d /opt/solr -s /bin/false solr 23 | RUN install -d -o solr -g solr /opt/solr 24 | 25 | # COPY ignores the USER directive so this MUST run as root before we 26 | # chown & change to the less-privileged user: 27 | COPY --from=builder /opt/solr/ /opt/solr/ 28 | 29 | RUN chown -R solr:solr /opt/solr 30 | RUN install -d -o solr -g solr /opt/solr/logs /opt/solr/solr-webapp 31 | 32 | USER solr 33 | 34 | WORKDIR /opt/solr 35 | 36 | EXPOSE 8983 37 | 38 | ENTRYPOINT ["java", "-jar", "start.jar"] 39 | -------------------------------------------------------------------------------- /solr/conf/jetty-logging.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | /yyyy_mm_dd.stderrout.log 15 | false 16 | 90 17 | GMT 18 | 19 | 20 | 21 | 22 | 23 | Redirecting stderr/stdout to 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /solr/conf/jetty-redhat: -------------------------------------------------------------------------------- 1 | JAVA_HOME=/opt/jdk1.8.0_72 2 | JAVA=$JAVA_HOME/bin/java 3 | JAVA_OPTIONS="-verbose:gc -Xms2g -Xmx2g -Dsolr.solr.home=/opt/solr/solr $JAVA_OPTIONS" 4 | JETTY_HOME=/opt/solr 5 | JETTY_USER=solr 6 | JETTY_LOGS=/opt/solr/logs 7 | -------------------------------------------------------------------------------- /solr/conf/jetty-ubuntu: -------------------------------------------------------------------------------- 1 | NO_START=0 2 | VERBOSE=yes 3 | JAVA_HOME=$(dirname $(dirname $(readlink -f /usr/bin/javac))) 4 | JETTY_HOME=/opt/solr 5 | JETTY_USER=solr 6 | JETTY_LOGS=/var/log/solr/ 7 | JETTY_PORT=8080 8 | -------------------------------------------------------------------------------- /solr/conf/solr-tomcat.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /static/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: /data/ocr/ 3 | Disallow: /data/word_cordinates/ 4 | 5 | Sitemap: https://chroniclingamerica.loc.gov/sitemap.xml 6 | -------------------------------------------------------------------------------- /vagrant/centos/root_setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # install Python 2.7 4 | rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm 5 | rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-14.ius.centos6.noarch.rpm 6 | yum -y install python27 7 | yum -y install python27-devel python27-setuptools 8 | 9 | easy_install-2.7 pip 10 | pip2.7 install virtualenv 11 | 12 | yum -y install mysql-server mysql-devel gcc libxml2-devel libxslt-devel libjpeg-devel zlib-devel java-1.7.0-openjdk-devel git 13 | 14 | yum -y install GraphicsMagick 15 | 16 | CHRONAM_HOME=/opt/chronam 17 | SOLR_HOME=/opt/solr 18 | 19 | # install Solr 20 | useradd -d /opt/solr -s /bin/bash solr 21 | 22 | # Solr 4.10.4 23 | wget http://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4.tgz 24 | tar zxvf solr-4.10.4.tgz 25 | install -d -o vagrant -g vagrant -m 755 /opt/solr 26 | mv solr-4.10.4/example/* /opt/solr/ 27 | cp $CHRONAM_HOME/conf/schema.xml $SOLR_HOME/solr/collection1/conf/schema.xml 28 | cp $CHRONAM_HOME/conf/solrconfig.xml $SOLR_HOME/solr/collection1/conf/solrconfig.xml 29 | cp $CHRONAM_HOME/conf/jetty-logging.xml $SOLR_HOME/etc/jetty-logging.xml 30 | chown solr:solr -R $SOLR_HOME 31 | 32 | # Jetty for Solr 33 | cp $CHRONAM_HOME/conf/jetty7.sh /etc/init.d/jetty 34 | chmod +x /etc/init.d/jetty 35 | cp $CHRONAM_HOME/conf/jetty-redhat /etc/default/jetty 36 | # replace "-Xms2g -Xmx2g" with "-Xms256m -Xmx256m" because 2g is too large for dev VM 37 | sed -i -- 's/-Xms2g -Xmx2g/-Xms256m -Xmx256m/g' /etc/default/jetty 38 | 39 | chkconfig --levels 235 jetty on 40 | service jetty start 41 | 42 | # start MySQL 43 | chkconfig --levels 235 mysqld on 44 | service mysqld start -------------------------------------------------------------------------------- /vagrant/centos/user_setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CHRONAM_HOME=/opt/chronam 4 | ENV_HOME=$CHRONAM_HOME/ENV 5 | 6 | virtualenv -p /usr/bin/python2.7 $ENV_HOME 7 | 8 | cp $CHRONAM_HOME/conf/chronam.pth $ENV_HOME/lib/python2.7/site-packages/chronam.pth 9 | source $ENV_HOME/bin/activate 10 | pip install -r $CHRONAM_HOME/requirements.pip 11 | 12 | if [ ! -d $CHRONAM_HOME/data/cache ]; then 13 | mkdir $CHRONAM_HOME/data/cache 14 | fi 15 | 16 | if [ ! -d $CHRONAM_HOME/data/bib ]; then 17 | mkdir $CHRONAM_HOME/data/bib 18 | fi 19 | 20 | echo "CREATE DATABASE chronam CHARACTER SET utf8; GRANT ALL ON chronam.* to 'chronam'@'localhost' identified by 'pick_one';" | mysql -u root 21 | 22 | # config env 23 | if [ ! -f $CHRONAM_HOME/settings.py ]; then 24 | echo 'from chronam.settings_template import *' > $CHRONAM_HOME/settings.py 25 | fi 26 | 27 | echo "export DJANGO_SETTINGS_MODULE=chronam.settings" >> /home/vagrant/.bashrc 28 | 29 | source /home/vagrant/.bashrc 30 | 31 | django-admin.py migrate 32 | django-admin.py loaddata initial_data 33 | django-admin.py chronam_sync --skip-essays 34 | 35 | django-admin.py collectstatic --noinput 36 | 37 | # load sample batch 38 | if [ ! -d $CHRONAM_HOME/data/batches/batch_uuml_thys_ver01 ]; then 39 | cd $CHRONAM_HOME/data/ 40 | wget --recursive --no-host-directories --cut-dirs 1 --reject index.html* --include-directories /data/batches/batch_uuml_thys_ver01/ https://chroniclingamerica.loc.gov/data/batches/batch_uuml_thys_ver01/ 41 | fi 42 | django-admin.py load_batch $CHRONAM_HOME/data/batches/batch_uuml_thys_ver01 43 | 44 | ln -s $CHRONAM_HOME/vagrant/runserver.sh /home/vagrant/ 45 | -------------------------------------------------------------------------------- /vagrant/runserver.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source /opt/chronam/ENV/bin/activate 3 | django-admin.py runserver 0.0.0.0:8000 --------------------------------------------------------------------------------