* Fixed reference to parent site in Archive
* Fixed _children.filter in Archive * Added missing permission checks * Modified global defineConstants() method to return the getter function instead of automatically defining it with given argument * Added HopObject.macro_macro() method to display userland macro code * Removed colorpicker (will be replaced by third-party library) * Removed obsolete global constants and functions * Overhauled and tested global userland macros like story_macro(), image_macro() etc. * Implemented global list_macro() to replace any special listFoobar_macro() methods * Moved global autoLogin() method into User prototype * Overhauled global randomize_macro() * Renamed global evalURL() method to validateUrl() as well as evalEmail() to validateEmail() * Re-added accidentally removed subskins to Members.skin * Fixed some skin names which were changed recently * Remove delete_action() from Membership * Fixed foreign key of images collection in Membership * Removed global username_macro() and replaced it with appropriate membership macros * Moved contents of systemscripts.skin into javascript.skin in Root prototype * Removed main_css_action(), main_js_action() and sitecounter_macro() methods from Root * Added accessname to sites collection in Root * Upgraded jQuery to version 1.2.1 * Replaced call for global history_macro() with corresponding list_macro() call * Renamed "public" collection of Stories prototype to "featured" * Moved a lot of styles from Root's style.skin to the one in Site * Added comments collection to Site * Moved embed.skin as subskin #embed into Site.skin * Fixed some minor issues in Story.js (removed check for creator before setting the story's mode) * Defined cookie names as constants of User which can be overriden via app.properties userCookie and hashCookie * Moved a lot of code into compatibility module
This commit is contained in:
parent
ded7f5fcea
commit
df9017ab77
38 changed files with 1154 additions and 1736 deletions
|
@ -31,7 +31,8 @@ Archive.prototype.constructor = function(name, parent) {
|
|||
};
|
||||
|
||||
Archive.prototype.getPermission = function(action) {
|
||||
if (!this._parent.getPermission("main")) {
|
||||
var site = res.handlers.site;
|
||||
if (!site.getPermission("main")) {
|
||||
return false;
|
||||
}
|
||||
switch (action) {
|
||||
|
@ -40,7 +41,7 @@ Archive.prototype.getPermission = function(action) {
|
|||
case "next":
|
||||
return this.getPage() < this.getSize() / this.getPageSize();
|
||||
default:
|
||||
return this._parent.archiveMode === Site.PUBLIC;
|
||||
return site.archiveMode === Site.PUBLIC;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
@ -113,7 +114,7 @@ Archive.prototype.list_macro = function(param, type) {
|
|||
if (!this.parent) {
|
||||
var site = res.handlers.site;
|
||||
var offset = (page - 1) * pageSize;
|
||||
var stories = site.stories["public"].list(offset, pageSize);
|
||||
var stories = site.stories.featured.list(offset, pageSize);
|
||||
for each (var story in stories) {
|
||||
renderStory(story);
|
||||
};
|
||||
|
@ -190,7 +191,7 @@ Archive.prototype.getFilter = function() {
|
|||
res.push();
|
||||
res.write("where site_id = ");
|
||||
res.write(site._id);
|
||||
res.write(" and prototype = 'Story' and status <> 'private'");
|
||||
res.write(" and prototype = 'Story' and status <> 'closed'");
|
||||
var part;
|
||||
if (part = this.getDate("year")) {
|
||||
res.write(" and year(created) = " + part);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
_children = collection(Story)
|
||||
_children.local = id
|
||||
_children.foreign = site_id
|
||||
_children.filter = prototype = 'Story' and status <> 'private'
|
||||
_children.filter = prototype = 'Story' and status <> 'closed'
|
||||
_children.order = created desc
|
||||
_children.group = date_format(created, "%Y%m%d")
|
||||
#_children.group.prototype = Archive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue