From 4eea3797b26cb3ab34c5b4e1b7ff5098f2284deb Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Fri, 25 Jul 2008 14:15:58 +0200 Subject: [PATCH] Added the autocompletion of the owner and cosmetic changes. --- src/IDF/Views/Issue.php | 20 ++++++++++++++++++- src/IDF/templates/base.html | 11 ++++++++++ src/IDF/templates/issues/js-autocomplete.html | 16 +++++++++++++++ src/IDF/templates/issues/view.html | 2 +- src/IDF/templates/js-hotkeys.html | 1 - www/media/idf/css/style.css | 4 ++++ 6 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/IDF/Views/Issue.php b/src/IDF/Views/Issue.php index 53d4a0b..9892f42 100644 --- a/src/IDF/Views/Issue.php +++ b/src/IDF/Views/Issue.php @@ -181,7 +181,9 @@ class IDF_Views_Issue $issue = $form->save(); $url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index', array($prj->shortname)); - $request->user->setMessage(sprintf(__('Issue %d has been updated.'), $issue->id)); + $urlissue = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', + array($prj->shortname, $issue->id)); + $request->user->setMessage(sprintf(__('Issue %d has been updated.'), $urlissue, $issue->id)); return new Pluf_HTTP_Response_Redirect($url); } } else { @@ -334,6 +336,22 @@ class IDF_Views_Issue } $auto[$key] = substr($auto[$key], 0, -1); } + // Get the members/owners + $m = $project->getMembershipData(); + $auto['_auto_owner'] = $m['members']; + $auto['auto_owner'] = ''; + foreach ($m['owners'] as $owner) { + if (!Pluf_Model_InArray($owner, $auto['_auto_owner'])) { + $auto['_auto_owner'][] = $owner; + } + } + foreach ($auto['_auto_owner'] as $owner) { + $auto['auto_owner'] .= sprintf('{ name: "%s", to: "%s" }, ', + Pluf_esc($owner), + Pluf_esc($owner->login)); + } + $auto['auto_owner'] = substr($auto['auto_owner'], 0, -1); + unset($auto['_auto_owner']); return $auto; } } diff --git a/src/IDF/templates/base.html b/src/IDF/templates/base.html index 7456d28..a94edf3 100644 --- a/src/IDF/templates/base.html +++ b/src/IDF/templates/base.html @@ -67,5 +67,16 @@ {include 'js-hotkeys.html'} {block javascript}{/block} +{if $project} +{/if} diff --git a/src/IDF/templates/issues/js-autocomplete.html b/src/IDF/templates/issues/js-autocomplete.html index 6ae60e4..589d178 100644 --- a/src/IDF/templates/issues/js-autocomplete.html +++ b/src/IDF/templates/issues/js-autocomplete.html @@ -1,3 +1,4 @@ +{if $isOwner or $isMember} +{/if} diff --git a/src/IDF/templates/issues/view.html b/src/IDF/templates/issues/view.html index 2c58ab2..f08ae6c 100644 --- a/src/IDF/templates/issues/view.html +++ b/src/IDF/templates/issues/view.html @@ -10,7 +10,7 @@ {aurl 'url', 'IDF_Views_Issue::view', array($project.shortname, $issue.id)} {assign $id = $c.id} {assign $url = $url~'#ic'~$c.id} -

{blocktrans}Comment {$id} by {$who}, {$c.creation_dtime|date}{/blocktrans}

+

{blocktrans}Comment {$i} by {$who}, {$c.creation_dtime|date}{/blocktrans}

{/if}

{if strlen($c.content) > 0}{$c.content|nl2br}{else}{trans '(No comments were given for this change.)'}{/if}

diff --git a/src/IDF/templates/js-hotkeys.html b/src/IDF/templates/js-hotkeys.html index 4ba6d23..d7abbd0 100644 --- a/src/IDF/templates/js-hotkeys.html +++ b/src/IDF/templates/js-hotkeys.html @@ -9,5 +9,4 @@ {hotkey 'Shift+w', 'IDF_Views_Issue::myIssues', array($project.shortname, 'owner')} {/if} //--> - {/if} diff --git a/www/media/idf/css/style.css b/www/media/idf/css/style.css index e8583f9..c42f0ba 100644 --- a/www/media/idf/css/style.css +++ b/www/media/idf/css/style.css @@ -126,6 +126,10 @@ div.issue-comment { padding: 0.5em; } +.issue-comment-focus { + border-right: 3px solid #8ae234 !important; +} + div.issue-comment-first { border-top: 1px solid #d3d7cf; }