123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <h2>
- {{title}} <a style="font-size:small;color:gray;text-decoration:none;" href="#~{{user.name}}">{{user.name}}</a>
- </h2>
- <div style="font-size:large;">
- Description: {{description}}
- </div>
- <div>
- Priority:
- <select name="priority">
- <option style="background-color:white;">
- (none)
- </option>
- {{#each priorities}}
- <option style="background-color:{{color}};" value="{{id}}">
- {{name}}
- </option>
- {{/each}}
- </select>
- </div>
- <div>
- Status:
- <select name="status">
- <option style="background-color:white;">
- (none)
- </option>
- {{#each statuses}}
- <option value="{{id}}">
- {{name}}
- </option>
- {{/each}}
- </select>
- </div>
- <span style="font-size:small;">
- Comments
- </span>
- <ul>
- {{#each comments}}
- <li>
- <a style="font-size:small;color:gray;text-decoration:none;" href="#~{{name}}">
- {{name}}
- </a>
- <time style="font-size:smaller;" class="timeago">
- {{timestamp}}
- </time>
- <div>
- {{message}}
- </div>
- </li>
- {{/each}}
- </ul>
- <a class="comment">
- {
- "text": "comment",
- "id": {{id}},
- "type": "issue",
- "title": "Comment"
- }
- </a>
- <script>
- (function(){
- var status = false,
- priority = false;
- $('select[name=status]').change(function(){
- var t = $(this);
- if(status != t.val()){
- apiCall({
- type: 'action',
- id: 'issue',
- action: 'status',
- status: t.val(),
- issue: {{id}}
- },function(d){
- if(!d.error){
- status = t.val();
- }else{
- alert(d.error);
- }
- });
- }
- }).children('option').each(function(){
- if($(this).text().trim() == '{{status}}'){
- $(this).prop('selected',true);
- status = $(this).val();
- $(this).parent().css(
- 'background-color',
- this.style.backgroundColor
- );
- }
- });
- $('select[name=priority]').change(function(){
- var t = $(this);
- t.css(
- 'background-color',
- t.children('option:selected').get(0).style.backgroundColor
- );
- if(priority != t.val()){
- apiCall({
- type: 'action',
- id: 'issue',
- action: 'priority',
- priority: t.val(),
- issue: {{id}}
- },function(d){
- if(!d.error){
- priority = t.val();
- }else{
- alert(d.error);
- }
- });
- }
- }).children('option').each(function(){
- if($(this).text().trim() == '{{priority}}'){
- $(this).prop('selected',true);
- priority = $(this).val();
- $(this).parent().css(
- 'background-color',
- this.style.backgroundColor
- );
- }
- });
- })();
- </script>
|