"New log" button when viewing an asset

Tiny detail to consier:

When viewing an asset the “New activity log” Button/dropdown is only visible when viewing the asset info. If I view the registered logs for the asset, the button disappears.

I can’t see any reason for this.

I have my animal assets listed as url’s in a Node-Red dashboard. The url’s point me directly to the assets log view. Would be perfect to create new ones from there.

3 Likes

Agreed @pat that would be good!

This is the class that handles adding those links, if I remember correctly: farmOS/FarmActions.php at 2.x · farmOS/farmOS · GitHub

It may just require a minor tweak to make it appear where you describe. :thinking:

Somewhere around these lines maybe?

2 Likes

Actually maybe this is the line that needs to be modified/appended to: farmOS/FarmActions.php at 03279969ab3dffc291b17033b801e2bff7432139 · farmOS/farmOS · GitHub

1 Like

I gave this a quick try and got it working! Easy!

The only thing that isn’t perfect about it, is that when you click on one of the sub-tabs for a specific log type (eg: “Observations” in the screenshot above), it includes buttons for ALL logs types, not just the type you are viewing. Ideally I think it would just show “Add Observation Log” when you were viewing Observation logs of an asset.

I’m not sure if there’s an easy way to do that, though. I’ll open a PR for this and see if @paul121 has any clever ideas that I might be overlooking. If not, I think this is better than nothing - do you agree @pat ?

1 Like
1 Like

Nice.

Not sure tho, if it’s a problem. The button stays the same, and you find the add log list presented the usual way… I’d say it’s a 50/50

Or you could throw in an option to have all logs in the dropdown, but the corresponding log-type on top? I don’t know whats best… After all I’m just a simple farmer :farmer: :smiley:

It’s way better than nothing. I’m happy with this!! :slight_smile:

1 Like

I thought of this too! Might be possible…

Happy to say that we merged the PR - now we can refine it.

2 Likes