idea¶
Represent an idea
-
class
IdeaCollection()¶ Ideas collection
- Extends
app.models.base.BaseCollection()
-
IdeaCollection.app.models.idea.IdeaCollection.url¶ - Type
string
-
IdeaCollection.getOrderForNewRootIdea()¶ Returns the order number for a new root idea
- Return type
Number
-
IdeaCollection.getRootIdea()¶ Returns the root idea
- Return type
Object
-
IdeaCollection.updateRootIdeasOrder()¶ Updates the order in the idea list
-
IdeaCollection.visitBreadthFirst(idea_links, visitor, origin_id, ancestry)¶ - Arguments
idea_links (Object) – The collection of idea_links to navigate
visitor (Object) – Visitor function
origin_id (String) – the id of the root
ancestry (Object) – Internal recursion parameter, do not set or use
-
IdeaCollection.visitDepthFirst(idea_links, visitor, origin_id, ancestry)¶ - Arguments
idea_links (Object) – The collection of idea_links to navigate
visitor (Object) – Visitor function
origin_id (String) – the id of the root
ancestry (Object) – Internal recursion parameter, do not set or use
-
class
IdeaModel()¶ Idea model Frontend model for
assembl.models.idea.Idea- Extends
app.models.base.BaseModel()
-
IdeaModel.app.models.idea.IdeaModel.urlRoot¶ - Type
string
-
IdeaModel.addChild(idea)¶ Adds an idea as child
- Arguments
idea (Idea) –
-
IdeaModel.addSegment(segment)¶ Adds a segment
- Arguments
segment (Object) –
-
IdeaModel.addSegmentAsChild(segment)¶ Creates a new instance of a segment as a child within the collection and returns the newly created idea.
- Arguments
segment, (Segment) – possibly unsaved.
- Return type
Object
-
IdeaModel.addSiblingAbove(idea)¶ Adds an idea as sibling above
- Arguments
idea (Idea) –
-
IdeaModel.addSiblingBelow(idea)¶ Adds an idea as sibling below
- Arguments
idea (Idea) –
-
IdeaModel.adjust_num_read_posts()¶ Set the number of read posts
-
IdeaModel.getAncestry()¶ Returns an array of Idea models in order of ancestry From current idea -> parent idea, including the current idea itself.
- Return type
Array
-
IdeaModel.getApplicableAnnouncementPromise()¶ Returns a promise for the announcement to be displayed in the message-list, if any
- Return type
Promise
-
IdeaModel.getChildren()¶ Return all children’s idea
- Return type
Array
-
IdeaModel.getDefinitionDisplayText()¶ Returns the display text for a idea definition. Will return the first non-empty from: definition, longTitle, i18n.gettext(‘Add a definition for this idea’)
- Return type
string
-
IdeaModel.getExtractsPromise()¶ Return a promise for all Extracts models for this idea
- Return type
Promise
-
IdeaModel.getLongTitleDisplayText()¶ Returns the display text for a idea synthesis expression. Will return the first non-empty from: longTitle, shortTitle, i18n.gettext(‘Add and expression for the next synthesis’)
- Return type
string
-
IdeaModel.getOrderForNewChild()¶ Returns the order number for a new child
- Return type
number
-
IdeaModel.getParent()¶ Return the parent idea
- Returns
or undefined
- Return type
Object
-
IdeaModel.getShortTitleDisplayText()¶ HTML Striping if necessary is the responsability of the caller.
- Returns
The short Title to be displayed
- Return type
string
-
IdeaModel.initialize()¶
-
IdeaModel.isDescendantOf(idea)¶ Return if the idea is descendant of the given idea
- Arguments
idea (Object) –
- Return type
boolean
-
IdeaModel.isRootIdea()¶ Returns true if the current idea is the root idea
- Return type
boolean
-
IdeaModel.parse()¶ Returns the attributes hash to be set on the model
-
IdeaModel.set(key, val, options)¶ Set a hash of attributes on the model.
- Arguments
key (String) –
val (val) –
options (Object) –
- Return type
Object
-
IdeaModel.updateChildrenOrder()¶ Updates the order in all children
-
IdeaModel.validate()¶ Validate the model attributes