{# Copyright (C) 2007-2014 Edgewall Software This software is licensed as described in the file COPYING, which you should have received as part of this distribution. The terms are also available at http://trac.edgewall.com/license.html. This software consists of voluntary contributions made by many individuals. For the exact contribution history, see the revision history and logs, available at http://trac.edgewall.org/. #} # extends 'layout.html' # block title # if ticket.exists: ${'#'}${ticket.id} (${ticket.summary}) # else: ${_("New Ticket")} # endif ${ super() } # endblock title # block head ${ super() } # if ticket.exists: # endif # endblock head

# macro commentref(prefix, cnum, cls=none) ${prefix}${cnum} # endmacro

# block content
# set preview_mode = 'preview' in req.args # set can_append = 'TICKET_APPEND' in perm(ticket.resource) # set can_create = ('TICKET_CREATE' in perm(ticket.resource) and not ticket.exists) # set can_modify = 'TICKET_CHGPROP' in perm(ticket.resource) # set can_edit = 'TICKET_EDIT_DESCRIPTION' in perm(ticket.resource) # set only_for_admin = 'TICKET_ADMIN' in perm(ticket.resource) # set has_property_editor = ( not version and version != 0 and not cnum_edit and (can_append or can_modify or can_edit or can_create)) # if (ticket.exists or preview_mode) and has_property_editor:
${ _("Modify")}
# endif # if not ticket.exists:

${_("Create New Ticket")} # if preview_mode and ticket.type: (${ticket.type}) # endif

# endif # if ticket.exists: # with preview_mode = change_preview.fields # include 'ticket_box.html' # endwith ## # Do not show attachments for old versions of this ticket ## # or for new tickets. # if not version and version != 0 and ticket.exists: # with alist = attachments, foldable = True # include 'list_of_attachments.html' # endwith # endif

${_("Change History")} (${len(changes)})

# for change in changes:
# include 'ticket_change.html'
# endfor
# endif ## end of the section we don't show for initial new tickets # if has_property_editor:
${jmacros.form_token_input()}
# if ticket.exists:

${_("Modify Ticket")}

# endif
## Properties # if can_modify or can_edit or can_create:
# with fields = fields|rejectattr('skip')|selectattr('editable') # if ticket.exists: ${_("Change Properties")} # else: ${_("Properties")} # endif # if can_modify or can_create: # endif ## Reporter field # if only_for_admin or (not ticket.exists and authname == 'anonymous'): # endif # if can_edit or can_create: # endif # if can_modify or can_create: # for row in fields|groupattr(2, 'type', 'not_equalto', 'textarea'): # set fullrow = len(row) == 1 # for field in row: # set value = (ticket[field.name] if ticket.exists else ticket.get_value_or_default(field.name)) # if loop.first or not fullrow: # endif # if loop.first or not fullrow: # endif # endfor {# jinjacheck: "CDATA" OK #} # endfor # endif
# if not only_for_admin and ticket.reporter == 'anonymous': # set preferences ${ _("Preferences")} # endset # trans preferences E-mail address and name can be saved in the ${preferences}. # endtrans # endif
# if field: # set label = (field.edit_label or field.label or field.name) # if field.type == 'radio': ${_("%(label)s:", label=label)} # else: # endif # endif # if field: # if field.type == 'select': # elif field.type == 'textarea': # elif field.type == 'checkbox': ## jinjacheck: "ID field- already defined" OK # elif field.type == 'radio': # for option in field.options: # endfor # elif field.type == 'time': ## jinjacheck: "ID field- already defined" OK # else: ## # Special case for Cc: field # if field.name == 'cc': ## # Unauthenticated user without TICKET_EDIT_CC ## # and with email set in prefs # if 'cc_entry' in field: # if field.cc_action is none: # set preferences_link ${ _("Preferences")} # endset ${tag_("Set your email in %(preferences_link)s", preferences_link=preferences_link)} # else: # endif # elif field.cc_action is none: ## # Unauthenticated user without TICKET_EDIT_CC ## # and no email set in prefs # else: ## # TICKET_EDIT_CC is allowed ## jinjacheck: "ID field- already defined" OK # endif # else: ## # All the other text input fields ## jinjacheck: "ID field- already defined" OK # endif # endif # endif
# endwith
# endif ## Workflow support # with hidden = not can_append # include 'ticket_workflow.html' # endwith
## Add comment # if ticket.exists and can_append:

${_("Add Comment")}

## Comment field
# if authname == 'anonymous':

# if author_id == 'anonymous': # set preferences ${_("Preferences")} # endset # trans preferences E-mail address and name can be saved in the ${preferences}. # endtrans # endif
# endif
# endif ## Attachment on creation checkbox # if not ticket.exists and ('ATTACHMENT_CREATE' in perm(ticket.resource.child('attachment'))):

# endif # if ticket.exists:
# if attachments.attachments or attachments.can_create: ${ _("Attachments")} ↑ # endif ${ _("Description")}
# endif
# if ticket.exists: # endif  
## Preview of ticket changes # if ticket.exists and can_append: ${jmacros.warnings(chrome.warnings)}
# trans This ticket has been modified since you started editing. You should review the other modifications which have been appended above, and any conflicts shown in the preview below. You can nevertheless proceed and submit your changes if you wish so. # endtrans
# with change = change_preview, preview = True # include 'ticket_change.html' # endwith
# endif
# endif # if not ticket.exists: # with hide = not preview_mode, preview_mode = preview_mode # include 'ticket_box.html' # endwith # endif # call(note, page) jmacros.wikihelp('TracTickets'): # trans note, page ${note} See ${page} for help on using tickets. # endtrans # endcall ${ super() } # endblock content