Open pabgan opened 5 years ago
You can make pretty much any type of filter using Lua. This case is no exception. When I have some time I will add an example script.
The following Lua script should show all tasks in the Hogar project:
function onFilter(t,f)
for k,v in pairs(f.tags) do
if string.find(k,"hogar") == 1 then
return true
end
end
return false
end
See https://github.com/mpcjanssen/simpletask-android/blob/master/app/src/main/assets/script.en.md for details.
Supporting custom filtering requests like this was the main reason for including a Lua scripting option.
Thank you very much for the code, @mpcjanssen , and sorry for the delay in my response.
I see your point, but that would mean creating a custom filter for every project to replicate the behaviour in the original application. I know this is not an official application, but it is the closest, and I thought that it may make more sense to make this the default behaviour and leave the custom LUA script for those who want what it is not default in the offical application (the current behaviour), that by the way you can get with todo.sh ls +hogar$
(just in case somebody wonders).
@pabgan I see the point, but I don't know how I can make this work in the UI. I am open for suggestions. BTW you can save all these project specific filters in the right drawer.
Thanks for your openness.
Pablo Ganuza Vidal
@pabgan, that might work as a standard filter setting (show sub projects). Because the cli supports this, i might add this.
Thank you very much.
The official application supports (incidentally?) nested projects because filter seems to always add a wildcard at the end.
For example, I have a general project called
+hogar
(home in spanish) and inside it I create other smaller projects for everything I want to fix by adding.
and some more text. Then I can list all tasks in that general project:Or only those inside a subproject:
When I try to do the same with this great Android application, filtering by
+hogar
will only list those tasks that have that project with no subproject assigned, like task 8 in the example above.Would it be possible/desirable to have that behavior replicated here?