diff --git a/fid_bbi/config/vufind/config.ini b/fid_bbi/config/vufind/config.ini index 328b50ae64c2c310347223e1eea4909beb3917b4..41b7cc48ab8bf5376e33f047b36623c7c4c2d7e1 100644 --- a/fid_bbi/config/vufind/config.ini +++ b/fid_bbi/config/vufind/config.ini @@ -122,6 +122,7 @@ user_email_in_from = true [Social] tags = enabled +max_tag_length = 25 [RecordPermissions] WorldcatTab = enabled diff --git a/fid_bbi/languages/de.ini b/fid_bbi/languages/de.ini index f0674dcf663f6a73ad12596e04d5a805e646c681..59cbed73bf899f1fb6395ff0fcc91ac5a2d0e012 100644 --- a/fid_bbi/languages/de.ini +++ b/fid_bbi/languages/de.ini @@ -441,7 +441,7 @@ history_saved_searches = "Meine gespeicherten Suchen" copied_link_to_clipboard = "Link in Zwischenablage kopiert" #16050 -add_tag_note = "Trennen Sie Tags mit einem Leerzeichen oder mit [ENTER]. Max. Länge eines Tags: 25 Zeichen." +add_tag_note = "Trennen Sie Tags mit einem Leerzeichen. Max. Länge eines Tags: 25 Zeichen. Längere Tags werden automatisch gekürzt. Wenn Sie hier einen Tag löschen, wird er vom Titel entfernt" Your Tags = Meine Tags #17355 @@ -455,6 +455,11 @@ tags_record_count = "So getaggte Records" tags_records_on_lists = "Auf folgenden Listen" tags_browse = "Tags aller Nutzenden durchstöbern" +#17356 +currently_on_list = "Zur Zeit in Liste ''%%list_name%%''" +delete_from_list = "Aus Liste ''%%list_name%%'' löschen" +add_tag_description = "Helfen Sie anderen bei der Bewertung dieses Titels, indem Sie möglichst passende Tags vergeben." + #16903 Open Access = Kostenfrei Zugänglich diff --git a/fid_bbi/languages/en.ini b/fid_bbi/languages/en.ini index 2e513a91ee03bfa80191602e8bbced25ef5dfc41..1f383367a859ed6f50409f3356ca8eba2ee7cf2d 100644 --- a/fid_bbi/languages/en.ini +++ b/fid_bbi/languages/en.ini @@ -434,7 +434,7 @@ history_saved_searches = "My Saved Searches" copied_link_to_clipboard = "Copied Link to Clipboard" #16050 -add_tag_note = "Use a whitespace character or press [ENTER] to separate tags. Maximum length of a tag is 25 characters." +add_tag_note = "Use a whitespace character to separate tags. Maximum length of a tag is 25 characters. Longer tags will be truncated. If you delete a tag here it will be removed from the record" Your Tags = My Tags #17355 @@ -448,6 +448,11 @@ tags_record_count = "No of Records with this tag" tags_records_on_lists = "on favorite lists" tags_browse = "Browse all user's tags" +#17356 +currently_on_list = "currently on list ''%%list_name%%''" +delete_from_list = "Remove from list ''%%list_name%%''" +add_tag_description = "Help others to rate this title by assigning appropriate tags." + #16903 Open Access = Free Access diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss index 3c4fea5ff36bec03680196af4bd628edbaaffbb3..1ccbd1e48f4c142035f4bf149b360187f97eb8bd 100644 --- a/themes/fid_bbi/scss/compiled.scss +++ b/themes/fid_bbi/scss/compiled.scss @@ -485,6 +485,7 @@ footer { .sidebar a.active { background-color: $brand-secondary; + color: $white; //overrides finc standard } //// result body width @@ -670,4 +671,28 @@ tr.hline { .tag-record.pull-right { margin-left: 1rem; +} + +.list-edit-container { + fieldset.list-edit-group { + border: none; + width: 100%; + } + .list-edit-group, & ~ { + h3 { + font-size: 1.1rem; + } + .form-group select { + @media screen and (max-width: $screen-xs-max) { + max-width:85%; + } + } + } + [id^="edit_tags"], [id^="edit_note"] { + max-width: 85%; + } +} + +#modal .modal-dialog input#addtag_tag.form-control { + max-width: 85%; } \ No newline at end of file diff --git a/themes/fid_bbi/templates/myresearch/edit.phtml b/themes/fid_bbi/templates/myresearch/edit.phtml new file mode 100644 index 0000000000000000000000000000000000000000..93f0b5081e84569f6e1be066fb44239cd3273ccf --- /dev/null +++ b/themes/fid_bbi/templates/myresearch/edit.phtml @@ -0,0 +1,80 @@ +<!-- fid_bbi: myresearch - edit --> +<?php +/** + * This is mostly a copy of themes/bootstrap3/templates/myresearch/edit.phtml + * FID BBI specific changes: + * * move List Name down to correspond + * to list selection drop down (#17356) + * * add descriptive text above input field + * + * @author Dorian Merz <merz@ub.uni-leipzig.de> + */ +?> +<?php + // Set up page title: + $this->headTitle($this->translate('Edit') . ' : ' . $this->driver->getBreadcrumb()); + + // Set up breadcrumbs: + $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Edit') . '</li>'; +?> +<div class="record"> + <h2><?=$this->escapeHtml($this->driver->getBreadcrumb())?></h2> + + <form class="form-list-edit" method="post" name="editForm"> + <?php if (empty($this->savedData)): ?> + <p class="alert alert-info"> + <?php if (isset($listFilter)): ?> + <?=$this->transEsc('The record you selected is not part of the selected list.') ?> + <?php else: ?> + <?=$this->transEsc('The record you selected is not part of any of your lists.') ?> + <?php endif; ?> + </p> + <?php else: ?> + <div class="list-edit-container"> + <?php foreach ($this->savedData as $i => $current): ?> + <fieldset class="list-edit-group"> + <h3><?=$this->translate('currently_on_list',['%%list_name%%' => $this->escapeHtml($current['listTitle'])]) ?></h3> + <input type="hidden" name="lists[]" value="<?=$current['listId'] ?>"/> + <?php if ($this->usertags()->getMode() !== 'disabled'): ?> + <hr/> + <h3><?=$this->transEsc('Add Tags') ?></h3> + <div class="form-group"> + <?php /* fid_bbi: add descriptive text aove input field, cf. #17356, DM */?> + <p class="help-block"><?=$this->transEsc("add_tag_description")?></p> + <label class="control-label" for="edit_tags<?=$current['listId'] ?>"><?=$this->transEsc('Tags') ?>:</label> + <input type="text" name="tags<?=$current['listId'] ?>" id="edit_tags<?=$current['listId'] ?>" class="form-control" value="<?=$this->escapeHtmlAttr($current['tags'])?>"/> + <span class="help-block"><?=$this->transEsc("add_tag_note") ?></span> + </div> + <?php endif; ?> + <hr/> + <div class="form-group"> + <label class="control-label" for="edit_notes<?=$current['listId'] ?>"><?=$this->transEsc('Notes') ?>:</label> + <textarea class="form-control" id="edit_notes<?=$current['listId'] ?>" name="notes<?=$current['listId'] ?>" rows="3"><?=$this->escapeHtml($current['notes'])?></textarea> + </div> + <hr/> + <a href="<?=$this->url('userList', ['id' => $current['listId']]) ?>?delete=<?=urlencode($this->driver->getUniqueId())?>&source=<?=urlencode($this->driver->getSourceIdentifier())?>" id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>delete<?=$current['listId'] ?>" data-lightbox> + <i class="fa fa-trash"></i> <?=$this->transEsc('delete_from_list',['%%list_name%%' => $this->escapeHtml($current['listTitle'])]) ?> + </a> + </fieldset> + <?php endforeach; ?> + </div> + <?php endif; ?> + <?php if (count($this->lists) > 0): ?> + <hr/> + <div class="form-group"> + <select name="addToList" class="form-control"> + <option value="-1">- <?=$this->transEsc('Add to another list')?> -</option> + <?php foreach ($this->lists as $listID => $listTitle): ?> + <option value="<?=$listID ?>"><?=$this->escapeHtml($listTitle) ?></option> + <?php endforeach; ?> + </select> + </div> + <?php endif; ?> + <?php if (!empty($this->savedData) || count($this->lists) > 0): ?> + <div class="form-group"> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>"/> + </div> + <?php endif; ?> + </form> +</div> +<!-- fid_bbi: myresearch - edit - END --> \ No newline at end of file diff --git a/themes/fid_bbi/templates/myresearch/menu.phtml b/themes/fid_bbi/templates/myresearch/menu.phtml index d63a4b87f9571c131af26f87efdf92f0778c6614..d885a2f3a67ff8bb35575459f5a9d439527b6946 100644 --- a/themes/fid_bbi/templates/myresearch/menu.phtml +++ b/themes/fid_bbi/templates/myresearch/menu.phtml @@ -63,7 +63,10 @@ <br/> <h4><?=$this->translate('Your Tags')?></h4> <div class="myresearch-menu"> - <a href="<?=$this->url('myresearch-usertags')?>"><?=$this->translate('show_usertags')?></a> + <a href="<?=$this->url('myresearch-usertags')?>"<?=$this->active == 'tags' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-tags" aria-hidden="true"></i> + <?=$this->translate('show_usertags')?> + </a> </div> <?php endif; ?> @@ -100,5 +103,5 @@ <a href="<?=$this->url('fid/admin/list')?>"><?=$this->transEsc('fid::permission_read_user_list')?></a> </div> <?php endif; ?> - <!-- fid_bbi: myresearch - menu.phtml END --> <?php endif; ?> +<!-- fid_bbi: myresearch - menu.phtml END --> \ No newline at end of file diff --git a/themes/fid_bbi/templates/myresearch/usertags.phtml b/themes/fid_bbi/templates/myresearch/usertags.phtml index a19a72b157458b0c5b39b8ca687b8771a2b5f862..84414853dbd6dfd49e9c6ef2a613f9cd8520d559 100644 --- a/themes/fid_bbi/templates/myresearch/usertags.phtml +++ b/themes/fid_bbi/templates/myresearch/usertags.phtml @@ -18,6 +18,7 @@ <td><?=$tag->cnt ?></td> <td> <?php $onLists = explode(',',$tag->lists ?? ''); + sort($onLists); if (!empty($onLists)):?> <? foreach ($onLists as $id): ?> <?php if ($list = $lists[$id] ?? null): ?> @@ -37,6 +38,6 @@ </div> <div class="<?=$this->layoutClass('sidebar')?>"> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'profile'])?> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'tags'])?> </div> <!-- fid_bbi: myresearch - usertags - END --> \ No newline at end of file diff --git a/themes/fid_bbi/templates/record/addtag.phtml b/themes/fid_bbi/templates/record/addtag.phtml new file mode 100644 index 0000000000000000000000000000000000000000..58e3c96c8e04922141f5db6c8864b7289a262092 --- /dev/null +++ b/themes/fid_bbi/templates/record/addtag.phtml @@ -0,0 +1,36 @@ +<!-- fid_bbi: record - addtag --> +<?php +/** + * This is mostly a copy of themes/bootstrap3/templates/record/addtag.phtml + * FID BBI specific changes: + * * add description block above input field + * + * @author Dorian Merz <merz@ub.uni-leipzig.de> + */ +?> +<?php + // Set page title. + $this->headTitle($this->translate('Add Tag')); + + // Set up breadcrumbs: + $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') + . '<li>' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> ' + . '<li class="active">' . $this->transEsc('Add Tag') . '</li>'; +?> +<h2><?=$this->transEsc('Add Tags') ?></h2> +<form method="post" name="tagRecord" class="form-add-tag" data-lightbox-onclose="refreshTagListCallback"> + <input type="hidden" name="submit" value="1" /> + <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" /> + <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" /> + <div class="form-group"> + <?php /* fid_bbi: add descriptive text aove input field, cf. #17356, DM */?> + <p class="help-block"><?=$this->transEsc("add_tag_description")?></p> + <label class="control-label" for="addtag_tag"><?=$this->transEsc("Tags")?>:</label> + <input id="addtag_tag" type="text" name="tag" value="" size="40" class="form-control"/> + <p class="help-block"><?=$this->transEsc("add_tag_note")?></p> + </div> + <div class="form-group"> + <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Save')?>"/> + </div> +</form +<!-- fid_bbi: record - addtag - END --> \ No newline at end of file