-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement version and copyright renders
- Loading branch information
1 parent
2d8e283
commit 880d2c2
Showing
9 changed files
with
115 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Copyright (c) 2024, Rafael Santiago | ||
// All rights reserved. | ||
// | ||
// This source code is licensed under the GPLv2 license found in the | ||
// COPYING.GPLv2 file in the root directory of Eutherpe's source tree. | ||
// | ||
package renders | ||
|
||
import ( | ||
"internal/vars" | ||
"strings" | ||
) | ||
|
||
func CopyrightRender(templatedInput string, _ *vars.EutherpeVars) string { | ||
return strings.Replace(templatedInput, vars.EutherpeTemplateNeedleCopyrightDisclaimer, | ||
vars.EutherpeCopyrightDisclaimer, -1) | ||
} |
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,21 @@ | ||
// | ||
// Copyright (c) 2024, Rafael Santiago | ||
// All rights reserved. | ||
// | ||
// This source code is licensed under the GPLv2 license found in the | ||
// COPYING.GPLv2 file in the root directory of Eutherpe's source tree. | ||
// | ||
package renders | ||
|
||
import ( | ||
"internal/vars" | ||
"testing" | ||
) | ||
|
||
func TestCopyrightRender(t *testing.T) { | ||
output := CopyrightRender(vars.EutherpeTemplateNeedleCopyrightDisclaimer, | ||
nil) | ||
if output != vars.EutherpeCopyrightDisclaimer { | ||
t.Errorf("CopyrightDisclaimer() is not rendering accordingly.\n") | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,10 +170,11 @@ <h3>🔈 You are connected to device: /dev/deepblue42</h3> | |
</center> | ||
</div> | ||
<div id="Settings" class="configcontent" style="display:none;"> | ||
<h3>🔨 Settings</h3></td><td> | ||
<h3>🔨 Settings</h3> | ||
<div align="right"> | ||
<input class="eutherpeBUTTON" type="button" value="🥾 Reboot" onclick="reboot();"/> | ||
<input class="eutherpeBUTTON" type="button" value="🔌 Power-off" onclick="powerOff();"/> | ||
<input class="eutherpeBUTTON" type="button" value="🦉 About..." onclick="showAboutDiv();"/> | ||
</div> | ||
<hr> | ||
<div style="text-align: center; padding: 10%;"> | ||
|
@@ -209,6 +210,16 @@ <h3>🔨 Settings</h3></td><td> | |
<input class="eutherpeBUTTON" type="button" value="Save" onclick="saveWiFiCredentials();"/> | ||
<input class="eutherpeBUTTON" type="button" value="Back" onclick="closeWiFiCredentials();"/> | ||
</div> | ||
<div id="About" class="configcontent" style="text-align: left; padding: 1%; display: none;"> | ||
<h3>📌 About 🎼 🎵 🔊 🎧 💃 🕺 🎷 🎹 🎤 🎺 🎻 🥁 🎸 🎶 🤘</h3> | ||
<hr> | ||
You are using Eutherpe-v1<br><br> | ||
Eutherpe is Copyright (c) 2024 by Rafael Santiago<br><br>You can redistribute it and/or modify under the terms of the GNU General Public License version 2.<br><br>Bug reports, feedback etc: <a href="mailto:[email protected]"?subject="[Eutherpe] <here goes the subject>"><u>mail me</u></a> or open an <a href="https://github.com/rafael-santiago/eutherpe/issues"><u>issue</u></a> at Eutherpe's project repository. Thanks in advance! 😉 | ||
<hr> | ||
<center> | ||
<input class="eutherpeBUTTON" type="button" value="Back" onclick="closeAbout();"/> | ||
</center> | ||
</div> | ||
<input type="hidden" id="lastSelection" name="lastSelection" value=""/> | ||
<input type="hidden" id="lastError" name="lastError" value=""/> | ||
<input type="hidden" id="lastQueryAnswer" name="lastQueryAnswer" value="false"/> | ||
|
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,18 @@ | ||
// | ||
// Copyright (c) 2024, Rafael Santiago | ||
// All rights reserved. | ||
// | ||
// This source code is licensed under the GPLv2 license found in the | ||
// COPYING.GPVv2 file in the root directory of Eutherpe's source tree. | ||
// | ||
package renders | ||
|
||
import ( | ||
"internal/vars" | ||
"strings" | ||
) | ||
|
||
func VersionRender(templatedInput string, _ *vars.EutherpeVars) string { | ||
return strings.Replace(templatedInput, vars.EutherpeTemplateNeedleVersion, | ||
vars.EutherpeVersion, -1) | ||
} |
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,20 @@ | ||
// | ||
// Copyright (c) 2024, Rafael Santiago | ||
// All rights reserved. | ||
// | ||
// This source code is licensed under the GPLv2 license found in the | ||
// COPYING.GPLv2 file in the root directory of Eutherpe's source tree. | ||
// | ||
package renders | ||
|
||
import ( | ||
"internal/vars" | ||
"testing" | ||
) | ||
|
||
func TestVersionRender(t *testing.T) { | ||
output := VersionRender(vars.EutherpeTemplateNeedleVersion, nil) | ||
if output != vars.EutherpeVersion { | ||
t.Errorf("VersionRender() is not rendering accordingly.\n") | ||
} | ||
} |
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 |
---|---|---|
|
@@ -476,6 +476,9 @@ func (e *EutherpeVars) TuneUp() { | |
e.HTTPd.Port = "8080" | ||
} | ||
|
||
const EutherpeVersion = "v1" | ||
const EutherpeCopyrightDisclaimer = "Eutherpe is Copyright (c) 2024 by Rafael Santiago<br><br>You can redistribute it and/or modify under the terms of the GNU General Public License version 2.<br><br>Bug reports, feedback etc: <a href=\"mailto:[email protected]\"?subject=\"[Eutherpe] <here goes the subject>\"><u>mail me</u></a> or open an <a href=\"https://github.com/rafael-santiago/eutherpe/issues\"><u>issue</u></a> at Eutherpe's project repository. Thanks in advance! 😉" | ||
|
||
const EutherpeActionId = "action" | ||
|
||
// INFO(Rafael): Actions from "Music" sheet. | ||
|
@@ -589,6 +592,8 @@ const EutherpeTemplateNeedleFoundStorageDevicesCount = "{{.FOUND-STORAGE-DEVICES | |
const EutherpeTemplateNeedleFoundBluetoothDevicesCount = "{{.FOUND-BLUETOOTH-DEVICES-COUNT}}" | ||
const EutherpeTemplateNeedleESSID = "{{.ESSID}}" | ||
const EutherpeTemplateNeedleHostName = "{{.HOSTNAME}}" | ||
const EutherpeTemplateNeedleVersion = "{{.EUTHERPE-VERSION}}" | ||
const EutherpeTemplateNeedleCopyrightDisclaimer = "{{.EUTHERPE-COPYRIGHT-DISCLAIMER}}" | ||
|
||
const EutherpeWebUIConfigSheetMusic = "Music" | ||
const EutherpeWebUIConfigSheetCollection = "Collection" | ||
|
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