<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="${g.pyforge_templates}/master.html"/>
<?python from pyforge import model as M
from pyforge.lib.security import has_artifact_access?>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
<title>#$ticket.ticket_num $ticket.summary</title>
<link rel="stylesheet" type="text/css" href="${g.app_static('css/hilite.css')}"/>
<link rel="stylesheet" type="text/css" href="${g.app_static('css/tracker.css')}"/>
<link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss"/>
<link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom"/>
</head>
<body>
<form method="POST" class="can-retry" action="${ticket.url()}update_ticket">
<div class="editable viewing" style="padding: 0">
<py:if test="not allow_edit"><h1 class="title">#$ticket.ticket_num $ticket.summary</h1></py:if>
<py:if test="allow_edit">
<h1 class="title">
<span class="viewer" style="padding: 0; width:600px">#$ticket.ticket_num $ticket.summary</span>
<span class="editor" style="padding: 0; font-size: 11px; text-shadow: 0 0; width:600px">
${c.auto_resize_textarea.display(value=ticket.summary,name='summary',attrs={'style':'height:1em; width: 425px'})}
</span>
</h1>
</py:if>
</div>
<div class="actions" style="width:120px;">
<py:if test="c.user and c.user != c.user.anonymous()">
<a href="edit" class="btn ico-l"><b class="ui-icon ui-icon-pencil"></b> <span>Edit</span></a>
${c.subscribe_form.display(value=subscribed, action='subscribe', style='icon')}
</py:if>
<a href="${ticket.url()}feed.rss" class="btn ico"><b class="ui-icon ui-icon-signal-diag"></b> <span>Follow this Ticket</span></a>
</div>
<div class="content">
<div class="row dual">
<div class="column grid_8">
<div class="${allow_edit and ' editable viewing' or ''}">
<span class="${allow_edit and 'viewer' or ''}">
${Markup(g.markdown.convert(ticket.description))}
</span>
<span class="multiline editor" py:if="allow_edit">
${c.markdown_editor.display(name='description',value=ticket.description)}
</span>
</div>
<!-- <div py:if="not allow_edit" py:content="Markup(g.markdown.convert(ticket.description))"/>
<py:if test="allow_edit">
${c.markdown_editor.display(name='description',value=ticket.description)}
<input type="submit" value="Save Changes" />
</py:if> -->
${c.attachment_list.display(attachments=list(ticket.attachments), edit_mode=False)}
</div>
<div id="sidebar-right" class="column grid_4 fright">
<div class="listed">
<b>Created by:</b>
${gravatar(ticket.reported_by, size=16)}
<a href="${ticket.reported_by.url()}">${ticket.reported_by.display_name}</a>
<hr/>
<b>Created Time:</b> ${h.ago(ticket.created_date)}
<hr/>
<div class="${allow_edit and 'editable viewing' or ''}">
<span class="viewer">
<b>Assigned to:</b>
<span class="ticket-assigned-to" py:if="ticket.assigned_to_id">
${gravatar(ticket.assigned_to, size=16)} <a href="${ticket.assigned_to.url()}">${ticket.assigned_to_name()}</a>
</span>
<span py:if="not ticket.assigned_to_id" class="ticket-assigned-to">
${ticket.assigned_to_name()}
</span>
<hr/>
<b>Status:</b> <span class="${ticket.status}">${ticket.status}</span>
<hr/>
<b>Milestone:</b> ${ticket.milestone or 'None'}
<hr/>
<py:for each="field in globals.custom_fields or []">
<b>${field.label}:</b> ${ticket.custom_fields.get(field.name, '') or ' '}
<hr/>
</py:for>
<b>Tags:</b>
<span py:for="label in ticket.labels" class="ui-corner-all tag">
<a href="../search?q=labels:${h.urllib.quote_plus(label)}">$label (${ticket.artifacts_labeled_with(label).count()})</a>
</span>
<py:if test="not len(ticket.labels)">None</py:if>
</span>
<span class="multiline editor" py:if="allow_edit">
<b>Assigned to:</b>
<py:if test="ticket.assigned_to_id">
${c.user_select.display(name='assigned_to',value=ticket.assigned_to.username,className='wide')}
</py:if>
<py:if test="not ticket.assigned_to_id">
${c.user_select.display(name='assigned_to',value=ticket.assigned_to_id,className='wide')}
</py:if>
<hr/>
<b>Status:</b>
<select name="status">
<option py:for="option in globals.status_names.split()" value="$option"
selected="${'selected' if ticket.status==option else None}">$option</option>
</select>
<hr/>
<b>Milestone:</b>
<select name="milestone">
<option value="">None</option>
<option py:for="option in globals.milestone_names.split()" value="$option"
selected="${'selected' if ticket.milestone==option else None}">$option</option>
</select>
<hr/>
<py:for each="field in globals.custom_fields or []">
<b>${field.label}:</b>
<input py:if="field.type != 'select' and field.type != 'boolean'" name="custom_fields.${field.name}" type="text"
value="${ticket.custom_fields.get(field.name, '')}"/>
<input py:if="field.type == 'boolean' and ticket.custom_fields.get(field.name, '') == 'True'"
name="custom_fields.${field.name}" type="checkbox" value="True" checked="checked"/>
<input py:if="field.type == 'boolean' and ticket.custom_fields.get(field.name, '') != 'True'"
name="custom_fields.${field.name}" type="checkbox" value="True"/>
<select py:if="field.type == 'select'" name="custom_fields.${field.name}">
<py:for each="option in field.options.split()">
<option py:if="not option.startswith('*')" value="${option}"
selected="${'selected' if ticket.custom_fields.get(field.name, '')==option else None}">${option}</option>
<option py:if="option.startswith('*')" value="${option[1:]}"
selected="${'selected' if ticket.custom_fields.get(field.name, '')==option[1:] or ticket.custom_fields.get(field.name, '')==None else None}">${option[1:]}</option>
</py:for>
</select>
<hr/>
</py:for>
<div class="row dual">
<div class="column" style="margin-right:0">
<b>Tags:</b>
</div>
<div class="column" style="margin-left:0;width:140px; overflow:auto;">
${c.label_edit.display(name='labels', value=ticket.labels)}
</div>
</div>
<div class="row dual">
<div class="column" style="margin-right:0">
<b> </b>
</div>
<div class="column save_holder"/>
</div>
</span>
</div>
</div>
</div>
</div>
<div style="clear:both"> </div>
<div py:with="thread=ticket.discussion_thread()">
${c.thread.display(value=thread,new_post_text="New Comment")}
</div>
</div>
</form>
</body>
</html>