ForgeTracker/forgetracker/model/issue.py to ForgeTracker/forgetracker/model/ticket.py
--- a/ForgeTracker/forgetracker/model/issue.py +++ b/ForgeTracker/forgetracker/model/ticket.py @@ -20,17 +20,17 @@ type_s = 'Globals' _id = FieldProperty(schema.ObjectId) project_id = FieldProperty(str) - last_issue_num = FieldProperty(int) + last_ticket_num = FieldProperty(int) status_names = FieldProperty(str) custom_fields = FieldProperty(str) -class IssueHistory(Snapshot): +class TicketHistory(Snapshot): class __mongometa__: - name = 'issue_history' + name = 'ticket_history' def original(self): - return Issue.query.get(_id=self.artifact_id) + return Ticket.query.get(_id=self.artifact_id) def shorthand_id(self): return '%s#%s' % (self.original().shorthand_id(), self.version) @@ -43,24 +43,24 @@ result.update( title_s='Version %d of %s' % ( self.version,self.original().title), - type_s='Issue Snapshot', + type_s='Ticket Snapshot', text=self.data.summary) return result -class Issue(VersionedArtifact): +class Ticket(VersionedArtifact): class __mongometa__: - name = 'issue' - history_class = IssueHistory + name = 'ticket' + history_class = TicketHistory - type_s = 'Issue' + type_s = 'Ticket' _id = FieldProperty(schema.ObjectId) version = FieldProperty(0) created_date = FieldProperty(datetime, if_missing=datetime.utcnow) project_id = FieldProperty(str) parent_id = FieldProperty(schema.ObjectId, if_missing=None) - issue_num = FieldProperty(int) + ticket_num = FieldProperty(int) summary = FieldProperty(str) description = FieldProperty(str, if_missing='') reported_by = FieldProperty(str) @@ -72,15 +72,15 @@ comments = RelationProperty('Comment') def url(self): - return c.app.url + '/' + str(self.issue_num) + '/' + return c.app.url + '/' + str(self.ticket_num) + '/' def shorthand_id(self): - return '%s/%s' % (self.type_s, self.issue_num) + return '%s/%s' % (self.type_s, self.ticket_num) def index(self): result = VersionedArtifact.index(self) result.update( - title_s='Issue %s' % self.issue_num, + title_s='Ticket %s' % self.ticket_num, version_i=self.version, type_s=self.type_s, text=self.summary) @@ -88,18 +88,18 @@ @property def attachments(self): - return Attachment.by_metadata(issue_id=self._id) + return Attachment.by_metadata(ticket_id=self._id) def root_comments(self): if '_id' in self: - return Comment.query.find(dict(issue_id=self._id, reply_to=None)) + return Comment.query.find(dict(ticket_id=self._id, reply_to=None)) else: return [] def reply(self): while True: try: - c = Comment(issue_id=self._id) + c = Comment(ticket_id=self._id) return c except OperationFailure: sleep(0.1) @@ -108,28 +108,28 @@ class Comment(Message): class __mongometa__: - name = 'issue_comment' + name = 'ticket_comment' - type_s = 'Issue Comment' + type_s = 'Ticket Comment' _id = FieldProperty(schema.ObjectId) version = FieldProperty(0) created_date = FieldProperty(datetime, if_missing=datetime.utcnow) project_id = FieldProperty(str) author = FieldProperty(str, if_missing='') - issue_id = ForeignIdProperty(Issue) + ticket_id = ForeignIdProperty(Ticket) kind = FieldProperty(str, if_missing='comment') reply_to_id = FieldProperty(schema.ObjectId, if_missing=None) text = FieldProperty(str) - issue = RelationProperty('Issue') + ticket = RelationProperty('Ticket') def index(self): result = Message.index(self) author = self.author() result.update( title_s='Comment on %s by %s' % ( - self.issue.shorthand_id(), + self.ticket.shorthand_id(), author.display_name ), type_s=self.type_s @@ -137,28 +137,28 @@ return result def url(self): - return self.issue.url() + '#comment-' + str(self._id) + return self.ticket.url() + '#comment-' + str(self._id) def shorthand_id(self): - return '%s-%s' % (self.issue.shorthand_id, self._id) + return '%s-%s' % (self.ticket.shorthand_id, self._id) class Attachment(File): class __mongometa__: name = 'attachment.files' indexes = [ 'metadata.filename', - 'metadata.issue_id' ] + 'metadata.ticket_id' ] # Override the metadata schema here metadata=FieldProperty(dict( - issue_id=schema.ObjectId, + ticket_id=schema.ObjectId, filename=str)) @property - def issue(self): - return Issue.query.get(_id=self.metadata.issue_id) + def ticket(self): + return Ticket.query.get(_id=self.metadata.ticket_id) def url(self): - return self.issue.url() + 'attachment/' + self.filename + return self.ticket.url() + 'attachment/' + self.filename MappedClass.compile_all()
ForgeTracker/forgetracker/templates/edit_issue.html to ForgeTracker/forgetracker/templates/edit_ticket.html
--- a/ForgeTracker/forgetracker/templates/edit_issue.html +++ b/ForgeTracker/forgetracker/templates/edit_ticket.html @@ -13,11 +13,11 @@ <head> <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>${issue.shorthand_id()}</title> + <title>${ticket.shorthand_id()}</title> <link rel="stylesheet" type="text/css" href="${g.app_static('css/hilite.css')}"/> <style> .hidden { display: None } - .issue-num { font-size:20pt } + .ticket-num { font-size:20pt } .top-liner { border-top: 1px solid #ccc } .bottom-liner { border-bottom: 1px solid #ccc } </style> @@ -25,9 +25,9 @@ <body> <div class="container"> - <article class="issue"> + <article class="ticket"> - <h1>${issue.shorthand_id()}</h1> + <h1>${ticket.shorthand_id()}</h1> <div> <a href="../..">PluginRoot</a> Editing @@ -39,24 +39,24 @@ </div> <hr/> -<form method="POST" action="../update_issue"> +<form method="POST" action="../update_ticket"> <div id="header" class="editable viewing span-24 last"> - <h1 class="viewer span-24 last">$issue.summary</h1> + <h1 class="viewer span-24 last">$ticket.summary</h1> <div class="editor"> - <input name="summary" value="$issue.summary" style="width:98%"/> + <input name="summary" value="$ticket.summary" style="width:98%"/> </div> </div> <div class="span-24"> <div class="editable viewing span-8"> <span class="quiet">owner:</span> - <span class="viewer issue-assigned-to">$issue.assigned_to</span> - <input name="assigned_to" value="$issue.assigned_to" class="editor"/> + <span class="viewer ticket-assigned-to">$ticket.assigned_to</span> + <input name="assigned_to" value="$ticket.assigned_to" class="editor"/> </div> <div class="editable viewing span-8"> <span class="quiet">status:</span> - <span class="viewer issue-status">$issue.status</span> + <span class="viewer ticket-status">$ticket.status</span> <select name="status" class="editor"> <option py:for="name in globals.status_names.split(',')" value="$name">$name</option> </select> @@ -64,16 +64,16 @@ <div class="span-8 last"> <span class="quiet">opened:</span> - <span class="issue-create-date">$issue.created_date</span> + <span class="ticket-create-date">$ticket.created_date</span> </div> </div> - <div class="span-24 last issue-description"> + <div class="span-24 last ticket-description"> <div class="span-24 last quiet prepend-top bottom-liner">Description</div> <div class="editable viewing span-24 last"> - <div class="viewer span-24 last" py:content="Markup(g.markdown.convert(issue.description))"/> + <div class="viewer span-24 last" py:content="Markup(g.markdown.convert(ticket.description))"/> <div class="editor"> - <textarea name="description">$issue.description</textarea> + <textarea name="description">$ticket.description</textarea> </div> </div> </div> @@ -82,9 +82,9 @@ <div class="span-24 last quiet prepend-top bottom-liner">Custom Fields</div> <div py:for="field in globals.custom_fields.split(',')" class="editable viewing span-24 last"> <label class="span-4">$field:</label> - <span class="viewer span-20 last">${issue.custom_fields.get(field, '')}</span> + <span class="viewer span-20 last">${ticket.custom_fields.get(field, '')}</span> <span class="editor span-20 last"> - <input name="$field" type="text" style="width:50%" value="${issue.custom_fields.get(field, '')}"/> + <input name="$field" type="text" style="width:50%" value="${ticket.custom_fields.get(field, '')}"/> </span> </div> </div> @@ -92,10 +92,10 @@ <input type="submit" value="submit"/> </form> <hr/> - <div py:if="has_artifact_access('write', issue)()" class="reply title-pane closed"> + <div py:if="has_artifact_access('write', ticket)()" class="reply title-pane closed"> <div class="title">New Attachment</div> <div class="content"> - <form method="post" action="${issue.url() + 'attach'}" enctype="multipart/form-data"> + <form method="post" action="${ticket.url() + 'attach'}" enctype="multipart/form-data"> ${file_field('file_info', 'File to upload')} ${submit_button('Attach file')} </form> @@ -112,7 +112,7 @@ </form> </div> </div> - <py:for each="cmt in issue.root_comments()"> + <py:for each="cmt in ticket.root_comments()"> ${display_comment(cmt)} </py:for> </article>
ForgeTracker/forgetracker/templates/issue.html to ForgeTracker/forgetracker/templates/ticket.html
--- a/ForgeTracker/forgetracker/templates/issue.html +++ b/ForgeTracker/forgetracker/templates/ticket.html @@ -10,11 +10,11 @@ <head> <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>${issue.shorthand_id()}</title> + <title>${ticket.shorthand_id()}</title> <link rel="stylesheet" type="text/css" href="${g.app_static('css/hilite.css')}"/> <style> .hidden { display: None } - .issue-num { font-size:20pt } + .ticket-num { font-size:20pt } .top-liner { border-top: 1px solid #ccc } .bottom-liner { border-bottom: 1px solid #ccc } </style> @@ -22,9 +22,9 @@ <body> <div class="container"> - <article class="issue"> + <article class="ticket"> - <h1>${issue.shorthand_id()}</h1> + <h1>${ticket.shorthand_id()}</h1> <div> <a href="..">PluginRoot</a> <a href="edit/">Edit</a> @@ -38,41 +38,41 @@ <div id="header" class="span-24 last"> - <h1 class="span-24 last">$issue.summary</h1> + <h1 class="span-24 last">$ticket.summary</h1> </div> <div class="span-24"> <div class="span-8"> <span class="quiet">owner:</span> - <span class="issue-assigned-to">$issue.assigned_to</span> + <span class="ticket-assigned-to">$ticket.assigned_to</span> </div> <div class="span-8"> <span class="quiet">status:</span> - <span class="issue-status">$issue.status</span> + <span class="ticket-status">$ticket.status</span> </div> <div class="span-8 last"> <span class="quiet">opened:</span> - <span class="issue-create-date">${issue.created_date.strftime('%H:%M:%S %Y-%m-%d')}</span> + <span class="ticket-create-date">${ticket.created_date.strftime('%H:%M:%S %Y-%m-%d')}</span> </div> </div> - <div class="span-24 last issue-description"> + <div class="span-24 last ticket-description"> <div class="span-24 last quiet prepend-top bottom-liner">Description</div> - <div class="span-24 last" py:content="Markup(g.markdown.convert(issue.description))"/> + <div class="span-24 last" py:content="Markup(g.markdown.convert(ticket.description))"/> </div> <div class="span-24 last custom-fields" py:if="globals.custom_fields"> <div class="span-24 last quiet prepend-top bottom-liner">Custom Fields</div> <div class="span-24 last" py:for="field in globals.custom_fields.split(',')"> <span class="span-4"><label>${field}:</label></span> - <span class="span-20">${issue.custom_fields.get(field, '')}</span> + <span class="span-20">${ticket.custom_fields.get(field, '')}</span> </div> </div> <hr/> <h2>Attachments</h2> - <div py:for="att in issue.attachments"> + <div py:for="att in ticket.attachments"> <a href="${att.url()}">${att.metadata.filename}</a> ($att.length bytes) <div py:if="att.contentType.startswith('image/') or att.contentType.startswith('text/')" @@ -95,7 +95,7 @@ </form> </div> </div> - <py:for each="cmt in issue.root_comments()"> + <py:for each="cmt in ticket.root_comments()"> ${display_comment(cmt)} </py:for> </article>
ForgeTracker/forgetracker/templates/new_issue.html to ForgeTracker/forgetracker/templates/new_ticket.html
File was renamed.
ForgeTracker/forgetracker/widgets/issue_form.py to ForgeTracker/forgetracker/widgets/ticket_form.py
--- a/ForgeTracker/forgetracker/widgets/issue_form.py +++ b/ForgeTracker/forgetracker/widgets/ticket_form.py @@ -2,8 +2,8 @@ from pylons import c from forgetracker import model -issue_form = twf.TableForm('issue_form', action='../save_issue', children=[ - twf.HiddenField('issue_num'), +ticket_form = twf.TableForm('ticket_form', action='../save_ticket', children=[ + twf.HiddenField('ticket_num'), twf.TextField('summary'), twf.Spacer(), twf.TextArea('description', suppress_label=True),