Indefero

Indefero Commit Details


Date:2008-08-12 05:46:09 (16 years 4 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3, svn
Commit:1a030ea4ed1b263817cbcea0b0db4959429dc431
Parents: b2356bd157b9ec12b8a0a5830edc2736f5ac736a
Message:Added issue 14, ability to change the interest status.

The interest status or watch list is now shown in the list of the issues
and can be changed by clicking on the star in front of the title of an
issue when looking at an issue.
Changes:

File differences

logo/star.svg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
width="96"
height="48"
id="svg0"
sodipodi:version="0.32"
inkscape:version="0.46"
sodipodi:docname="star.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<metadata
id="metadata2536">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
inkscape:cy="15"
inkscape:cx="49.903061"
inkscape:zoom="4"
inkscape:window-height="755"
inkscape:window-width="969"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
guidetolerance="10.0"
gridtolerance="10.0"
objecttolerance="10.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
showgrid="false"
inkscape:window-x="220"
inkscape:window-y="108"
inkscape:current-layer="svg0" />
<defs
id="defs">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 24 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="48 : 24 : 1"
inkscape:persp3d-origin="24 : 16 : 1"
id="perspective2538" />
<linearGradient
id="G0">
<stop
id="s1"
style="stop-color:#e6cf00;stop-opacity:1"
offset="0" />
<stop
id="s2"
style="stop-color:#fde94a;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
id="G1">
<stop
id="s3"
style="stop-color:#fcf9fb;stop-opacity:1"
offset="0" />
<stop
id="s4"
style="stop-color:#fcf9fb;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
id="G2">
<stop
id="s5"
style="stop-color:#000000;stop-opacity:0.63"
offset="0" />
<stop
id="s6"
style="stop-color:#000000;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="14.660452"
y1="7.0243196"
x2="24.030643"
y2="34.826122"
id="G3"
xlink:href="#G1"
gradientUnits="userSpaceOnUse" />
<radialGradient
cx="24"
cy="22"
r="22"
fx="24"
fy="22"
id="R0"
xlink:href="#G0"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,-0.2,0.2,1,-3.8,6.8)" />
<radialGradient
cx="17.3125"
cy="25.53125"
r="9.6875"
fx="17.3125"
fy="25.53125"
id="R1"
xlink:href="#G2"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.4,0,0,0.67,-17.1,22.4)" />
<linearGradient
inkscape:collect="always"
xlink:href="#G1"
id="linearGradient2548"
gradientUnits="userSpaceOnUse"
x1="14.660452"
y1="7.0243196"
x2="24.030643"
y2="34.826122"
gradientTransform="translate(47.948863,0.5)" />
</defs>
<path
d="M 37.310531,41.5 L 24.030644,34.826121 L 10.735101,41.471448 L 13.289408,27.369086 L 2.5511635,17.368344 L 17.409702,15.326301 L 24.068641,2.5 L 30.697416,15.340488 L 45.551111,17.414249 L 34.789382,27.392039 L 37.310531,41.5 z"
id="star"
style="fill:url(#R0);stroke:#c4a000"
inkscape:export-xdpi="36"
inkscape:export-ydpi="36" />
<path
d="M 17.731857,15.79089 L 24.06374,3.5868195 L 30.369452,15.794804 L 44.440148,17.761498 L 40.820395,21.121507 C 24.382895,17.434007 31.36502,28.341981 13.251748,30.364721 L 13.819799,27.184324 L 3.6604518,17.718688 C 3.6604518,17.718688 17.731857,15.79089 17.731857,15.79089 z"
id="hl"
style="opacity:0.8;fill:url(#G3);stroke:none"
inkscape:export-filename="/home/loa/Projects/indefero/www/media/idf/img/star.png"
inkscape:export-xdpi="36"
inkscape:export-ydpi="36" />
<path
d="M 35.973752,39.712833 L 24.028333,33.709386 L 12.082531,39.678326 L 14.362768,27.008543 L 4.7776396,18.070249 L 18.056076,16.247921 L 24.062792,4.6783526 L 30.045232,16.255741 L 43.322959,18.11306 L 33.713703,27.034785 L 35.973752,39.712833 z"
id="ol"
style="opacity:0.68999999;fill:none;stroke:#ffffff"
inkscape:export-filename="/home/loa/Projects/indefero/www/media/idf/img/star.png"
inkscape:export-xdpi="36"
inkscape:export-ydpi="36" />
<path
d="M 85.259394,42 L 71.979507,35.326121 L 58.683964,41.971448 L 61.238271,27.869086 L 50.500026,17.868344 L 65.358565,15.826301 L 72.017504,3 L 78.646279,15.840488 L 93.499974,17.914249 L 82.738245,27.892039 L 85.259394,42 z"
id="path2540"
style="fill:#d3d7cf;stroke:#babdb6"
inkscape:export-filename="/home/loa/Projects/indefero/www/media/idf/img/star-grey.png"
inkscape:export-xdpi="36"
inkscape:export-ydpi="36" />
<path
d="M 65.68072,16.29089 L 72.012603,4.08682 L 78.318315,16.294804 L 92.389011,18.261498 L 88.769258,21.621507 C 72.331758,17.934007 79.313883,28.841981 61.200611,30.864721 L 61.768662,27.684324 L 51.609315,18.218688 C 51.609315,18.218688 65.68072,16.29089 65.68072,16.29089 z"
id="path2542"
style="opacity:0.8;fill:url(#linearGradient2548);stroke:none"
inkscape:export-filename="/home/loa/Projects/indefero/www/media/idf/img/star-grey.png"
inkscape:export-xdpi="36"
inkscape:export-ydpi="36" />
<path
d="M 83.922615,40.212833 L 71.977196,34.209386 L 60.031394,40.178326 L 62.311631,27.508543 L 52.726502,18.570249 L 66.004939,16.747921 L 72.011655,5.178353 L 77.994095,16.755741 L 91.271822,18.61306 L 81.662566,27.534785 L 83.922615,40.212833 z"
id="path2544"
style="opacity:0.68999999;fill:none;stroke:#ffffff"
inkscape:export-filename="/home/loa/Projects/indefero/www/media/idf/img/star-grey.png"
inkscape:export-xdpi="36"
inkscape:export-ydpi="36" />
</svg>
src/IDF/Form/IssueCreate.php
220220
221221
222222
223
224
225
226223
227224
228225
foreach ($tags as $tag) {
$issue->setAssoc($tag);
}
$issue->setAssoc($this->user); // the user is
// automatically
// interested.
// add the first comment
$comment = new IDF_IssueComment();
$comment->issue = $issue;
src/IDF/Form/IssueUpdate.php
253253
254254
255255
256
256257
257258
258259
$comment->changes = $changes;
$comment->create();
$this->issue->update();
$this->issue->setAssoc($this->user); // interested user.
return $this->issue;
}
throw new Exception(__('Cannot save the model from an invalid form.'));
src/IDF/Views/Issue.php
4646
4747
4848
49
49
50
5051
5152
5253
......
103104
104105
105106
106
107
108
107109
108110
109111
......
192194
193195
194196
197
195198
199
196200
197201
198202
......
248252
249253
250254
251
255
252256
253257
254258
259
255260
256261
257262
......
274279
275280
276281
277
282
283
278284
279285
280286
......
330336
331337
332338
333
339
340
334341
335342
336343
......
366373
367374
368375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
369401
370402
371403
......
432464
433465
434466
467
468
469
470
435471
436472
437473
438474
439
475
440476
441477
442478
$pag = new Pluf_Paginator(new IDF_Issue());
$pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname);
'shortname' => $prj->shortname,
'current_user' => $request->user);
$pag->summary = __('This table shows the open issues.');
$otags = $prj->getTagIdsByStatus('open');
if (count($otags) == 0) $otags[] = 0;
$pag = new Pluf_Paginator(new IDF_Issue());
$pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname);
'shortname' => $prj->shortname,
'current_user' => $request->user);
$pag->summary = __('This table shows the open issues.');
$pag->forced_where = $f_sql;
$pag->action = array('IDF_Views_Issue::myIssues', array($prj->shortname, $match[2]));
array($prj->shortname, $issue->id));
$title = Pluf_Template::markSafe(sprintf(__('Issue <a href="%s">%d</a>: %s'), $url, $issue->id, $issue->summary));
$form = false; // The form is available only if logged in.
$starred = false;
if (!$request->user->isAnonymous()) {
$starred = Pluf_Model_InArray($request->user, $issue->get_interested_list());
$params = array(
'project' => $prj,
'user' => $request->user,
$arrays = self::autoCompleteArrays($prj);
return Pluf_Shortcuts_RenderToResponse('issues/view.html',
array_merge(
array('project' => $prj,
array(
'issue' => $issue,
'comments' => $comments,
'form' => $form,
'starred' => $starred,
'page_title' => $title,
),
$arrays),
$pag = new Pluf_Paginator(new IDF_Issue());
$pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname);
'shortname' => $prj->shortname,
'current_user' => $request->user);
$pag->summary = __('This table shows the closed issues.');
$otags = $prj->getTagIdsByStatus('closed');
if (count($otags) == 0) $otags[] = 0;
$pag->model_view = 'join_tags';
$pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname);
'shortname' => $prj->shortname,
'current_user' => $request->user);
$pag->summary = sprintf(__('This table shows the issues with label %s.'), (string) $tag);
$otags = $prj->getTagIdsByStatus($status);
if (count($otags) == 0) $otags[] = 0;
}
/**
* Star/Unstar an issue.
*/
public $star_precond = array('IDF_Precondition::accessIssues',
'Pluf_Precondition::loginRequired');
public function star($request, $match)
{
$prj = $request->project;
$issue = Pluf_Shortcuts_GetObjectOr404('IDF_Issue', $match[2]);
$prj->inOr404($issue);
if ($request->method == 'POST') {
$starred = Pluf_Model_InArray($request->user, $issue->get_interested_list());
if ($starred) {
$issue->delAssoc($request->user);
$request->user->setMessage(__('The issue has been removed from your watch list.'));
} else {
$issue->setAssoc($request->user);
$request->user->setMessage(__('The issue has been added to your watch list.'));
}
}
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($prj->shortname, $issue->id));
return new Pluf_HTTP_Response_Redirect($url);
}
/**
* Create the autocomplete arrays for the little AJAX stuff.
*/
public static function autoCompleteArrays($project)
array($issue->shortname, $tag->id, 'open'));
$tags[] = sprintf('<a class="label" href="%s">%s</a>', $url, Pluf_esc((string) $tag));
}
$s = '';
if (Pluf_Model_InArray($issue->current_user, $issue->get_interested_list())) {
$s = '<img style="vertical-align: text-bottom;" src="'.Pluf_Template_Tag_MediaUrl::url('/idf/img/star.png').'" title="'.__('On your watch list.').'" /> ';
}
$out = '';
if (count($tags)) {
$out = '<br /><span class="note">'.implode(', ', $tags).'</span>';
}
return sprintf('<a href="%s">%s</a>', $edit, Pluf_esc($issue->summary)).$out;
return $s.sprintf('<a href="%s">%s</a>', $edit, Pluf_esc($issue->summary)).$out;
}
/**
src/IDF/conf/views.php
8585
8686
8787
88
89
90
91
92
93
8894
8995
9096
'model' => 'IDF_Views_Issue',
'method' => 'view');
$ctl[] = array('regex' => '#^/p/(\w+)/issues/(\d+)/star/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Issue',
'method' => 'star');
$ctl[] = array('regex' => '#^/p/(\w+)/issues/status/(\w+)/$#',
'base' => $base,
'priority' => 4,
src/IDF/templates/base.html
5151
5252
5353
54
54
5555
5656
5757
{block subtabs}{if $user.isAnonymous()} | {aurl 'url', 'IDF_Views::login'}{blocktrans}<a href="{$url}">Sign in or create your account</a> to create issues or add comments{/blocktrans}{/if}{/block}
</div>
<h1 class="title">{block title}{$page_title}{/block}</h1>
<h1 class="title">{block titleicon}{/block}{block title}{$page_title}{/block}</h1>
</div>
<div id="bd">
src/IDF/templates/issues/view.html
11
2
23
34
45
{extends "issues/base.html"}
{block titleicon}{if $form}<form class="star" method="post" action="{url 'IDF_Views_Issue::star', array($project.shortname, $issue.id)}"><input type="image" src="{if $starred}{media '/idf/img/star.png'}{else}{media '/idf/img/star-grey.png'}{/if}" name="submit" /></form> {/if}{/block}
{block body}
{assign $i = 0}
{assign $nc = $comments.count()}
www/media/idf/css/style.css
5656
5757
5858
59
60
61
62
5963
6064
6165
/**
* Form
*/
form.star {
display: inline;
}
table.form th, table.form td {
border: none;
vertical-align: top;

Archive Download the corresponding diff file

Page rendered in 0.10186s using 14 queries.