diff --git a/game-library-frontend/app/project.html b/game-library-frontend/app/project.html index 06fbed3..ef06fa3 100644 --- a/game-library-frontend/app/project.html +++ b/game-library-frontend/app/project.html @@ -177,6 +177,33 @@ + + + + + + + + + + + + + + + + + + diff --git a/game-library-frontend/app/src/ProjectSection.svelte b/game-library-frontend/app/src/ProjectSection.svelte index 7034310..83e4a0b 100644 --- a/game-library-frontend/app/src/ProjectSection.svelte +++ b/game-library-frontend/app/src/ProjectSection.svelte @@ -77,8 +77,90 @@ editing = false; } - + // + // Feedback and forum search + // + const forumURL = "https://forum.vassalengine.org/"; + const projectsURL = "https://vassalengine.org/library/projects/" + + function gameEncoded() { + return encodeURIComponent( "[" + proj.game.title + "]" ); + } + + function projectURL() { + return projectsURL+proj.name; + } + + function projectQueryComponent(forum) { + return encodeURIComponent(proj.name+" "+proj.game.title+" #"+forum); + } + function projectQuery(forum) { + const url = forumURL + "search?q=" + projectQueryComponent(forum); + window.open(url, '_blank').focus(); + } + + function searchDiscussion(event) { + projectQuery("module-discussion"); + } + + function searchSupport(event) { + projectQuery("module-support"); + } + + function projectLink() { + return encodeURIComponent("Regarding the project [" + proj.game.title + "](" + projectURL() + ")."); + } + + function forumPost(forum) { + const url = forumURL + "new-topic?title=" + gameEncoded() + "&body=" + projectLink() + "&category=" + forum; + window.open(url, '_blank').focus(); + } + + function postDiscussion(event) { + forumPost("module-discussion"); + } + + function postSupport(event) { + forumPost("module-support"); + } + + + function messageOwners(event) { + const owners = proj.owners.join(","); + const url = forumURL+"new-message?username="+owners+"&title="+gameEncoded()+"&body="+projectLink(); + window.open(url, '_blank').focus(); + } + /* + Search: https://forum.vassalengine.org/search?q=anzio%2Bbeachhead%20anzio_beachhead_cholmcc%20%23module-discussion + Post: https://forum.vassalengine.org/new-topic?title=https://vassalengine.org/library/projects/anzio_beachhead_cholmcc&category=module-discussion + */ + + {#if error} {/if} @@ -118,6 +200,74 @@ {/each} + + + + + {"Message"+(proj.owners.length>1?" all":"")} + + + + + + + + + + + + Module Discussion: + + + Module Support: + + + + + + + + Search + + + + + + Search + + + + + + + + New topic + + + + + + New topic + + +