OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
88 stars 18 forks source link

Tours list showing nearby / previously started tours #538

Closed lentinj closed 8 months ago

lentinj commented 2 years ago

Show a menu of suggested tours, in order of:-

...the top-most tour is "promoted" below the tours menu item so you don't have to open the pop-up to get at it.

We may want to promote the "how to use tour" to the top initially, then let it drop down the rankings as people seem to know what to do.

@jrosindell I think there was brief mention of assigning a tour to a clade, e.g. a "flightless birds" tour might be presented when near the "Birds" node. Correct? For this I think we'd need add a list of related OTTs for that tour which aren't themselves tourstops, but cause the tour to be shown when that OTT is on-screen.

on-screen is a bit of a wobbly concept too, and might need tweaking to get right.

We do it as part of node_detail calls, saying whether we have tours mentioning this, then the client manages the display of these when the nodes are visible

jrosindell commented 9 months ago

I think that having a list of OTT IDs that aren't tour stops is the correct solution. Rather like key words to cover things not obvious in the abstract / title of an article. on screen is wobbly and could get messy to code up but is probably needed. Instinct says that it should be tied to the placement of flags as that makes it simple - if a tour stop has a flag on screen (or a key-word OTT would be drawn as a flag if it were a tour stop) then this counts - otherwise not. Hence the same system can be co-opted for on screen tours as chooses to draw flags or not.

lentinj commented 9 months ago

Okay, so the "Birds" node should have a tours icon and offer "flightless birds" in it's list of tours, just as it would if "birds" was a tourstop in the tour?

on screen is wobbly

Yes, I think our concept of on-screen will end up more broad than a user might expect, but that's probably not a bad thing.

lentinj commented 8 months ago

@hyanwong we decided that tours have an image_url, not src/src_id, but I'm guessing that providing a manually-sourced image for every single tour will get boring very quickly.

We could have src/src_id fields for a tour, but I'm wondering if inventing a url scheme like src:99:32373704 and using that in image_url makes more sense. However:

hyanwong commented 8 months ago

We should be able to access images via their source + source_id using the local_pic_path function within web2py (defined in db.py), I think.

hyanwong commented 8 months ago

I assume you might want a javascript equivalent, and I think I coded one up somewhere?

lentinj commented 8 months ago

local_pic_path isn't quite what I want, it's the fitting the 2 src parts into a single URL-scheme-ish string I'm after. This is what I'm currently doing:

def url(s):
    thumb_base_url = current.globalenv['thumb_base_url']

    if s.startswith('src:'):
        parts = s.split(':')
        return thumb_url(thumb_base_url, parts[1], parts[2])
    return s

EDIT: Then I can get the image for a tour with url(tour.image_url), and the image_url field can contain "src:99:32373704".

I assume you might want a javascript equivalent, and I think I coded one up somewhere?

Just python, but I think you're thinking of thumb_url, as wrapped above.

hyanwong commented 8 months ago

Ah, I see, you mean you simply want to store a string which can be broken down in that way. We haven't invented anything, no. src:99:32373704 seems fine, or maybe img:99:32373704, since we are specifically talking about images here, right?

lentinj commented 8 months ago

since we are specifically talking about images here, right?

Yup.

I think I prefer src: over img:, since the image-ness of this is pretty obvious in context, but the fact that the 2 numbers are src/src_id isn't.

This is a pretty tiny thing to quibble over though. Maybe imgsrc:99:32373704 and everyone's happy?

hyanwong commented 8 months ago

Sure - sounds good to me.

lentinj commented 8 months ago

This is done at this point, apart from previously explored tours which can happen with #690