Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ public/minimal*
public/cache
is_prod
.phpunit.result.cache
generated/
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ RUN git clone https://github.com/douglascrockford/JSMin /tmp/jsmin && \
gcc /tmp/jsmin/jsmin.c -o /usr/bin/jsmin && \
rm -rf /tmp/jsmin

FROM php:8.3-fpm-alpine AS collection-config

COPY ./app/Config/microfilm.csv /tmp/microfilm.csv
COPY ./exe/build-reproductions-only.php /tmp/build-reproductions-only.php
RUN mkdir -p /generated && \
php /tmp/build-reproductions-only.php /tmp/microfilm.csv /generated/reproductions-only.php

FROM php:8.3-fpm-alpine AS development

COPY --from=collection-config /generated /opt/findingaid/generated

# add other deps for dev here
RUN apk add --no-cache \
libzip-dev \
Expand Down Expand Up @@ -62,6 +71,8 @@ RUN composer install --no-interaction --no-dev

FROM php:8.3-fpm-alpine AS ci

COPY --from=collection-config /generated /opt/findingaid/generated

RUN apk add --no-cache \
libzip-dev \
bash
Expand All @@ -75,6 +86,7 @@ COPY ./phpunit.xml /opt/findingaid/phpunit.xml
COPY /app .

COPY exe/build.sh /opt/findingaid/exe/build.sh
COPY exe/build-reproductions-only.php /opt/findingaid/exe/build-reproductions-only.php
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

Expand All @@ -84,6 +96,8 @@ CMD ["php-fpm", "-F"]

FROM php:8.3-fpm-alpine AS production

COPY --from=collection-config /generated /opt/findingaid/generated

RUN apk add --no-cache \
libzip-dev \
bash \
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ get a report of linting violations, and `make lint-fix` to fix those that can be
automatically fixed. These deliberately exclude line length as a fix.

## Contributors
Sarah Dorpinghaus, Neal Powers, Nicole Sand, and MLE Slone. For details, consult [CONTRIBUTORS](CONTRIBUTORS.md).
Sarah Dorpinghaus, Neal Powers, Nicole Sand, and MLE Slone. For details, consult
[CONTRIBUTORS](CONTRIBUTORS.md).

## Copyright

Expand All @@ -134,3 +135,14 @@ This program uses the following software:
- [Bootstrap](https://getbootstrap.com)
- [jQuery](https://jquery.org)
- [Fontawesome](https://fontawesome.com/)

### Renovation reproduction restrictions

`app/Config/microfilm.csv` identifies collections available only for scanning
during the
[King Library renovation](https://libraries.uky.edu/king-library-renovation-impacts).
Docker builds compile
`ead_location` URLs into `/opt/findingaid/generated/reproductions-only.php` for
development, CI, and production. This directory is outside the application bind
mount. The builder accepts both finding aid query URLs and `/catalog/<id>`
URLs.
31 changes: 27 additions & 4 deletions app/Assets/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
}

:root {
/* Limestone values */
/* Limestone brand colors */
--color-wildcat-blue: #0033a0;
--color-wildcat-white: #fff;
Expand All @@ -35,6 +34,11 @@
--color-sky: #b1c9e8;
--color-dark-gray: #515664;

/* Custom colors */
--color-alert-blue: #1e8aff;
--color-alert-amber: #996000;
--color-alert-amber-background: #fff4d6;

/* Type scale */
--font-size-base: 1.1667rem;
--font-size-lg: 1.5rem;
Expand Down Expand Up @@ -292,8 +296,8 @@ button:focus:hover.button--ghost,
@scope(.in-page-alert){
:scope{
background-color: var(--color-blue-gray);
border-left: 7px solid #1E8AFF;
padding: 1rem;
border-left: 7px solid var(--color-alert-blue);
padding: var(--space-md);
display: flex;
align-items: center;
}
Expand All @@ -318,10 +322,29 @@ button:focus:hover.button--ghost,
}

.icon-wrapper{
margin-right: 2rem;
margin-right: var(--space-xl);
color: var(--color-alert-blue);
}
}

.in-page-alert.in-page-alert--amber {
background-color: var(--color-alert-amber-background);
border-left-color: var(--color-alert-amber);
}

.in-page-alert--amber h2,
.in-page-alert--amber .icon-wrapper {
color: var(--color-alert-amber);
}

.slab.fa-restricted-collection {
padding-top: var(--space-md);
}

.fa-reproductions-only-notice {
margin-bottom: var(--space-xl);
}

.heading-section {
margin: 1rem 0;
}
Expand Down
7 changes: 6 additions & 1 deletion app/Assets/js/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var requests = (function() {
var count = 0;
var request_type = null;
var collection_title;
var reproductions_only = false;

function sortkey(label) {
return label.replace(/\d+/g, function (number) {
Expand Down Expand Up @@ -518,6 +519,9 @@ var requests = (function() {
return request_type;
},
set_request_type: function (new_request_type) {
if (reproductions_only && new_request_type !== 'request-reproductions') {
return false;
}
if (request_type === new_request_type) {
return false;
}
Expand Down Expand Up @@ -570,7 +574,7 @@ var requests = (function() {
for (var i = 0; i < request_types.length; ++i) {
subforms[i].init(ids[i]);
}
request_type = default_request_type;
request_type = reproductions_only ? 'request-reproductions' : default_request_type;
enable_current();
},
enable_current: enable_current,
Expand Down Expand Up @@ -671,6 +675,7 @@ var requests = (function() {
var button_collection_active = options["button_collection_active"];
var button_collection_inactive = options["button_collection_inactive"];

reproductions_only = options["reproductions_only"] === true;
model.init();
update();

Expand Down
9 changes: 9 additions & 0 deletions app/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Config
private $repo = [];
private $redirects = [];
private $nonuk = null;
private $reproductionsOnly = null;

public function __construct()
{
Expand Down Expand Up @@ -37,6 +38,14 @@ public function __construct()
}
}

public function isReproductionsOnly($id)
{
if ($this->reproductionsOnly === null) {
$this->reproductionsOnly = require ROOT . '/generated/reproductions-only.php';
}
return isset($this->reproductionsOnly[$id]);
}

public function get($key)
{
if (array_key_exists($key, $this->config)) {
Expand Down
Loading
Loading