From: David ‘Bombe’ Roden Date: Sat, 15 Jan 2011 20:25:20 +0000 (+0100) Subject: Make web of trust comment configurable. (#24) X-Git-Tag: 0.4^2~8^2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ea4ab9f63c90fef520d9ffded078ade1cd467445;p=Sone.git Make web of trust comment configurable. (#24) This also closes #1 for now. --- diff --git a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java index 0c2dbcf..35f54a1 100644 --- a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java +++ b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java @@ -59,6 +59,11 @@ public class OptionsPage extends SoneTemplatePage { options.getIntegerOption("PositiveTrust").set(positiveTrust); Integer negativeTrust = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("negative-trust", 3), options.getIntegerOption("NegativeTrust").getReal()); options.getIntegerOption("NegativeTrust").set(negativeTrust); + String trustComment = request.getHttpRequest().getPartAsStringFailsafe("trust-comment", 256); + if (trustComment.trim().length() == 0) { + trustComment = null; + } + options.getStringOption("TrustComment").set(trustComment); boolean soneRescueMode = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("sone-rescue-mode", 5)); options.getBooleanOption("SoneRescueMode").set(soneRescueMode); boolean clearOnNextRestart = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("clear-on-next-restart", 5)); @@ -71,6 +76,7 @@ public class OptionsPage extends SoneTemplatePage { template.set("insertion-delay", options.getIntegerOption("InsertionDelay").get()); template.set("positive-trust", options.getIntegerOption("PositiveTrust").get()); template.set("negative-trust", options.getIntegerOption("NegativeTrust").get()); + template.set("trust-comment", options.getStringOption("TrustComment").get()); template.set("sone-rescue-mode", options.getBooleanOption("SoneRescueMode").get()); template.set("clear-on-next-restart", options.getBooleanOption("ClearOnNextRestart").get()); template.set("really-clear-on-next-restart", options.getBooleanOption("ReallyClearOnNextRestart").get()); diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 686ba65..d5d436b 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -30,6 +30,7 @@ Page.Options.Option.InsertionDelay.Description=The number of seconds the Sone in Page.Options.Section.TrustOptions.Title=Trust Settings Page.Options.Option.PositiveTrust.Description=The amount of positive trust you want to assign to other Sones by clicking the checkmark below a post or reply. Page.Options.Option.NegativeTrust.Description=The amount of trust you want to assign to other Sones by clicking the red X below a post or reply. This value should be negative. +Page.Options.Option.TrustComment.Description=The comment that will be set in the web of trust for any trust you assign from Sone. Page.Options.Section.RescueOptions.Title=Rescue Settings Page.Options.Option.SoneRescueMode.Description=Try to rescue your Sones at the next start of the Sone plugin. This will read your all your old Sones from Freenet and ignore any disappearing postings and replies. You have to unlock your local Sones after they have been restored and you have to manually disable the rescue mode once you are satisfied with what has been restored! Page.Options.Section.Cleaning.Title=Clean Up diff --git a/src/main/resources/templates/options.html b/src/main/resources/templates/options.html index 029837b..5c47764 100644 --- a/src/main/resources/templates/options.html +++ b/src/main/resources/templates/options.html @@ -28,6 +28,9 @@

<%= Page.Options.Option.NegativeTrust.Description|l10n|html>

+

<%= Page.Options.Option.TrustComment.Description|l10n|html>

+

+

<%= Page.Options.Section.RescueOptions.Title|l10n|html>

<%= Page.Options.Option.SoneRescueMode.Description|l10n|html>