diff --git a/repos/annotation-studio/config/services.config.php b/repos/annotation-studio/config/services.config.php index f83f811a1..064acc5e3 100755 --- a/repos/annotation-studio/config/services.config.php +++ b/repos/annotation-studio/config/services.config.php @@ -7,10 +7,10 @@ use Digirati\OmekaShared\Factory\UrlHelperFactory; use Digirati\OmekaShared\Helper\SettingsHelper; use Digirati\OmekaShared\Helper\UrlHelper; +use Omeka\Settings\Settings; use Psr\Container\ContainerInterface; use Zend\Http\Request; use Zend\I18n\Translator\TranslatorInterface; -use Zend\Uri\Uri; return [ 'service_manager' => [ @@ -31,7 +31,7 @@ ); }, ModerationStatusVerificationSubscriber::class => function (ContainerInterface $c) { - /** @var \Omeka\Settings\Settings $config */ + /** @var Settings $config */ $config = $c->get('Omeka\Settings'); /** @var Request $request */ $request = $c->get('Request'); diff --git a/repos/annotation-studio/src/Admin/ConfigurationForm.php b/repos/annotation-studio/src/Admin/ConfigurationForm.php index 3c6d686ad..47c9dd0cc 100755 --- a/repos/annotation-studio/src/Admin/ConfigurationForm.php +++ b/repos/annotation-studio/src/Admin/ConfigurationForm.php @@ -2,7 +2,6 @@ namespace AnnotationStudio\Admin; -use AnnotationStudio\AnnotationStudio; use Digirati\OmekaShared\Framework\AbstractConfigurationForm; use GuzzleHttp\Client; use Zend\Form\Element; diff --git a/repos/annotation-studio/src/AnnotationStudio.php b/repos/annotation-studio/src/AnnotationStudio.php index 15a89fe72..51e02998b 100755 --- a/repos/annotation-studio/src/AnnotationStudio.php +++ b/repos/annotation-studio/src/AnnotationStudio.php @@ -13,6 +13,7 @@ class AnnotationStudio private $components; private $isLocked = false; private $debug = false; + private $googleMapApiKey; public function __construct() { @@ -72,13 +73,16 @@ public function getAssets($baseUrl = '') ); } - return implode("\n", [ sprintf( '', $bundle ), $this->debug ? $this->getWarning() : '', + $this->googleMapApiKey ? sprintf( + '', + $this->googleMapApiKey + ) : '', sprintf( '', $this->getVersion() @@ -93,6 +97,13 @@ public function addComponent($name, Component $component) } } + public function setGoogleMapApiKey(string $key) + { + $this->googleMapApiKey = $key; + + return $this; + } + public function __get($name) { return $this->__call($name, []); diff --git a/repos/iiif-storage/asset/css/iiif-storage.css b/repos/iiif-storage/asset/css/iiif-storage.css index 4d829a1ad..ffd44172e 100755 --- a/repos/iiif-storage/asset/css/iiif-storage.css +++ b/repos/iiif-storage/asset/css/iiif-storage.css @@ -395,7 +395,9 @@ .c-image { position: relative;; } -.c-image__status--started:after { + +.c-image__status--started:after, +.c-image__status--complete:after { position: absolute; bottom: -2px; border: 2px solid #000; @@ -403,10 +405,24 @@ width: 14px; height: 14px; content: ''; - background: dodgerblue; border-radius: 50%; } +.c-image__status--started:after { + background: #ffc645; +} + +.c-image__status--complete:after { + background: #37804a; + content: '✔'; + color: #fff; + font-size: 11px; + right: -9px; + bottom: -4px; + width: 18px; + height: 18px; +} + .info-panel { background: palegoldenrod; color: #333; diff --git a/repos/iiif-storage/view/iiif-storage/partials/canvas-thumbnail.twig b/repos/iiif-storage/view/iiif-storage/partials/canvas-thumbnail.twig index f4bb9bb60..8e5353d6d 100755 --- a/repos/iiif-storage/view/iiif-storage/partials/canvas-thumbnail.twig +++ b/repos/iiif-storage/view/iiif-storage/partials/canvas-thumbnail.twig @@ -5,7 +5,7 @@ height="{{ thumbnailWidth | default(150) }}" alt="{{ thumbnailAlt | default('Image thumbnail') }}"/> {% if (showImageStatus | default(true)) %} - {% if image.complete %} + {% if image.completed %} {% set statusClass = 'complete' %} {% set statusTitle = translate('Editing complete') %} {% elseif image.edited %} diff --git a/repos/public-user/Module.php b/repos/public-user/Module.php index 5dcfd2ac5..e93cc8eec 100755 --- a/repos/public-user/Module.php +++ b/repos/public-user/Module.php @@ -435,8 +435,11 @@ public function attachListeners(SharedEventManagerInterface $sharedEventManager) 'label' => 'New user role', // @translate 'info' => 'The user role for users when registering' // @translate ]) - ->setValueOptions($roles) - ->setValue($form->getSiteSettings()->get('public-user-registration-role', 'researcher')) + ->setValueOptions([ + // This can only be transcriber for the time being. + 'transcriber' => 'Transcriber' + ]) + ->setValue($form->getSiteSettings()->get('public-user-registration-role', 'transcriber')) ) ->add( (new Checkbox('public-user-profile-logged-in')) diff --git a/repos/public-user/src/Settings/PublicUserSettings.php b/repos/public-user/src/Settings/PublicUserSettings.php index be1c038c2..f49275e0f 100755 --- a/repos/public-user/src/Settings/PublicUserSettings.php +++ b/repos/public-user/src/Settings/PublicUserSettings.php @@ -87,7 +87,13 @@ public function isActivationAutomatic() */ public function getDefaultUserRole() { - return (string) $this->currentSiteSettings->get(self::DEFAULT_NEW_ROLE); + $role = (string) $this->currentSiteSettings->get(self::DEFAULT_NEW_ROLE, 'transcriber'); + + if ($role !== 'transcriber') { + error_log('Warning: One of your sites is configured to give users permissions on this Madoc site.'); + } + + return 'transcriber'; } public function isUserProfilesEnabled(): bool diff --git a/repos/public-user/src/Subscriber/AnnotationStatsSubscriber.php b/repos/public-user/src/Subscriber/AnnotationStatsSubscriber.php index 1cc920b5a..dffdb878e 100755 --- a/repos/public-user/src/Subscriber/AnnotationStatsSubscriber.php +++ b/repos/public-user/src/Subscriber/AnnotationStatsSubscriber.php @@ -170,7 +170,7 @@ public function handleAnnotationLifecycleEvent(AnnotationLifecycleEvent $event, } elseif (self::CROWDS_MOTIVATION_DRAFTING === $motivation) { $this->log(Logger::DEBUG, 'Found incomplete annotation'); $incomplete = true; - } elseif (!in_array($motivation, self::OA_MOTIVATION_IGNORE, true)) { + } elseif (self::CROWDS_MOTIVATION_COMPLETED === $motivation) { $this->log(Logger::DEBUG, 'Found completion annotation'); $complete = true; } diff --git a/repos/public-user/src/Subscriber/ManifestStatsSubscriber.php b/repos/public-user/src/Subscriber/ManifestStatsSubscriber.php index 79e0910ca..e2f6fd703 100644 --- a/repos/public-user/src/Subscriber/ManifestStatsSubscriber.php +++ b/repos/public-user/src/Subscriber/ManifestStatsSubscriber.php @@ -78,13 +78,15 @@ public function viewManifest(Event $event) { if ($omekaId && $map[(string)$omekaId] ?? null) { $stats = $map[(string)$omekaId]; - $incomplete = $stats['incomplete_count'] ?: 0; - $complete = $stats['complete_count'] ?: 0; - $bookmarks = $stats['bookmarks'] ?: 0; + + $incomplete = intval($stats['incomplete_count'], 10) ?? 0; + $complete = intval($stats['complete_count'], 10) ?? 0; + $bookmarks = intval($stats['bookmarks'], 10) ?? 0; $canvas->addMetaData([ 'edited' => $incomplete, - 'completed' => $complete > 0 && $incomplete === 0, + // Incomplete count does not reset when marking as complete. + 'completed' => $complete > 0 /*&& $incomplete === 0*/, 'totalBookmarks' => $bookmarks, ]); }