Skip to content

Commit 5c74c9b

Browse files
committed
Allow updating Landing Banner text remotely
1 parent 6baf1b5 commit 5c74c9b

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ This repository contains the mod installer, used for installing all 07th-mod mod
66

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

9+
## Common Installer tasks HOWTO
10+
11+
### Updating landing page and mod page "update" banners
12+
13+
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).
14+
15+
To update the html:
16+
17+
- Edit and save the appropriate HTML file
18+
- Push the commit to the repo
19+
- Wait for the release to be published automatically (normally takes 15-30 seconds)
20+
21+
Currently only the landing page and Hou+ implement this updateable html function.
22+
23+
More detail is available in the `Readme.md` page on that repo.
24+
925
## Python Development Environment Setup
1026

1127
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:

httpGUI.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ def getSubModHandlesRequestHandler(requestData):
920920
'lastSubModID': self.lastSubModID, # The ID of the last submod installed to - only valid if an install is currently running.
921921
'donationMonthsRemaining': self.donationMonthsRemaining, # How many months the server can be paid for with current funding
922922
'donationProgressPercent': self.donationProgressPercent, # How close funding is to the 12 month donation goal, in percent
923+
'landingBannerHTML': self.getUpdate('Landing Banner'), # HTML for the index page landing banner
923924
},
924925
}
925926

httpGUI/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ <h3>Error while checking if installer is latest</h3>
6363
<div class="container">
6464
<div class="row">
6565
<div class="col-md-6">
66-
<h2 class="uppercase mb8">Higurashi Hou Plus</h2>
67-
<p class="lead mb0">New chapter: Higurashi Hou Plus<br></p>
68-
<a class="btn btn-lg" onclick="setModNameAndNavigate('Hou Plus')">INSTALL</a>
66+
<span class="rendered-markdown" v-html="renderHTML(metaInfo.landingBannerHTML)"></span>
6967
</div>
7068
</div>
7169

httpGUI/python-patcher-index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ window.onload = function onWindowLoaded() {
126126
getLogsZip(subModToInstall, installPath) {
127127
// Calls the function with same name in python-patcher-rest-lib.js
128128
getLogsZip(subModToInstall, installPath);
129-
}
129+
},
130+
renderHTML(htmlText) {
131+
return DOMPurify.sanitize(htmlText);
132+
},
130133
},
131134
computed: {
132135
versionInfoAvailable() {

0 commit comments

Comments
 (0)