-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'LizardByte:master' into andyg.fix-rtp-timestamps
- Loading branch information
Showing
24 changed files
with
947 additions
and
1,063 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,60 +3,45 @@ name: Build GH-Pages | |
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
push: | ||
branches: [master] | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
update_pages: | ||
prep: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout gh-pages | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
path: gh-pages | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token | ||
fetch-depth: 0 # otherwise, will fail to push refs to dest repo | ||
|
||
- name: Prepare gh-pages | ||
run: | | ||
# empty contents | ||
rm -f -r ./gh-pages/* | ||
# copy template back to pages | ||
cp -f -r ./gh-pages-template/. ./gh-pages/ | ||
- name: Upload Artifacts | ||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gh-pages | ||
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` | ||
path: | | ||
${{ github.workspace }}/gh-pages | ||
!**/*.git | ||
- name: Deploy to gh-pages | ||
if: >- | ||
(github.event_name == 'push' && github.ref == 'refs/heads/master') || | ||
(github.event_name == 'workflow_dispatch') | ||
uses: actions-js/[email protected] | ||
with: | ||
github_token: ${{ secrets.GH_BOT_TOKEN }} | ||
author_email: ${{ secrets.GH_BOT_EMAIL }} | ||
author_name: ${{ secrets.GH_BOT_NAME }} | ||
directory: gh-pages | ||
branch: gh-pages | ||
force: false | ||
message: sync gh-pages to ${{ github.sha }} | ||
name: prep | ||
path: gh-pages-template/ | ||
if-no-files-found: error | ||
include-hidden-files: true | ||
retention-days: 1 | ||
|
||
call-jekyll-build: | ||
needs: prep | ||
uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master | ||
with: | ||
site_artifact: 'prep' | ||
target_branch: 'gh-pages' | ||
clean_gh_pages: true | ||
secrets: | ||
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }} | ||
GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }} | ||
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
# See https://github.com/daattali/beautiful-jekyll/blob/master/_config.yml for documented options | ||
|
||
avatar: "/Sunshine/assets/img/navbar-avatar.png" |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<script setup> | ||
const model = defineModel({ required: true }); | ||
const slots = defineSlots(); | ||
const props = defineProps({ | ||
class: { | ||
type: String, | ||
default: "" | ||
}, | ||
desc: { | ||
type: String, | ||
default: null | ||
}, | ||
id: { | ||
type: String, | ||
required: true | ||
}, | ||
label: { | ||
type: String, | ||
default: null | ||
}, | ||
localePrefix: { | ||
type: String, | ||
default: "missing-prefix" | ||
}, | ||
default: { | ||
type: undefined, | ||
default: null, | ||
} | ||
}); | ||
// Add the mandatory class values | ||
const extendedClassStr = (() => { | ||
let values = props.class.split(" "); | ||
if (!values.includes("form-check")) { | ||
values.push("form-check"); | ||
} | ||
return values.join(" "); | ||
})(); | ||
// Map the value to boolean representation if possible, otherwise return null. | ||
const mapToBoolRepresentation = (value) => { | ||
// Try literal values first | ||
if (value === true || value === false) { | ||
return { possibleValues: [true, false], value: value }; | ||
} | ||
if (value === 1 || value === 0) { | ||
return { possibleValues: [1, 0], value: value }; | ||
} | ||
const stringPairs = [ | ||
["true", "false"], | ||
["1", "0"], | ||
["enabled", "disabled"], | ||
["enable", "disable"], | ||
["yes", "no"], | ||
["on", "off"] | ||
]; | ||
value = `${value}`.toLowerCase().trim(); | ||
for (const pair of stringPairs) { | ||
if (value === pair[0] || value === pair[1]) { | ||
return { possibleValues: pair, value: value }; | ||
} | ||
} | ||
return null; | ||
} | ||
// Determine the true/false values for the checkbox | ||
const checkboxValues = (() => { | ||
const mappedValues = (() => { | ||
const boolValues = mapToBoolRepresentation(model.value); | ||
if (boolValues !== null) { | ||
return boolValues.possibleValues; | ||
} | ||
// Return fallback if nothing matches | ||
console.error(`Checkbox value ${model.value} did not match any acceptable pattern!`); | ||
return ["true", "false"]; | ||
})(); | ||
return { truthy: mappedValues[0], falsy: mappedValues[1] }; | ||
})(); | ||
const parsedDefaultPropValue = (() => { | ||
const boolValues = mapToBoolRepresentation(props.default); | ||
if (boolValues !== null) { | ||
// Convert truthy to true/false. | ||
return boolValues.value === boolValues.possibleValues[0]; | ||
} | ||
return null; | ||
})(); | ||
const labelField = props.label ?? `${props.localePrefix}.${props.id}`; | ||
const descField = props.desc ?? `${props.localePrefix}.${props.id}_desc`; | ||
const showDesc = props.desc !== "" || Object.entries(slots).length > 0; | ||
const showDefValue = parsedDefaultPropValue !== null; | ||
const defValue = parsedDefaultPropValue ? "_common.enabled_def_cbox" : "_common.disabled_def_cbox"; | ||
</script> | ||
<template> | ||
<div :class="extendedClassStr"> | ||
<label :for="props.id" :class="`form-check-label${showDesc ? ' mb-2' : ''}`"> | ||
{{ $t(labelField) }} | ||
<div class="mt-0 form-text" v-if="showDefValue"> | ||
{{ $t(defValue) }} | ||
</div> | ||
</label> | ||
<input type="checkbox" | ||
class="form-check-input" | ||
:id="props.id" | ||
v-model="model" | ||
:true-value="checkboxValues.truthy" | ||
:false-value="checkboxValues.falsy" /> | ||
<div class="form-text" v-if="showDesc"> | ||
{{ $t(descField) }} | ||
<slot></slot> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.