import net.pterodactylus.sone.core.Core.Preferences;
import net.pterodactylus.sone.data.Sone;
+import net.pterodactylus.sone.data.Sone.ShowCustomAvatars;
import net.pterodactylus.sone.fcp.FcpInterface.FullAccessRequired;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.number.Numbers;
currentSone.getOptions().getBooleanOption("ShowNotification/NewPosts").set(showNotificationNewPosts);
boolean showNotificationNewReplies = request.getHttpRequest().isPartSet("show-notification-new-replies");
currentSone.getOptions().getBooleanOption("ShowNotification/NewReplies").set(showNotificationNewReplies);
+ String showCustomAvatars = request.getHttpRequest().getPartAsStringFailsafe("show-custom-avatars", 32);
+ currentSone.getOptions().<ShowCustomAvatars> getEnumOption("ShowCustomAvatars").set(ShowCustomAvatars.valueOf(showCustomAvatars));
webInterface.getCore().touchConfiguration();
}
Integer insertionDelay = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("insertion-delay", 16));
templateContext.set("show-notification-new-sones", currentSone.getOptions().getBooleanOption("ShowNotification/NewSones").get());
templateContext.set("show-notification-new-posts", currentSone.getOptions().getBooleanOption("ShowNotification/NewPosts").get());
templateContext.set("show-notification-new-replies", currentSone.getOptions().getBooleanOption("ShowNotification/NewReplies").get());
+ templateContext.set("show-custom-avatars", currentSone.getOptions().<ShowCustomAvatars> getEnumOption("ShowCustomAvatars").get().name());
}
templateContext.set("insertion-delay", preferences.getInsertionDelay());
templateContext.set("posts-per-page", preferences.getPostsPerPage());
Page.Options.Option.ShowNotificationNewPosts.Description=Show notifications for new posts.
Page.Options.Option.ShowNotificationNewReplies.Description=Show notifications for new replies.
Page.Options.Section.AvatarOptions.Title=Avatar Options
-
+Page.Options.Option.ShowAvatars.Description=You can disable custom avatars here, depending on the selected criteria. If an avatar is disabled for a Sone, the automatically generated avatar is shown instead.
+Page.Options.Option.ShowAvatars.Never.Description=Never show custom avatars.
+Page.Options.Option.ShowAvatars.Followed.Description=Only show avatars for Sones that you follow.
+Page.Options.Option.ShowAvatars.ManuallyTrusted.Description=Only show avatars for Sones that you have manually assigned a trust value larger than 0 to.
+Page.Options.Option.ShowAvatars.Trusted.Description=Only show avatars for Sones that have a trust value larger than 0.
+Page.Options.Option.ShowAvatars.Always.Description=Always show custom avatars. Be warned: some avatars might contain disturbing or offensive imagery.
Page.Options.Section.RuntimeOptions.Title=Runtime Behaviour
Page.Options.Option.InsertionDelay.Description=The number of seconds the Sone inserter waits after a modification of a Sone before it is being inserted.
Page.Options.Option.PostsPerPage.Description=The number of posts to display on a page before pagination controls are being shown.
#sone #avatar-selection li#no-avatar {
display: block;
}
+
+#sone form#options ul {
+ padding-left: 1em;
+}
+
+#sone form#options li {
+ list-style-type: none;
+}
<%= Page.Options.Option.ShowNotificationNewReplies.Description|l10n|html>
</p>
- <%ifnull !currentSone>
- <%/if>
+ <h2><%= Page.Options.Section.AvatarOptions.Title|l10n|html></h2>
+
+ <p><%= Page.Options.Option.ShowAvatars.Description|l10n|html></p>
+
+ <ul>
+ <li>
+ <input type="radio" name="show-custom-avatars" value="NEVER"<%if show-custom-avatars|match value=NEVER> checked="checked"<%/if>/>
+ <%=Page.Options.Option.ShowAvatars.Never.Description|l10n|html>
+ </li>
+ <li>
+ <input type="radio" name="show-custom-avatars" value="FOLLOWED"<%if show-custom-avatars|match value=FOLLOWED> checked="checked"<%/if>/>
+ <%=Page.Options.Option.ShowAvatars.Followed.Description|l10n|html>
+ </li>
+ <li>
+ <input type="radio" name="show-custom-avatars" value="MANUALLY_TRUSTED"<%if show-custom-avatars|match value=MANUALLY_TRUSTED> checked="checked"<%/if>/>
+ <%=Page.Options.Option.ShowAvatars.ManuallyTrusted.Description|l10n|html>
+ </li>
+ <li>
+ <input type="radio" name="show-custom-avatars" value="TRUSTED"<%if show-custom-avatars|match value=TRUSTED> checked="checked"<%/if>/>
+ <%=Page.Options.Option.ShowAvatars.Trusted.Description|l10n|html>
+ </li>
+ <li>
+ <input type="radio" name="show-custom-avatars" value="ALWAYS"<%if show-custom-avatars|match value=ALWAYS> checked="checked"<%/if>/>
+ <%=Page.Options.Option.ShowAvatars.Always.Description|l10n|html>
+ </li>
+ </ul>
<h2><%= Page.Options.Section.RuntimeOptions.Title|l10n|html></h2>