... | ... |
@@ -356,12 +356,14 @@ sub original_user { |
356 | 356 |
} |
357 | 357 |
|
358 | 358 |
sub projects { |
359 |
- my ($self, $user) = @_; |
|
360 |
- |
|
359 |
+ my ($self, $user_id) = @_; |
|
360 |
+ |
|
361 |
+ my $user_row_id = $self->app->dbi->model('user')->select('row_id', where => {id => $user_id})->value; |
|
362 |
+ |
|
361 | 363 |
# Projects |
362 | 364 |
my $projects = $self->app->dbi->model('project')->select( |
363 |
- where => {user_id => $user}, |
|
364 |
- append => 'order by name' |
|
365 |
+ where => {user => $user_row_id}, |
|
366 |
+ append => 'order by id' |
|
365 | 367 |
)->all; |
366 | 368 |
|
367 | 369 |
return $projects; |
... | ... |
@@ -14,6 +14,12 @@ |
14 | 14 |
return; |
15 | 15 |
} |
16 | 16 |
|
17 |
+ my $user_row_id = app->dbi->model('user')->select('row_id', where => {id => $user})->value; |
|
18 |
+ my $project_row_id = app->dbi->model('project')->model('project')->select( |
|
19 |
+ 'row_id', |
|
20 |
+ where => {user => $user_row_id, id => $proejct} |
|
21 |
+ )->value; |
|
22 |
+ |
|
17 | 23 |
# Rename project |
18 | 24 |
my $git = app->git; |
19 | 25 |
my $errors; |
... | ... |
@@ -22,8 +22,8 @@ |
22 | 22 |
my $projects = app->manager->projects($user_id); |
23 | 23 |
my $reps = []; |
24 | 24 |
for my $project (@$projects) { |
25 |
- my $rep = app->git->repository(app->rep_info($user_id, $project->{name})) || {none => 1}; |
|
26 |
- $rep->{name} = $project->{name}; |
|
25 |
+ my $rep = app->git->repository(app->rep_info($user_id, $project->{id})) || {none => 1}; |
|
26 |
+ $rep->{id} = $project->{id}; |
|
27 | 27 |
$rep->{private} = $project->{private}; |
28 | 28 |
$rep->{age} //= 0; |
29 | 29 |
push @$reps, $rep; |
... | ... |
@@ -53,12 +53,12 @@ |
53 | 53 |
|
54 | 54 |
<ul class="repositories"> |
55 | 55 |
% for my $rep (sort { $a->{age} <=> $b->{age} } @$reps) { |
56 |
- % if (!$rep->{private} || $api->can_access_private_project($user_id, $rep->{name})) { |
|
56 |
+ % if (!$rep->{private} || $api->can_access_private_project($user_id, $rep->{id})) { |
|
57 | 57 |
<li> |
58 |
- % my $pname = $rep->{name}; |
|
58 |
+ % my $project_id = $rep->{id}; |
|
59 | 59 |
<div class="repositories-name"> |
60 |
- <a href="<%= url_for("/$user_id/$pname") %>"> |
|
61 |
- <%= $rep->{name} %> |
|
60 |
+ <a href="<%= url_for("/$user_id/$project_id") %>"> |
|
61 |
+ <%= $rep->{id} %> |
|
62 | 62 |
</a> |
63 | 63 |
% if ($rep->{private}) { |
64 | 64 |
<i class="icon icon-lock"></i> |
... | ... |
@@ -71,7 +71,7 @@ |
71 | 71 |
% my $age = $rep->{age_string}; |
72 | 72 |
% if ($rep->{none}) { |
73 | 73 |
<span style="color:red">Repository not exists</span> |
74 |
- <a href="<%= "/$user_id/$rep->{name}/settings" %>" class="btn btn-mini">Settings</a> |
|
74 |
+ <a href="<%= "/$user_id/$rep->{id}/settings" %>" class="btn btn-mini">Settings</a> |
|
75 | 75 |
% } else { |
76 | 76 |
<%= $age ? "last updated $age" : 'new repository' %> |
77 | 77 |
% } |