Create a [[my_projects]]
macro that uses the projects that user.my_projects()
returns, and also supports the display options of the [[projects]]
macro. Re-use the same output templates. This should work on a wiki installed onto a user-project (e.g. /u/admin1) and use that user (e.g. admin1) not the logged in user, to get the list of projects.
The 'neighborhood-wiki' context will have to change for my_projects macro. If there's a way to limit the context to the /u/ neighborhood that'd be nice, but I doubt the current macro context logic supports it.
The long-term goal is to be able to replace the user profile page (allura/ext/user_profile/templates/user_index.html) with a regular wiki page.
created #39: [#4054] Create my_projects macro (2cp)
Related
Tickets: #4054
closed #39, pushed changes into 42cc_4054
get_projects_for_macro
function, and do it in theprojects
ormy_projects
function. For example, they could each pass aninitial_q
param toget_projects_for_macro
. Theprojects
function could build aninitial_q
with the neighborhood_id set and themy_projects
function could build one with the _id matching the list of ids. Hopefully that will keep theget_projects_for_macro
function simpler, e.g. only having one random sort logic.is_user_project
instead ofc.project.neighborhood.name == "Users" and c.project.name[:2] == u"u/":
created #40: [#4054] my_projects macro refactoring and small amendments (1cp)
Related
Tickets: #4054
Closed the ticket #40 and pushed changes into 42cc_4054
I added the macro to my user project and nothing showed up. https://sourceforge.net/u/spiffk/wiki/Home/
I cannot reproduce this production issue on a sandbox. If the macro were running and not selecting any projects, it says "No projects found". If the macro's
userproject-wiki
context constraint were failing, it'd show a literal `[[my_projects]``. Lastly, if there is text before or after the macro, it is not shown at all. Something is preventing the whole page from rendering.After [#4057] is live, we can look for matching logs more easily. Maybe there will be a clue there.
We don't need this macro right now for anything, so not a priority to fix.