Indefero

Indefero Commit Details

Date:2008-08-06 21:54:45 (6 years 4 months ago)
Author:Loïc 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:3b5251c1b4808cc20a31a622fefafd849b8fb109
Parents: 7070e8a13a7bbfd73b4ca541e02a9264f827e917
Message:Fixed issue 7, filter the downloads by label.

Changes:
Msrc/IDF/Views/Download.php (3 diffs)
Msrc/IDF/conf/views.php (1 diff)
Msrc/IDF/locale/fr/idf.po (5 diffs)
Msrc/IDF/locale/idf.pot (3 diffs)
Msrc/IDF/templates/downloads/view.html (1 diff)

File differences

src/IDF/Views/Download.php
4242
4343
4444
45
46
4547
4648
4749
......
187189
188190
189191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
190232
191233
192234
......
210252
211253
212254
213
255
256
257
214258
215259
216260
{
$prj = $request->project;
$title = sprintf(__('%s Downloads'), (string) $prj);
$tags = self::getDownloadTags($prj);
$dtag = array_pop($tags); // The last tag is the deprecated tag.
// Paginator to paginate the files to download.
$pag = new Pluf_Paginator(new IDF_Upload());
$pag->class = 'recent-issues';
}
/**
* View list of downloads with a given label.
*/
public function listLabel($request, $match)
{
$prj = $request->project;
$tag = Pluf_Shortcuts_GetObjectOr404('IDF_Tag', $match[2]);
$prj->inOr404($tag);
$title = sprintf(__('%1$s Downloads with Label %2$s'), (string) $prj,
(string) $tag);
// Paginator to paginate the downloads
$pag = new Pluf_Paginator(new IDF_Upload());
$pag->model_view = 'join_tags';
$pag->class = 'recent-issues';
$pag->item_extra_props = array('project_m' => $prj,
'shortname' => $prj->shortname);
$pag->summary = sprintf(__('This table shows the downloads with label %s.'), (string) $tag);
$pag->forced_where = new Pluf_SQL('project=%s AND idf_tag_id=%s', array($prj->id, $tag->id));
$pag->action = array('IDF_Views_Download::index', array($prj->shortname));
$pag->edit_action = array('IDF_Views_Download::view', 'shortname', 'id');
$list_display = array(
'file' => __('File'),
array('summary', 'IDF_Views_Download_SummaryAndLabels', __('Summary')),
array('filesize', 'IDF_Views_Download_Size', __('Size')),
array('modif_dtime', 'Pluf_Paginator_DateYMD', __('Uploaded')),
);
$pag->configure($list_display, array(), array('file', 'filesize', 'modif_dtime'));
$pag->items_per_page = 10;
$pag->no_results_text = __('No downloads were found.');
$pag->sort_order = array('file', 'ASC');
$pag->setFromRequest($request);
return Pluf_Shortcuts_RenderToResponse('downloads/index.html',
array(
'page_title' => $title,
'label' => $tag,
'downloads' => $pag,
),
$request);
}
/**
* Get the download tags.
*
* @param IDF_Project
{
$tags = array();
foreach ($down->get_tags_list() as $tag) {
$tags[] = sprintf('<span class="label">%s</span>', Pluf_esc((string) $tag));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Download::listLabel',
array($down->shortname, $tag->id));
$tags[] = sprintf('<a href="%s" class="label">%s</a>', $url, Pluf_esc((string) $tag));
}
$out = '';
if (count($tags)) {
src/IDF/conf/views.php
147147
148148
149149
150
151
150152
151153
152154
153155
154156
155157
158
159
160
161
162
163
156164
157165
158166
'model' => 'IDF_Views_Source',
'method' => 'download');
// ---------- Downloads ------------------------------------
$ctl[] = array('regex' => '#^/p/(\w+)/downloads/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Download',
'method' => 'index');
$ctl[] = array('regex' => '#^/p/(\w+)/downloads/label/(\d+)/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Download',
'method' => 'listLabel');
$ctl[] = array('regex' => '#^/p/(\w+)/downloads/(\d+)/$#',
'base' => $base,
'priority' => 4,
src/IDF/locale/fr/idf.po
22
33
44
5
6
5
6
77
88
99
......
227227
228228
229229
230
230231
231232
232233
233234
234235
235236
237
238
236239
237240
238241
......
245248
246249
247250
251
252
248253
249254
250255
251256
252257
258
259
253260
254261
255262
256263
264
265
257266
258267
259268
260269
270
271
261272
262273
263274
264275
276
265277
266278
267279
268280
269281
282
270283
271284
272285
......
274287
275288
276289
290
277291
278292
279293
280294
295
281296
282297
283298
......
12111226
12121227
12131228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
msgstr ""
"Project-Id-Version: InDefero\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-08-06 14:49+0200\n"
"PO-Revision-Date: 2008-08-06 14:51+0100\n"
"POT-Creation-Date: 2008-08-06 21:49+0200\n"
"PO-Revision-Date: 2008-08-06 21:51+0100\n"
"Last-Translator: Loïc d'Anterroches <titoo@users.sourceforge.net>\n"
"Language-Team: Translation team <titoo@users.sourceforge.net>\n"
"MIME-Version: 1.0\n"
msgstr "Téléchargements de %s"
#: IDF/Views/Download.php:50
#: IDF/Views/Download.php:52
msgid "This table shows the files to download."
msgstr "Ce tableau présente la liste des fichiers en téléchargement."
#: IDF/Views/Download.php:54
#: IDF/gettexttemplates/source/tree.html.php:6
#: IDF/Form/Upload.php:49
#: IDF/Views/Download.php:56
#: IDF/Views/Download.php:212
msgid "File"
msgstr "Fichier"
#: IDF/Form/IssueCreate.php:50
#: IDF/Form/UpdateUpload.php:42
#: IDF/Form/IssueUpdate.php:45
#: IDF/Views/Download.php:57
#: IDF/Views/Download.php:213
msgid "Summary"
msgstr "Résumé"
#: IDF/Views/Download.php:56
#: IDF/gettexttemplates/source/tree.html.php:9
#: IDF/Views/Download.php:58
#: IDF/Views/Download.php:214
msgid "Size"
msgstr "Taille"
#: IDF/Views/Download.php:57
#: IDF/Views/Download.php:59
#: IDF/Views/Download.php:215
msgid "Uploaded"
msgstr "Mis en ligne"
#: IDF/Views/Download.php:61
#: IDF/Views/Download.php:63
#: IDF/Views/Download.php:219
msgid "No downloads were found."
msgstr "Aucun fichier n'a été trouvé."
#: IDF/Views/Download.php:81
#: IDF/Views/Download.php:83
#, php-format
msgid "Download %s"
msgstr "Télécharger %s"
#: IDF/Views/Download.php:94
#: IDF/Views/Download.php:96
#, php-format
msgid "The file <a href=\"%1$s\">%2$s</a> has been updated."
msgstr "Le fichier <a href=\"%1$s\">%2$s</a> a été mis à jour."
#: IDF/Views/Download.php:135
#: IDF/gettexttemplates/downloads/base.html.php:4
#: IDF/gettexttemplates/downloads/index.html.php:3
#: IDF/Views/Download.php:137
msgid "New Download"
msgstr "Nouveau téléchargement"
#: IDF/Views/Download.php:144
#: IDF/Views/Download.php:146
#, php-format
msgid "The <a href=\"%s\">file</a> has been uploaded."
msgstr "Le <a href=\"%s\">fichier</a> a été mis en ligne."
msgid "%s Commit Details - %s"
msgstr "Détails d'un commit de %s - %s"
#: IDF/Views/Download.php:199
#, php-format
msgid "%1$s Downloads with Label %2$s"
msgstr "Téléchargements avec l'étiquette %2$s de %1$s"
#: IDF/Views/Download.php:207
#, php-format
msgid "This table shows the downloads with label %s."
msgstr "Ce tableau montre les téléchargements avec l'étiquette %s."
src/IDF/locale/idf.pot
88
99
1010
11
11
1212
1313
1414
......
217217
218218
219219
220
220
221221
222222
223223
224224
225
225
226226
227227
228228
229229
230230
231231
232
232
233
233234
234235
235236
236237
238
237239
238240
239241
240
242
243
241244
242245
243246
244
247
248
245249
246250
247251
248
252
249253
250254
251255
252256
253
257
254258
255259
256260
257261
258262
259
263
260264
261265
262266
263
267
264268
265269
266270
......
11531157
11541158
11551159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-08-06 14:49+0200\n"
"POT-Creation-Date: 2008-08-06 21:49+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "%s Downloads"
msgstr ""
#: IDF/Views/Download.php:50
#: IDF/Views/Download.php:50 IDF/Views/Download.php:52
msgid "This table shows the files to download."
msgstr ""
#: IDF/Views/Download.php:54 IDF/gettexttemplates/source/tree.html.php:6
#: IDF/Form/Upload.php:49
#: IDF/Form/Upload.php:49 IDF/Views/Download.php:56 IDF/Views/Download.php:212
msgid "File"
msgstr ""
#: IDF/Views/Download.php:55 IDF/Views/Issue.php:57 IDF/Views/Issue.php:109
#: IDF/Views/Issue.php:228 IDF/Views/Issue.php:281 IDF/Form/Upload.php:40
#: IDF/Form/IssueCreate.php:50 IDF/Form/UpdateUpload.php:42
#: IDF/Form/IssueUpdate.php:45
#: IDF/Form/IssueUpdate.php:45 IDF/Views/Download.php:57
#: IDF/Views/Download.php:213
msgid "Summary"
msgstr ""
#: IDF/Views/Download.php:56 IDF/gettexttemplates/source/tree.html.php:9
#: IDF/Views/Download.php:58 IDF/Views/Download.php:214
msgid "Size"
msgstr ""
#: IDF/Views/Download.php:57
#: IDF/Views/Download.php:57 IDF/Views/Download.php:59
#: IDF/Views/Download.php:215
msgid "Uploaded"
msgstr ""
#: IDF/Views/Download.php:61
#: IDF/Views/Download.php:61 IDF/Views/Download.php:63
#: IDF/Views/Download.php:219
msgid "No downloads were found."
msgstr ""
#: IDF/Views/Download.php:81
#: IDF/Views/Download.php:81 IDF/Views/Download.php:83
#, php-format
msgid "Download %s"
msgstr ""
#: IDF/Views/Download.php:94
#: IDF/Views/Download.php:94 IDF/Views/Download.php:96
#, php-format
msgid "The file <a href=\"%1$s\">%2$s</a> has been updated."
msgstr ""
#: IDF/Views/Download.php:135 IDF/gettexttemplates/downloads/base.html.php:4
#: IDF/gettexttemplates/downloads/index.html.php:3
#: IDF/gettexttemplates/downloads/index.html.php:3 IDF/Views/Download.php:137
msgid "New Download"
msgstr ""
#: IDF/Views/Download.php:144
#: IDF/Views/Download.php:144 IDF/Views/Download.php:146
#, php-format
msgid "The <a href=\"%s\">file</a> has been uploaded."
msgstr ""
#, php-format
msgid "%s Commit Details - %s"
msgstr ""
#: IDF/Views/Download.php:199
#, php-format
msgid "%1$s Downloads with Label %2$s"
msgstr ""
#: IDF/Views/Download.php:207
#, php-format
msgid "This table shows the downloads with label %s."
msgstr ""
src/IDF/templates/downloads/view.html
5555
5656
5757
58
59
58
59
6060
6161
6262
{assign $tags = $file.get_tags_list()}{if $tags.count()}
<p>
<strong>{trans 'Labels:'}</strong><br />
{foreach $tags as $tag}
<span class="label"><strong>{$tag.class}:</strong>{$tag.name}</span><br />
{foreach $tags as $tag}{aurl 'url', 'IDF_Views_Download::listLabel', array($project.shortname, $tag.id)}
<span class="label"><a href="{$url}" class="label"><strong>{$tag.class}:</strong>{$tag.name}</a></span><br />
{/foreach}
</p>{/if}
{/block}

Archive Download the corresponding diff file