* Separated the global setup settings from those in the root site's preferences
* Added encoding="form" parameter to most of the macros using the request handler * Renamed commentsMode to commentMode (comments_mode to comment_mode in DB) * Reactivated notifications in a simplified manner * Throw an error in global sendMail() method if arguments are not sufficient * Added HopObject.notify() method * Added HopObject.kind_macro() method (provides the constructor's name in lowercase) * Added Messages.skin containing subskins suited for e-mail output * Removed obsolete skin files * Added reset_action() method for resetting a user's password to Members prototype * Added require() method to Membership prototype; wrapped static require() method around it * Added Membership.notify() method which does all the member-related notification stuff * Send notification on membership removal * Fixed contact form in Membership prototype * Dropped e-mail property from Site prototype (users can be contacted via Membership.contact_action(), Root prototype has extra e-mail property) * Added missing getPermission() method to User prototype, always requiring a privileged user
This commit is contained in:
parent
504260650e
commit
3e8c4c6313
34 changed files with 336 additions and 276 deletions
|
@ -25,15 +25,18 @@
|
|||
Site.getStatus = defineConstants(Site, "blocked", "regular", "trusted");
|
||||
Site.getModes = defineConstants(Site, "closed", "restricted", "public", "open");
|
||||
Site.getPageModes = defineConstants(Site, "days", "stories");
|
||||
Site.getCommentsModes = defineConstants(Site, "disabled", "enabled");
|
||||
Site.getCommentModes = defineConstants(Site, "disabled", "enabled");
|
||||
Site.getArchiveModes = defineConstants(Site, "closed", "public");
|
||||
Site.getNotificationModes = defineConstants(Site, "Nobody",
|
||||
"Owner", "Manager", "Contributor", "Subscriber" );
|
||||
|
||||
this.handleMetadata("archiveMode");
|
||||
this.handleMetadata("commentsMode");
|
||||
this.handleMetadata("commentMode");
|
||||
this.handleMetadata("email");
|
||||
this.handleMetadata("language");
|
||||
this.handleMetadata("lastUpdate");
|
||||
this.handleMetadata("longDateFormat");
|
||||
this.handleMetadata("notificationMode");
|
||||
this.handleMetadata("notifiedOfBlocking");
|
||||
this.handleMetadata("notifiedOfDeletion");
|
||||
this.handleMetadata("offlineSince");
|
||||
|
@ -63,8 +66,9 @@ Site.prototype.constructor = function(name, title) {
|
|||
mode: Site.CLOSED,
|
||||
tagline: "",
|
||||
webHookEnabled: false,
|
||||
commentsMode: Site.OPEN,
|
||||
commentMode: Site.OPEN,
|
||||
archiveMode: Site.PUBLIC,
|
||||
notificationMode: Site.DISABLED,
|
||||
pageMode: Site.DAYS,
|
||||
pageSize: 3,
|
||||
language: locale.getLanguage(),
|
||||
|
@ -151,32 +155,32 @@ Site.prototype.edit_action = function() {
|
|||
};
|
||||
|
||||
Site.prototype.getFormOptions = function(name) {
|
||||
var options = [];
|
||||
switch (name) {
|
||||
case "archiveMode":
|
||||
options = Site.getArchiveModes(); break;
|
||||
case "commentsMode":
|
||||
options = Site.getCommentsModes(); break;
|
||||
return Site.getArchiveModes();
|
||||
case "commentMode":
|
||||
return Site.getCommentModes();
|
||||
case "language":
|
||||
options = getLocales(); break;
|
||||
return getLocales();
|
||||
case "layout":
|
||||
options = this.getLayouts(); break;
|
||||
return this.getLayouts();
|
||||
case "longDateFormat":
|
||||
options = getDateFormats("long"); break;
|
||||
return getDateFormats("long");
|
||||
case "mode":
|
||||
options = Site.getModes(); break;
|
||||
return Site.getModes();
|
||||
case "notificationMode":
|
||||
return Site.getNotificationModes();
|
||||
case "pageMode":
|
||||
options = Site.getPageModes(); break;
|
||||
return Site.getPageModes();
|
||||
case "status":
|
||||
options = Site.getStatus(); break;
|
||||
return Site.getStatus();
|
||||
case "shortDateFormat":
|
||||
options = getDateFormats("short"); break;
|
||||
return getDateFormats("short");
|
||||
case "timeZone":
|
||||
options = getTimeZones(); break;
|
||||
return getTimeZones();
|
||||
default:
|
||||
return HopObject.prototype.getFormOptions.apply(this, arguments);
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
Site.prototype.update = function(data) {
|
||||
|
@ -204,8 +208,9 @@ Site.prototype.update = function(data) {
|
|||
webHookEnabled: data.webHookEnabled ? true : false,
|
||||
pageMode: data.pageMode || Site.DAYS,
|
||||
pageSize: parseInt(data.pageSize, 10) || 3,
|
||||
commentsMode: data.commentsMode || Site.DISABLED,
|
||||
commentMode: data.commentMode || Site.DISABLED,
|
||||
archiveMode: data.archiveMode || Site.CLOSED,
|
||||
notificationMode: data.notificationMode || Site.DISABLED,
|
||||
timeZone: data.timeZone,
|
||||
longDateFormat: data.longDateFormat,
|
||||
shortDateFormat: data.shortDateFormat,
|
||||
|
|
|
@ -68,8 +68,8 @@ You can change it anytime you want.</p>
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="small">Comments:</td>
|
||||
<td><% site.checkbox commentsMode %>
|
||||
<label for="commentsMode">enabled</label></td>
|
||||
<td><% site.checkbox commentMode %>
|
||||
<label for="commentMode">enabled</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small">Archive:</td>
|
||||
|
@ -93,12 +93,9 @@ You can change it anytime you want.</p>
|
|||
<td><% site.select shortDateFormat %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- FIXME: should site.email be dropped? afaik,
|
||||
bounces should be sent to sys.email? [tobi] -->
|
||||
<td class="small" valign="top">e-mail address:</td>
|
||||
<td><% site.input email %><br />
|
||||
<span class="small">This e-mail address will be used for sending confirmation
|
||||
mails, i.e. when a user registers or signs up a site.</span></td>
|
||||
<td class="small">Notifications:</td>
|
||||
<td><% site.select notificationMode %></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small" valign="top">Web hook:</td>
|
||||
|
@ -113,22 +110,9 @@ mails, i.e. when a user registers or signs up a site.</span></td>
|
|||
<% link layouts "Go to the layouts page" %> to browse, manage or
|
||||
test-drive the list of available layouts.</span></td>
|
||||
</tr>
|
||||
|
||||
<!--tr>
|
||||
<td colspan="2"><div class="listSeparator"> </div>
|
||||
<strong><a name="index">Index Maintenance</a></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><span class="small">If the search index of your site is corrupt you can
|
||||
schedule it for rebuilding by klicking on the button below:
|
||||
<% input type="submit" name="rebuildIndex" value="rebuild index"
|
||||
style="display:block;margin:5px 0;" %>Please bear in mind that rebuilding the
|
||||
search index is a quite ressource-intensive operation, so please use this
|
||||
feature only when it's really necessary (e.g. if you receive an error when
|
||||
trying to search).</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="listSeparator"> </div>
|
||||
<strong><a name="spamfilter">Referrer spam filter</a></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -139,7 +123,6 @@ per line to be applied on every URL in the referrer and backlink lists.</td>
|
|||
as="editor" cols="30" rows="7" %></td>
|
||||
</tr-->
|
||||
|
||||
<% site.notification %>
|
||||
<% site.modulePreferences %>
|
||||
|
||||
<tr>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<form action="<% response.action %>" method="get">
|
||||
<input type="text" name="filter" value="<% request.filter %>" size="30" />
|
||||
<input type="text" name="filter" value="<% request.filter encoding="form" %>"
|
||||
size="30" />
|
||||
<input type="submit" name="submit" value="Filter" />
|
||||
<input type="button" onclick="document.location='<% site.href
|
||||
action="referrers" %>';" value="Reset" />
|
||||
<div class="small">
|
||||
<input type="checkbox" name="includeSpam" value="checked"
|
||||
<% request.includeSpam prefix='checked="' suffix='"' %> />
|
||||
<% request.includeSpam prefix='checked="' suffix='"' encoding="form" %> />
|
||||
include referrer spam
|
||||
</div>
|
||||
<br />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue