Skip to content

Commit

Permalink
Allow updating Landing Banner text remotely
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Jul 9, 2024
1 parent 6baf1b5 commit 5c74c9b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ This repository contains the mod installer, used for installing all 07th-mod mod

**The below information is for developers only.**

## Common Installer tasks HOWTO

### Updating landing page and mod page "update" banners

The HTML for the landing page and update banners for each mod is dynamically fetched from this github repo [https://github.com/07th-mod/python-patcher-updates](https://github.com/07th-mod/python-patcher-updates).

To update the html:

- Edit and save the appropriate HTML file
- Push the commit to the repo
- Wait for the release to be published automatically (normally takes 15-30 seconds)

Currently only the landing page and Hou+ implement this updateable html function.

More detail is available in the `Readme.md` page on that repo.

## Python Development Environment Setup

If you have no preference for IDE, I would recommend `Pycharm` as it will help reduce mistakes while you're writing your code. Please conform to the follwing guidelines:
Expand Down
1 change: 1 addition & 0 deletions httpGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ def getSubModHandlesRequestHandler(requestData):
'lastSubModID': self.lastSubModID, # The ID of the last submod installed to - only valid if an install is currently running.
'donationMonthsRemaining': self.donationMonthsRemaining, # How many months the server can be paid for with current funding
'donationProgressPercent': self.donationProgressPercent, # How close funding is to the 12 month donation goal, in percent
'landingBannerHTML': self.getUpdate('Landing Banner'), # HTML for the index page landing banner
},
}

Expand Down
4 changes: 1 addition & 3 deletions httpGUI/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ <h3>Error while checking if installer is latest</h3>
<div class="container">
<div class="row">
<div class="col-md-6">
<h2 class="uppercase mb8">Higurashi Hou Plus</h2>
<p class="lead mb0">New chapter: Higurashi Hou Plus<br></p>
<a class="btn btn-lg" onclick="setModNameAndNavigate('Hou Plus')">INSTALL</a>
<span class="rendered-markdown" v-html="renderHTML(metaInfo.landingBannerHTML)"></span>
</div>
</div>

Expand Down
5 changes: 4 additions & 1 deletion httpGUI/python-patcher-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ window.onload = function onWindowLoaded() {
getLogsZip(subModToInstall, installPath) {
// Calls the function with same name in python-patcher-rest-lib.js
getLogsZip(subModToInstall, installPath);
}
},
renderHTML(htmlText) {
return DOMPurify.sanitize(htmlText);
},
},
computed: {
versionInfoAvailable() {
Expand Down

0 comments on commit 5c74c9b

Please sign in to comment.