currentSone.getOptions().getBooleanOption("ShowNotification/NewPosts").set(showNotificationNewPosts);
boolean showNotificationNewReplies = request.getHttpRequest().isPartSet("show-notification-new-replies");
currentSone.getOptions().getBooleanOption("ShowNotification/NewReplies").set(showNotificationNewReplies);
+ String avatarId =request.getHttpRequest().getPartAsStringFailsafe("avatar-image", 36);
+ currentSone.setAvatar(webInterface.getCore().getImage(avatarId, false));
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("avatar-image", currentSone.getAvatar());
}
templateContext.set("insertion-delay", preferences.getInsertionDelay());
templateContext.set("posts-per-page", preferences.getPostsPerPage());
Page.Options.Option.ShowNotificationNewSones.Description=Show notifications for new Sones.
Page.Options.Option.ShowNotificationNewPosts.Description=Show notifications for new posts.
Page.Options.Option.ShowNotificationNewReplies.Description=Show notifications for new replies.
+Page.Options.Option.Avatar.Delete=No avatar
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.
position: absolute;
}
+#sone .post-avatar {
+ display: inline-block;
+ width: 48px;
+ height: 48px;
+ overflow: hidden;
+}
+
#sone .post > .inner-part {
margin-left: 48px;
padding-left: 0.5em;
#sone #sort-options {
margin-bottom: 1em;
}
+
+#sone ul#avatar-selection {
+ padding: 0;
+}
+
+#sone #avatar-selection li {
+ display: inline-block;
+}
+
+#sone #avatar-selection li .post-avatar {
+ vertical-align: middle;
+ margin-bottom: 0.5em;
+}
<%= Page.Options.Option.ShowNotificationNewReplies.Description|l10n|html>
</p>
+ <%ifnull !currentSone>
+ <ul id="avatar-selection">
+ <li><input type="radio" name="avatar-image" value="none"<%ifnull avatar-image> checked="checked"<%/if>/><%= Page.Options.Option.Avatar.Delete|l10n|html></input></li>
+ <%foreach currentSone.allImages image>
+ <li>
+ <input type="radio" name="avatar-image" value="<%image.id|html>"<%if avatar-image|match key=image.id> checked="checked"<%/if>/>
+ <div class="post-avatar"><% image|image-link max-width=48 max-height=48 mode=enlarge title==image.title></div>
+ </li>
+ <%/foreach>
+ </ul>
+ <%/if>
+
<h2><%= Page.Options.Section.RuntimeOptions.Title|l10n|html></h2>
<p><%= Page.Options.Option.InsertionDelay.Description|l10n|html></p>