Indefero

Indefero Commit Details


Date:2008-11-30 17:36:27 (16 years 21 days 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
Commit:9c5156e6ef34fa536363d8fa6f72e6d224954117
Parents: 3cacf446054d6b49ab6c39d51ddf551585d46336
Message:Added the first work on the administration area.

Changes:

File differences

src/IDF/Form/Admin/ProjectCreate.php
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
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
/**
* Create a project.
*
* A kind of merge of the member configuration, overview and the
* former source tab.
*
*/
class IDF_Form_Admin_ProjectCreate extends Pluf_Form
{
public function initFields($extra=array())
{
$choices = array();
$options = array(
'git' => __('git'),
'svn' => __('Subversion'),
'mercurial' => __('mercurial'),
);
foreach (Pluf::f('allowed_scm', array()) as $key => $class) {
$choices[$options[$key]] = $key;
}
$this->fields['name'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('Name'),
'initial' => '',
));
$this->fields['shortname'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('Shortname'),
'initial' => 'myproject',
'help_text' => __('It must be unique for each project and composed only of letters and digits.'),
));
$this->fields['scm'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('Repository type'),
'initial' => 'git',
'widget_attrs' => array('choices' => $choices),
'widget' => 'Pluf_Form_Widget_SelectInput',
));
$this->fields['svn_remote_url'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Remote Subversion repository'),
'initial' => '',
'widget_attrs' => array('size' => '30'),
));
$this->fields['svn_username'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Repository username'),
'initial' => '',
'widget_attrs' => array('size' => '15'),
));
$this->fields['svn_password'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Repository password'),
'initial' => '',
'widget' => 'Pluf_Form_Widget_PasswordInput',
));
$this->fields['owners'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Project owners'),
'initial' => $extra['user']->login,
'widget' => 'Pluf_Form_Widget_TextareaInput',
'widget_attrs' => array('rows' => 5,
'cols' => 40),
));
$this->fields['members'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Project members'),
'initial' => '',
'widget_attrs' => array('rows' => 7,
'cols' => 40),
'widget' => 'Pluf_Form_Widget_TextareaInput',
));
}
public function clean_svn_remote_url()
{
$url = trim($this->cleaned_data['svn_remote_url']);
if (strlen($url) == 0) return $url;
// we accept only starting with http(s):// to avoid people
// trying to access the local filesystem.
if (!preg_match('#^(http|https)://#', $url)) {
throw new Pluf_Form_Invalid(__('Only a remote repository available throught http or https are allowed. For example "http://somewhere.com/svn/trunk".'));
}
return $url;
}
public function clean_shortname()
{
$shortname = $this->cleaned_data['shortname'];
if (preg_match('/[^A-Za-z0-9]/', $shortname)) {
throw new Pluf_Form_Invalid(__('This shortname contains illegal characters, please use only letters and digits.'));
}
$sql = new Pluf_SQL('shortname=%s', array($shortname));
$l = Pluf::factory('IDF_Project')->getList(array('filter'=>$sql->gen()));
if ($l->count() > 0) {
throw new Pluf_Form_Invalid(__('This shortname is already used. Please select another one.'));
}
return $shortname;
}
public function clean()
{
if ($this->cleaned_data['scm'] != 'svn') {
foreach (array('svn_remote_url', 'svn_username', 'svn_password')
as $key) {
$this->cleaned_data[$key] = '';
}
}
return $this->cleaned_data;
}
public function save($commit=true)
{
if (!$this->isValid()) {
throw new Exception(__('Cannot save the model from an invalid form.'));
}
$project = new IDF_Project();
$project->name = $this->cleaned_data['name'];
$project->shortname = $this->cleaned_data['shortname'];
$project->description = __('Write your project description here.');
$project->create();
$conf = new IDF_Conf();
$conf->setProject($project);
$keys = array('scm', 'svn_remote_url',
'svn_username', 'svn_password');
foreach ($keys as $key) {
$conf->setVal($key, $this->cleaned_data[$key]);
}
$project->created();
IDF_Form_MembersConf::updateMemberships($project,
$this->cleaned_data);
$project->membershipsUpdated();
return $project;
}
}
src/IDF/Form/Admin/ProjectUpdate.php
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
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
/**
* Update a project.
*
* A kind of merge of the member configuration and overview in the
* project administration area.
*
*/
class IDF_Form_Admin_ProjectUpdate extends Pluf_Form
{
public $project = null;
public function initFields($extra=array())
{
$this->project = $extra['project'];
$members = $this->project->getMembershipData('string');
$this->fields['name'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('Name'),
'initial' => $this->project->name,
));
$this->fields['owners'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Project owners'),
'initial' => $members['owners'],
'widget' => 'Pluf_Form_Widget_TextareaInput',
'widget_attrs' => array('rows' => 5,
'cols' => 40),
));
$this->fields['members'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Project members'),
'initial' => $members['members'],
'widget_attrs' => array('rows' => 7,
'cols' => 40),
'widget' => 'Pluf_Form_Widget_TextareaInput',
));
}
public function save($commit=true)
{
if (!$this->isValid()) {
throw new Exception(__('Cannot save the model from an invalid form.'));
}
IDF_Form_MembersConf::updateMemberships($this->project,
$this->cleaned_data);
$this->project->membershipsUpdated();
$this->project->name = $this->cleaned_data['name'];
$this->project->update();
}
}
src/IDF/Form/MembersConf.php
6363
6464
6565
66
67
68
69
70
71
72
73
74
75
76
77
78
6679
67
80
6881
6982
7083
7184
7285
73
86
7487
75
88
7689
7790
7891
79
92
8093
8194
8295
if (!$this->isValid()) {
throw new Exception(__('Cannot save the model from an invalid form.'));
}
self::updateMemberships($this->project, $this->cleaned_data);
$this->project->membershipsUpdated();
}
/**
* The update of the memberships is done in different places. This
* avoids duplicating code.
*
* @param IDF_Project The project
* @param array The new memberships data in 'owners' and 'members' keys
*/
public static function updateMemberships($project, $cleaned_data)
{
// remove all the permissions
$cm = $this->project->getMembershipData();
$cm = $project->getMembershipData();
$def = array('owners' => Pluf_Permission::getFromString('IDF.project-owner'),
'members' => Pluf_Permission::getFromString('IDF.project-member'));
$guser = new Pluf_User();
foreach ($def as $key=>$perm) {
foreach ($cm[$key] as $user) {
Pluf_RowPermission::remove($user, $this->project, $perm);
Pluf_RowPermission::remove($user, $project, $perm);
}
foreach (preg_split("/\015\012|\015|\012|\,/", $this->cleaned_data[$key], -1, PREG_SPLIT_NO_EMPTY) as $login) {
foreach (preg_split("/\015\012|\015|\012|\,/", $cleaned_data[$key], -1, PREG_SPLIT_NO_EMPTY) as $login) {
$sql = new Pluf_SQL('login=%s', array(trim($login)));
$users = $guser->getList(array('filter'=>$sql->gen()));
if ($users->count() == 1) {
Pluf_RowPermission::add($users[0], $this->project, $perm);
Pluf_RowPermission::add($users[0], $project, $perm);
}
}
}
src/IDF/Form/SourceConf.php
2424
2525
2626
27
28
29
2730
2831
2932
......
3134
3235
3336
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
37
38
5539
5640
5741
5842
5943
6044
61
45
6246
6347
6448
6549
6650
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
8851
89
9052
9153
9254
/**
* Configuration of the source.
*
* Only the modification of the login/password for subversion is
* authorized.
*/
class IDF_Form_SourceConf extends Pluf_Form
{
public function initFields($extra=array())
{
$this->conf = $extra['conf'];
$this->fields['scm'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('Repository type'),
'initial' => $this->conf->getVal('scm', 'git'),
'widget_attrs' => array('choices' =>
array(
__('git') => 'git',
__('Subversion') => 'svn',
__('mercurial') => 'mercurial',
)
),
'widget' => 'Pluf_Form_Widget_SelectInput',
));
$this->fields['svn_remote_url'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Remote Subversion repository'),
'initial' => $this->conf->getVal('svn_remote_url', ''),
'widget_attrs' => array('size' => '30'),
));
$this->fields['svn_username'] = new Pluf_Form_Field_Varchar(
if ($this->conf->getVal('scm', 'git') == 'svn') {
$this->fields['svn_username'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Repository username'),
'initial' => $this->conf->getVal('svn_username', ''),
'widget_attrs' => array('size' => '15'),
));
$this->fields['svn_password'] = new Pluf_Form_Field_Varchar(
$this->fields['svn_password'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Repository password'),
'initial' => $this->conf->getVal('svn_password', ''),
'widget' => 'Pluf_Form_Widget_PasswordInput',
));
}
public function clean_svn_remote_url()
{
$url = trim($this->cleaned_data['svn_remote_url']);
if (strlen($url) == 0) return $url;
// we accept only starting with http(s):// to avoid people
// trying to access the local filesystem.
if (!preg_match('#^(http|https)://#', $url)) {
throw new Pluf_Form_Invalid(__('Only a remote repository available throught http or https are allowed. For example "http://somewhere.com/svn/trunk".'));
}
return $url;
}
public function clean()
{
if ($this->cleaned_data['scm'] == 'git') {
foreach (array('svn_remote_url', 'svn_username', 'svn_password')
as $key) {
$this->cleaned_data[$key] = '';
}
}
return $this->cleaned_data;
}
}
src/IDF/Middleware.php
7171
7272
7373
74
7475
7576
7677
{
$c = array();
$c['request'] = $request;
$c['isAdmin'] = ($request->user->administrator or $request->user->staff);
if (isset($request->project)) {
$c['project'] = $request->project;
$c['isOwner'] = $request->user->hasPerm('IDF.project-owner',
src/IDF/Project.php
400400
401401
402402
403
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
404469
}
return $this->_pconf;
}
/**
* Needs to be called when you update the memberships of a
* project.
*
* This will allow a plugin to, for example, update some access
* rights to a repository.
*/
public function membershipsUpdated()
{
/**
* [signal]
*
* IDF_Project::membershipsUpdated
*
* [sender]
*
* IDF_Project
*
* [description]
*
* This signal allows an application to update the some access
* rights to a repository when the project memberships is
* updated.
*
* [parameters]
*
* array('project' => $project)
*
*/
$params = array('project' => $this);
Pluf_Signal::send('IDF_Project::membershipsUpdated',
'IDF_Project', $params);
}
/**
* Needs to be called when you create a project.
*
* We cannot put it into the postSave call as the configuration of
* the project is not defined at that time.
*/
function created()
{
/**
* [signal]
*
* IDF_Project::created
*
* [sender]
*
* IDF_Project
*
* [description]
*
* This signal allows an application to perform special
* operations at the creation of a project.
*
* [parameters]
*
* array('project' => $project)
*
*/
$params = array('project' => $this);
Pluf_Signal::send('IDF_Project::created',
'IDF_Project', $params);
}
}
src/IDF/Views/Admin.php
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
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
Pluf::loadFunction('Pluf_HTTP_URL_urlForView');
Pluf::loadFunction('Pluf_Shortcuts_RenderToResponse');
Pluf::loadFunction('Pluf_Shortcuts_GetObjectOr404');
Pluf::loadFunction('Pluf_Shortcuts_GetFormForModel');
/**
* Administration's views.
*/
class IDF_Views_Admin
{
/**
* Home page of the administration.
*
* It should provide an overview of the forge status.
*/
public $home_precond = array('Pluf_Precondition::staffRequired');
public function home($request, $match)
{
$title = __('Administer');
return Pluf_Shortcuts_RenderToResponse('idf/gadmin/home.html',
array(
'page_title' => $title,
),
$request);
}
/**
* Projects overview.
*
*/
public $projects_precond = array('Pluf_Precondition::staffRequired');
public function projects($request, $match)
{
$title = __('Projects');
$pag = new Pluf_Paginator(new IDF_Project());
$pag->class = 'recent-issues';
$pag->summary = __('This table shows the projects in the forge.');
$pag->action = 'IDF_Views_Admin::projects';
$pag->edit_action = array('IDF_Views_Admin::projectUpdate', 'id');
$pag->sort_order = array('shortname', 'ASC');
$list_display = array(
'shortname' => __('Short Name'),
'name' => __('Name'),
);
$pag->configure($list_display, array(),
array('shortname'));
$pag->items_per_page = 25;
$pag->no_results_text = __('No projects were found.');
$pag->setFromRequest($request);
return Pluf_Shortcuts_RenderToResponse('idf/gadmin/projects/index.html',
array(
'page_title' => $title,
'projects' => $pag,
),
$request);
}
/**
* Edition of a project.
*
* One cannot switch from one source backend to another.
*/
public $projectUpdate_precond = array('Pluf_Precondition::staffRequired');
public function projectUpdate($request, $match)
{
$project = Pluf_Shortcuts_GetObjectOr404('IDF_Project', $match[1]);
$title = sprintf(__('Update %s'), $project->name);
$params = array(
'project' => $project,
);
if ($request->method == 'POST') {
$form = new IDF_Form_Admin_ProjectUpdate($request->POST, $params);
if ($form->isValid()) {
$form->save();
$request->user->setMessage(__('The project has been updated.'));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Admin::projectUpdate',
array($project->id));
return new Pluf_HTTP_Response_Redirect($url);
}
} else {
$form = new IDF_Form_Admin_ProjectUpdate(null, $params);
}
return Pluf_Shortcuts_RenderToResponse('idf/gadmin/projects/update.html',
array(
'page_title' => $title,
'project' => $project,
'form' => $form,
),
$request);
}
/**
* Creation of a project.
*
*/
public $projectCreate_precond = array('Pluf_Precondition::staffRequired');
public function projectCreate($request, $match)
{
$title = __('Create Project');
$extra = array('user' => $request->user);
if ($request->method == 'POST') {
$form = new IDF_Form_Admin_ProjectCreate($request->POST, $extra);
if ($form->isValid()) {
$project = $form->save();
$request->user->setMessage(__('The project has been created.'));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Admin::projects');
return new Pluf_HTTP_Response_Redirect($url);
}
} else {
$form = new IDF_Form_Admin_ProjectCreate(null, $extra);
}
$base = Pluf::f('url_base').Pluf::f('idf_base').'/p/';
return Pluf_Shortcuts_RenderToResponse('idf/gadmin/projects/create.html',
array(
'page_title' => $title,
'form' => $form,
'base_url' => $base,
),
$request);
}
}
src/IDF/Views/Project.php
378378
379379
380380
381
382
383
384
385
386
387
388
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
389399
390
391
392
393
394
395
396
397
398
399
400
401
402
400
401
402
403
404
405
406
403407
408
409
410
411
404412
405
406
407
408
409413
414
415
416
417
418
419
420
410421
411422
423
424
425
412426
413427
414428
{
$prj = $request->project;
$title = sprintf(__('%s Source'), (string) $prj);
$extra = array(
'conf' => $request->conf,
);
if ($request->method == 'POST') {
$form = new IDF_Form_SourceConf($request->POST, $extra);
if ($form->isValid()) {
foreach ($form->cleaned_data as $key=>$val) {
$request->conf->setVal($key, $val);
$form = null;
$remote_svn = false;
if ($request->conf->getVal('scm') == 'svn' and
strlen($request->conf->getVal('svn_remote_url')) > 0) {
$remote_svn = true;
$extra = array(
'conf' => $request->conf,
);
if ($request->method == 'POST') {
$form = new IDF_Form_SourceConf($request->POST, $extra);
if ($form->isValid()) {
foreach ($form->cleaned_data as $key=>$val) {
$request->conf->setVal($key, $val);
}
$request->user->setMessage(__('The project source configuration has been saved.'));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Project::adminSource',
array($prj->shortname));
return new Pluf_HTTP_Response_Redirect($url);
}
$request->user->setMessage(__('The project source configuration has been saved.'));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Project::adminSource',
array($prj->shortname));
return new Pluf_HTTP_Response_Redirect($url);
}
} else {
$params = array();
$keys = array('scm', 'svn_remote_url',
'svn_username', 'svn_password');
foreach ($keys as $key) {
$_val = $request->conf->getVal($key, false);
if ($_val !== false) {
$params[$key] = $_val;
} else {
$params = array();
foreach (array('svn_username', 'svn_password') as $key) {
$_val = $request->conf->getVal($key, false);
if ($_val !== false) {
$params[$key] = $_val;
}
}
if (count($params) == 0) {
$params = null; //Nothing in the db, so new form.
}
$form = new IDF_Form_SourceConf($params, $extra);
}
if (count($params) == 0) {
$params = null; //Nothing in the db, so new form.
}
$form = new IDF_Form_SourceConf($params, $extra);
}
$scm = $request->conf->getVal('scm', 'git');
$options = array(
'git' => __('git'),
'svn' => __('Subversion'),
'mercurial' => __('mercurial'),
);
$repository_type = $options[$scm];
return Pluf_Shortcuts_RenderToResponse('idf/admin/source.html',
array(
'remote_svn' => $remote_svn,
'repository_access' => $prj->getRemoteAccessUrl(),
'repository_type' => $repository_type,
'page_title' => $title,
'form' => $form,
),
src/IDF/conf/urls.php
374374
375375
376376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
377404
'model' => 'IDF_Views_Api',
'method' => 'issueCreate');
// ---------- FORGE ADMIN --------------------------------
$ctl[] = array('regex' => '#^/admin/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Admin',
'method' => 'home');
$ctl[] = array('regex' => '#^/admin/projects/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Admin',
'method' => 'projects');
$ctl[] = array('regex' => '#^/admin/projects/(\d+)/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Admin',
'method' => 'projectUpdate');
$ctl[] = array('regex' => '#^/admin/projects/create/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Admin',
'method' => 'projectCreate');
return $ctl;
src/IDF/templates/idf/admin/source.html
11
22
33
4
4
55
66
77
......
1212
1313
1414
15
16
17
15
16
1817
1918
2019
21
22
23
20
21
2422
25
23
2624
2725
2826
......
4038
4139
4240
43
41
4442
4543
4644
4745
4846
49
50
47
5148
5249
{extends "idf/admin/base.html"}
{block docclass}yui-t1{assign $inSource = true}{/block}
{block body}
{if $form.errors}
{if $remote_svn and $form.errors}
<div class="px-message-error">
<p>{trans 'The form contains some errors. Please correct them to update the source configuration.'}</p>
{if $form.get_top_errors}
<form method="post" action=".">
<table class="form" summary="">
<tr>
<th><strong>{$form.f.scm.labelTag}:</strong></th>
<td>{if $form.f.scm.errors}{$form.f.scm.fieldErrors}{/if}
{$form.f.scm|unsafe}
<th>{trans 'Repository type:'}</th>
<td>{$repository_type}
</td>
</tr>
<tr>
<th>{$form.f.svn_remote_url.labelTag}:</th>
<td>{if $form.f.svn_remote_url.errors}{$form.f.svn_remote_url.fieldErrors}{/if}
{$form.f.svn_remote_url|unsafe}
<th>{trans 'Repository access:'}</th>
<td>{$repository_access}
</td>
</tr>
</tr>{if $remote_svn}
<tr>
<th>{$form.f.svn_username.labelTag}:</th>
<td>{if $form.f.svn_username.errors}{$form.f.svn_username.fieldErrors}{/if}
<td>
<input type="submit" value="{trans 'Save Changes'}" name="submit" />
</td>
</tr>
</tr>{/if}
</table>
</form>
{/block}
{block context}
<div class="issue-submit-info">
<p><strong>{trans 'Instructions:'}</strong></p>
<p>{blocktrans}You can select the type of repository you want. In the case of subversion, you can use optionally a remote repository instead of the local one.{/blocktrans}</p>
<p>{blocktrans}You can find here the current repository configuration of your project.{/blocktrans}</p>
</div>
{/block}
src/IDF/templates/idf/base-simple.html
3535
3636
3737
38
3839
3940
4041
41
4242
4343
4444
<div id="hd">
<p class="top"><a href="#title" accesskey="2"></a>
{if !$user.isAnonymous()}{aurl 'url', 'IDF_Views_User::myAccount'}{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans} <a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a>{else}<a href="{url 'IDF_Views::login'}">{trans 'Sign in or create your account'}</a>{/if}
{if $isAdmin}| <a href="{url 'IDF_Views_Admin::home'}">{trans 'Administer'}</a>{/if}
| <a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a>
</p>
<h1 id="title" class="title">{block title}{$page_title}{/block}</h1>
</div>
<div id="bd">
<div id="yui-main">
src/IDF/templates/idf/base.html
3737
3838
3939
40
4041
4142
4243
<p class="top"><a href="#title" accesskey="2"></a>
{if !$user.isAnonymous()}{aurl 'url', 'IDF_Views_User::myAccount'}{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans} <a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a>{else}<a href="{url 'IDF_Views::login'}">{trans 'Sign in or create your account'}</a>{/if}
{if $project} | <a href="{url 'IDF_Views::index'}">{trans 'Project List'}</a>{/if}
{if $isAdmin}| <a href="{url 'IDF_Views_Admin::home'}">{trans 'Administer'}</a>{/if}
| <a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a>
</p>
<div id="header">
src/IDF/templates/idf/gadmin/base.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
{*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK *****
*}<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{media '/idf/css/yui.css'}" />
<link rel="stylesheet" type="text/css" href="{media '/idf/css/style.css'}" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="{media '/idf/css/ie6.css'}" />
<![endif]-->
{block extraheader}{/block}
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
</head>
<body>
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
<div id="hd">
<p class="top"><a href="#title" accesskey="2"></a>
{aurl 'url', 'IDF_Views_User::myAccount'}{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans} <a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a>
| <a href="{url 'IDF_Views::index'}">{trans 'Project List'}</a>
| <a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a>
</p>
<div id="header">
<div id="main-tabs">
<a accesskey="1" href="{url 'IDF_Views_Admin::home'}"{block tabhome}{/block}>{trans 'Administer'}</a>
<a href="{url 'IDF_Views_Admin::projects'}"{block tabprojects}{/block}>{trans 'Projects'}</a>
</div>
<div id="sub-tabs">{block subtabs}{/block}</div>
</div>
<h1 id="title" class="title">{block title}{$page_title}{/block}</h1>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g">
{if $user and $user.id}{getmsgs $user}{/if}
<div class="content">{block body}{/block}</div>
</div>
</div>
</div>
<div class="yui-b context">{block context}{/block}</div>
</div>
<div id="ft">{block foot}{/block}</div>
</div>
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
{include 'idf/js-hotkeys.html'}
{block javascript}{/block}
</body>
</html>
src/IDF/templates/idf/gadmin/home.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{extends "idf/gadmin/base.html"}
{block docclass}yui-t2{/block}
{block tabhome} class="active"{/block}
{block subtabs}
{trans 'Welcome'}
{/block}
{block body}
<p>{blocktrans}You have here access to the administration of the forge.{/blocktrans}</p>
{/block}
{block context}
{/block}
{block foot}<div id="branding">Powered by <a href="http://www.indefero.net" title="InDefero, bug tracking and more">InDefero</a>,<br />a <a href="http://www.ceondo.com">Céondo Ltd</a> initiative.</div>{/block}
src/IDF/templates/idf/gadmin/projects/base.html
1
2
3
4
5
6
{extends "idf/gadmin/base.html"}
{block tabprojects} class="active"{/block}
{block subtabs}
<a {if $inIndex}class="active" {/if}href="{url 'IDF_Views_Admin::projects'}">{trans 'Project List'}</a> |
<a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Admin::projectCreate'}">{trans 'Create Project'}</a>
{/block}
src/IDF/templates/idf/gadmin/projects/create.html
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
{extends "idf/gadmin/projects/base.html"}
{block docclass}yui-t3{assign $inCreate=true}{/block}
{block body}
{if $form.errors}
<div class="px-message-error">
<p>{trans 'The form contains some errors. Please correct them to create the project.'}</p>
{if $form.get_top_errors}
{$form.render_top_errors|unsafe}
{/if}
</div>
{/if}
<form method="post" action=".">
<table class="form" summary="">
<tr>
<th><strong>{$form.f.name.labelTag}:</strong></th>
<td>
{if $form.f.name.errors}{$form.f.name.fieldErrors}{/if}
{$form.f.name|unsafe}
</td>
</tr>
<tr>
<th><strong>{$form.f.shortname.labelTag}:</strong></th>
<td>
{if $form.f.shortname.errors}{$form.f.shortname.fieldErrors}{/if}
{$base_url}{$form.f.shortname|unsafe}/<br />
<span class="helptext">{$form.f.shortname.help_text}</span>
</td>
</tr>
<tr>
<th><strong>{$form.f.scm.labelTag}:</strong></th>
<td>{if $form.f.scm.errors}{$form.f.scm.fieldErrors}{/if}
{$form.f.scm|unsafe}
</td>
</tr>
<tr class="svn-form">
<th>{$form.f.svn_remote_url.labelTag}:</th>
<td>{if $form.f.svn_remote_url.errors}{$form.f.svn_remote_url.fieldErrors}{/if}
{$form.f.svn_remote_url|unsafe}
</td>
</tr>
<tr class="svn-form">
<th>{$form.f.svn_username.labelTag}:</th>
<td>{if $form.f.svn_username.errors}{$form.f.svn_username.fieldErrors}{/if}
{$form.f.svn_username|unsafe}
</td>
</tr>
<tr class="svn-form">
<th>{$form.f.svn_password.labelTag}:</th>
<td>{if $form.f.svn_password.errors}{$form.f.svn_password.fieldErrors}{/if}
{$form.f.svn_password|unsafe}
</td>
</tr>
<tr>
<th><strong>{$form.f.owners.labelTag}:</strong></th>
<td>
{if $form.f.owners.errors}{$form.f.owners.fieldErrors}{/if}
{$form.f.owners|unsafe}<br />
<span class="helptext">{trans 'Provide at least one owner for the project.'}</span>
</td>
</tr>
<tr>
<th>{$form.f.members.labelTag}:</th>
<td>
{if $form.f.members.errors}{$form.f.members.fieldErrors}{/if}
{$form.f.members|unsafe}
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="{trans 'Create Project'}" name="submit" />
</td>
</tr>
</table>
</form>
{/block}
{block context}
<div class="issue-submit-info">
<p><strong>{trans 'Instructions:'}</strong></p>
<p>{blocktrans}You can select the type of repository you want. In the case of subversion, you can use optionally a remote repository instead of the local one.{/blocktrans}</p>
<p>{blocktrans}<strong>Once you have defined the repository type, you cannot change it</strong>.{/blocktrans}</p>
</div>
<div class="issue-submit-info">
{blocktrans}
<p>Specify each person by its login. Each person must have already registered with the given login.</p>
<p>Separate the logins with commas and/or new lines.</p>
{/blocktrans}
</div>
<div class="issue-submit-info">
{blocktrans}
<p><strong>Notes:</strong></p>
<p>A project owner may make any change to this project, including removing other project owners. You need to be carefull when you give owner rights.</p>
<p>A project member will not have access to the administration area but will have more options available in the use of the project.</p>
{/blocktrans}
</div>
{/block}
{block javascript}{literal}
<script type="text/javascript">
$(document).ready(function() {
// Hide if not svn
if ($("#id_scm option:selected").val() != "svn") {
$(".svn-form").hide();
}
$("#id_scm").change(function () {
if ($("#id_scm option:selected").val() == "svn") {
$(".svn-form").show();
} else {
$(".svn-form").hide();
}
});
});
</script>
{/literal}{/block}
{*
$("select").change(function () {
var str = "";
$("select option:selected").each(function () {
str += $(this).text() + " ";
});
$("div").text(str);
})
.trigger('change');
*}
src/IDF/templates/idf/gadmin/projects/index.html
1
2
3
4
5
6
7
8
{extends "idf/gadmin/projects/base.html"}
{block docclass}yui-t2{assign $inIndex=true}{/block}
{block body}
{$projects.render}
{/block}
src/IDF/templates/idf/gadmin/projects/update.html
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
{extends "idf/gadmin/projects/base.html"}
{block body}
{if $form.errors}
<div class="px-message-error">
<p>{trans 'The form contains some errors. Please correct them to update the project.'}</p>
{if $form.get_top_errors}
{$form.render_top_errors|unsafe}
{/if}
</div>
{/if}
<form method="post" action=".">
<table class="form" summary="">
<tr>
<th><strong>{$form.f.name.labelTag}:</strong></th>
<td>
{if $form.f.name.errors}{$form.f.name.fieldErrors}{/if}
{$form.f.name|unsafe}
</td>
</tr>
<tr>
<th><strong>{$form.f.owners.labelTag}:</strong></th>
<td>
{if $form.f.owners.errors}{$form.f.owners.fieldErrors}{/if}
{$form.f.owners|unsafe}<br />
<span class="helptext">{trans 'Provide at least one owner for the project.'}</span>
</td>
</tr>
<tr>
<th>{$form.f.members.labelTag}:</th>
<td>
{if $form.f.members.errors}{$form.f.members.fieldErrors}{/if}
{$form.f.members|unsafe}
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="{trans 'Update Project'}" name="submit" />
| <a href="{url 'IDF_Views_Admin::projects'}">{trans 'Cancel'}</a>
</td>
</tr>
</table>
</form>
{/block}
{block context}
<div class="issue-submit-info">
{blocktrans}
<p><strong>Instructions:</strong></p>
<p>Specify each person by its login. Each person must have already registered with the given login.</p>
<p>Separate the logins with commas and/or new lines.</p>
{/blocktrans}
</div>
<div class="issue-submit-info">
{blocktrans}
<p><strong>Notes:</strong></p>
<p>A project owner may make any change to this project, including removing other project owners. You need to be carefull when you give owner rights.</p>
<p>A project member will not have access to the administration area but will have more options available in the use of the project.</p>
{/blocktrans}
</div>
{/block}
src/IDF/templates/idf/index.html
11
22
3
4
35
46
57
{extends "idf/base-simple.html"}
{block docclass}yui-t1{/block}
{block tabhome} class="active"{/block}
{block subtabs}<a href="{url 'IDF_Views::index'}" class="active">{trans 'Projects'}</a>{/block}
{block body}
{if $projects.count() == 0}
<p>{trans 'No projects managed with InDefero were found.'}</p>

Archive Download the corresponding diff file

Page rendered in 0.14208s using 13 queries.