Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create component "Filter by Volumes" #293

Closed
plutonik-a opened this issue Nov 13, 2017 · 7 comments
Closed

Create component "Filter by Volumes" #293

plutonik-a opened this issue Nov 13, 2017 · 7 comments

Comments

@plutonik-a
Copy link
Contributor

plutonik-a commented Nov 13, 2017

Display "Filter by volumes" in the result page. First 3 options are shown, the rest ist hidden and will be expanded by clicking the "show more" link.

bildschirmfoto 2017-11-13 um 14 16 11

Most volumes have long titles, that can hardly be displayed in a sidebar.
See comment #284 (comment)
Awaiting an answer from @joewiz about the concept.

Updates: (from Joe in #284 (comment))

  • Replace dropdown arrows with +/- icons
  • Text-color should be default text-color instead of link-color
  • Display amount of hits next to the option
  • "More Volumes" instead of "Show more"

For volume titles, the "series" component you referred to should not be shown in the sidebar. Instead, we should just display the "sub-series", "volume-number", and "volume" titles. A sample query to retrieve these titles is:

xquery version "3.1";

declare namespace tei="http://www.tei-c.org/ns/1.0";

declare function local:trim-words($string as xs:string, $number as xs:integer) {
    let $words := tokenize($string, "\s")
    return
        if (count($words) gt $number) then
            (
                subsequence($words, 1, ceiling($number div 2)) => string-join(" ")
                , "…"
                , $words[position() ge last() - floor($number div 2) + 1] => string-join(" ")
            )
            => string-join()
        else
            $string
};

element volumes {
    let $vols-in-db := collection("/db/apps/frus/volumes")/tei:TEI[.//tei:body/tei:div]/@xml:id
    let $vols := collection("/db/apps/frus/bibliography")/volume[@id = $vols-in-db]
    for $vol in $vols
    let $vol-id := $vol/@id
    let $title := 
        ($vol/title[@type eq "sub-series"], $vol/title[@type eq "volume-number"], $vol/title[@type eq "volume"])[. ne ""]
        => string-join(", ")
        => normalize-space()
        => local:trim-words(10)
    order by $vol-id
    return
        element volume { attribute id { $vol-id }, $title }
}

The first few results of this query are:

<volumes>
    <volume id="frus1865p4">1865, Part IV, Accompanying the…and Sympathy Inspired by These Events</volume>
    <volume id="frus1912">1912, With the Annual Message…Transmitted to Congress December 3, 1912</volume>
    <volume id="frus1913">1913, With the Address of…President to Congress December 2, 1913</volume>
    <!-- snip -->
</volumes>

Parent: #284
Dependent on: #287

@joewiz
Copy link
Member

joewiz commented Nov 13, 2017

Please see comments 2-7 from #284 (comment).

@plutonik-a plutonik-a changed the title Creating component "Filter by Volumes" Create component "Filter by Volumes" Nov 15, 2017
@tuurma
Copy link
Contributor

tuurma commented Nov 29, 2017

@plutonik-a is preparing a version with a truncated volume title as a temporary measure, awaiting decision how to present long titles for the sidebar

plutonik-a added a commit that referenced this issue Nov 29, 2017
* wrap volume inputs into seperate form & add accessible form and list
markup for inputs
* serialize parameters for volumes
@plutonik-a
Copy link
Contributor Author

Status:

The (multilined) volume titles are truncated to one line and their width depends on the width of the wrapping parent element. So in medium sized screens, the lines expand to full width, otherwise are limited in a sidebar.
Nevertheless, the title beginnings are so similar, that the truncated lines do not differ, not even in medium sized screens.

bildschirmfoto 2017-11-29 um 16 24 25

tuurma added a commit that referenced this issue Nov 29, 2017
@tuurma
Copy link
Contributor

tuurma commented Nov 29, 2017

using @joewiz's suggestion for truncating the titles

in sidebar:

image

medium sized screen:

image

@joewiz
Copy link
Member

joewiz commented Nov 29, 2017

Thanks, Magda! That is our best option with the titles. The series is weird and inconsistent in its naming and numbering of volumes, and there’s only so much we can do.

@tuurma
Copy link
Contributor

tuurma commented Nov 30, 2017

Thanks for confirmation @joewiz. As I see it we have potentially two more related things:

  1. limiting the number of volumes initially shown and making the rest available via more volumes
  2. showing the number of results available for each filter option

Please, confirm if 1. is the desired solution, if so let's open a new issue and we will proceed with implementing it, though it will have low priority until we are done with core advanced search features.
2 is covered under #298 so let's move the discussion there.

@tuurma tuurma closed this as completed Nov 30, 2017
plutonik-a added a commit that referenced this issue Nov 30, 2017
* feat-date-search:
  fix(search): Fix conditional display of date section #288
  fix(search): Refactor date and time input IDs #288
  feat(volumes filter) trim volume names down to subseries+volume_number+volume titles; affects #293
  fix(date filter) remove redundant date criteria serialization; affects #288
  feat(date filter) aggregate partial date controls (mm dd yyyy) into single query param and back; addresses #288
  feat(date search) first take on date search
  fix(filters) bring back checking of volumes/administrations etc, add templating attributes for date section
  fix(date filter) add templating relaed attributes and fix names; affects #288
  feat(date search) first take on date search
  feat(date search) first take on date search
  feat(date filter) aggregate partial date controls (mm dd yyyy) into single query param and back; addresses #288
  fix(filters) bring back checking of volumes/administrations etc, add templating attributes for date section
  fix(date filter) add templating relaed attributes and fix names; affects #288
  feat(date search) first take on date search
  feat(date search) first take on date search
  fix(filters) bring back checking of volumes/administrations etc, add templating attributes for date section
  fix(date filter) add templating relaed attributes and fix names; affects #288
  feat(date search) first take on date search
  feat(date search) first take on date search
  feat(date search) first take on date search
@tuurma
Copy link
Contributor

tuurma commented Nov 30, 2017

@joewiz confirms that limiting the number of volumes initially shown and making the rest available via 'more volumes` button is a good idea, I will follow up creating an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants