Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions game-library-frontend/app/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,33 @@
<path d="m452.09 5e-7 -109.88 31.842 10.08 33.979 29.758-3.8467v310.07c0 17.785-0.97971 28.639-1.9768 35.659-0.12799-0.17756-0.11093-0.11702-0.24339-0.30271-4.0361-5.6563-10.104-15.027-19.406-31.064-12.072-20.818-144.88-251.39-149.24-258.97l25.455-20.243-10.608-30.862-177.85 61.179 11.445 33.433 43.786-7.0225 179.98 312.17-19.993 20.783 11.273 25.193 189.15-56.074-9.4445-33.528-23.513-0.20195 0.21982-373.38 30.405-16.829z" stroke-width="11.412"/>
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="envelope" viewBox="0 0 640 640">
<!--!Font Awesome Free v7.2.0 by @fontawesome - --
--https://fontawesome.com License - --
--https://fontawesome.com/license/free Copyright 2026 --
--Fonticons, Inc.-->
<path d="M112 128C85.5 128 64 149.5 64 176C64 191.1 71.1 205.3 83.2 214.4L291.2 370.4C308.3 383.2 331.7 383.2 348.8 370.4L556.8 214.4C568.9 205.3 576 191.1 576 176C576 149.5 554.5 128 528 128L112 128zM64 260L64 448C64 483.3 92.7 512 128 512L512 512C547.3 512 576 483.3 576 448L576 260L377.6 408.8C343.5 434.4 296.5 434.4 262.4 408.8L64 260z"/>
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="search" viewBox="0 0 640 640">
<!--!Font Awesome Free v7.2.0 by @fontawesome - --
--https://fontawesome.com License - --
--https://fontawesome.com/license/free Copyright 2026 --
--Fonticons, Inc.-->
<path d="M480 272C480 317.9 465.1 360.3 440 394.7L566.6 521.4C579.1 533.9 579.1 554.2 566.6 566.7C554.1 579.2 533.8 579.2 521.3 566.7L394.7 440C360.3 465.1 317.9 480 272 480C157.1 480 64 386.9 64 272C64 157.1 157.1 64 272 64C386.9 64 480 157.1 480 272zM272 416C351.5 416 416 351.5 416 272C416 192.5 351.5 128 272 128C192.5 128 128 192.5 128 272C128 351.5 192.5 416 272 416z"/>
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="pen-to-square" viewBox="0 0 640 640">
<!--!Font Awesome Free v7.2.0 by @fontawesome - --
--https://fontawesome.com License - --
--https://fontawesome.com/license/free Copyright 2026 --
--Fonticons, Inc.-->
<path d="M535.6 85.7C513.7 63.8 478.3 63.8 456.4 85.7L432 110.1L529.9 208L554.3 183.6C576.2 161.7 576.2 126.3 554.3 104.4L535.6 85.7zM236.4 305.7C230.3 311.8 225.6 319.3 222.9 327.6L193.3 416.4C190.4 425 192.7 434.5 199.1 441C205.5 447.5 215 449.7 223.7 446.8L312.5 417.2C320.7 414.5 328.2 409.8 334.4 403.7L496 241.9L398.1 144L236.4 305.7zM160 128C107 128 64 171 64 224L64 480C64 533 107 576 160 576L416 576C469 576 512 533 512 480L512 384C512 366.3 497.7 352 480 352C462.3 352 448 366.3 448 384L448 480C448 497.7 433.7 512 416 512L160 512C142.3 512 128 497.7 128 480L128 224C128 206.3 142.3 192 160 192L256 192C273.7 192 288 177.7 288 160C288 142.3 273.7 128 256 128L160 128z"/>
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="weight-hanging" viewBox="0 0 100 100">
<!--! Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)-->
Expand Down
152 changes: 151 additions & 1 deletion game-library-frontend/app/src/ProjectSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,90 @@
editing = false;
}

</script>
//
// 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
*/
</script>
<style>
.forum-category::before {
content: "";
display: inline-block;
margin-right: 0.125em;
width: 0.75em;
height: 0.75em;
border-radius: 2pt;
background-color: var(--forum-category-color);
flex: 0 0 auto;
}
.module-discussion {
--forum-category-color: #3AB54A;
}
.module-support {
--forum-category-color: #25AAE2;
}
.message-button {
padding-left: .2em !important;
padding-right: .3em !important;
}
.m-r-1 {
margin-right: .3em !important;
}
</style>
{#if error}
<ErrorBox {error} />
{/if}
Expand Down Expand Up @@ -118,6 +200,74 @@
<li><UserChip {ums_url} username={owner} size=24 /></li>
{/each}
</ul>
<button class="btn btn-primary p-0 message-button"
type="button"
title="Send direct message to all project owners"
onclick={messageOwners}>
<svg class="svg-icon">
<use xlink:href="#envelope"></use>
</svg>
<span class="d-button-label">{"Message"+(proj.owners.length>1?" all":"")}</span>
</button>
</div>
<div>
<div class="d-inline-block">
<svg class="svg-icon">
<use xlink:href="#landmark"></use>
</svg>
</div>
<div class="d-inline-flex align-middle">
<div class="d-flex flex-column m-r-1">
<span class="forum-category"
style="--forum-category-color: #3AB54A;">
Module Discussion:
</span>
<span class="forum-category"
style="--forum-category-color: #25AAE2;">
Module Support:
</span>
</div>
<div class="d-flex flex-column m-r-1">
<button class="btn p-0 mx-1"
type="button"
title="Search for posts on this project in the Module Discussion forum"
onclick={searchDiscussion}>
<svg class="svg-icon">
<use xlink:href="#search"></use>
</svg>
<span class="d-button-label">Search</span>
</button>
<button class="btn p-0 mx-1"
type="button"
title="Search for posts on this project in the Module Support forum"
onclick={searchSupport}>
<svg class="svg-icon">
<use xlink:href="#search"></use>
</svg>
<span class="d-button-label">Search</span>
</button>
</div>
<div class="d-flex flex-column">
<button class="btn btn-light p-0 rounded-0"
type="button"
title="Start new topic on this project in the Module Discussion forum"
onclick={postDiscussion}>
<svg class="svg-icon">
<use xlink:href="#pen-to-square"></use>
</svg>
<span class="d-button-label">New topic</span>
</button>
<button class="btn btn-light p-0 rounded-0"
type="button"
title="Start new topic on this project in the Module Support forum"
onclick={postSupport}>
<svg class="svg-icon">
<use xlink:href="#pen-to-square"></use>
</svg>
<span class="d-button-label">New topic</span>
</button>
</div>
</div>
</div>
</div>
<div class="ms-auto">
Expand Down