... | ... |
@@ -43,6 +43,33 @@ input[type=text], input[type=password] { |
43 | 43 |
padding:6px 5px; |
44 | 44 |
} |
45 | 45 |
|
46 |
+.repositories-container { |
|
47 |
+ overflow:hidden; |
|
48 |
+} |
|
49 |
+.repositories-left { |
|
50 |
+ padding-top:20px; |
|
51 |
+ padding-left:10px; |
|
52 |
+ padding-right:25px; |
|
53 |
+ width:25%; |
|
54 |
+ float:left; |
|
55 |
+} |
|
56 |
+.repositories-right { |
|
57 |
+ width:75%; |
|
58 |
+ float:left; |
|
59 |
+} |
|
60 |
+.repositories-user-name { |
|
61 |
+ font-weight:bold; |
|
62 |
+ font-size:22px; |
|
63 |
+} |
|
64 |
+.repositories-user-id { |
|
65 |
+ padding:5px 0 7px 2px; |
|
66 |
+ font-size:18px; |
|
67 |
+ color:#767676; |
|
68 |
+ border-bottom:1px solid #d8d8d8; |
|
69 |
+} |
|
70 |
+.repositories-user-mail { |
|
71 |
+ padding:5px 0; |
|
72 |
+} |
|
46 | 73 |
.project-tabs { |
47 | 74 |
position:relative; |
48 | 75 |
z-index:1; |
... | ... |
@@ -9,59 +9,76 @@ |
9 | 9 |
return; |
10 | 10 |
} |
11 | 11 |
|
12 |
- my $user = param('user'); |
|
12 |
+ my $user_id = param('user'); |
|
13 |
+ my $user = app->dbi->model('user')->select( |
|
14 |
+ where => {id => $user_id, admin => 0} |
|
15 |
+ )->one; |
|
13 | 16 |
|
14 | 17 |
# Projects |
15 |
- unless (app->manager->exists_user($user)) { |
|
18 |
+ unless (app->manager->exists_user($user_id)) { |
|
16 | 19 |
$self->reply->not_found; |
17 | 20 |
return; |
18 | 21 |
} |
19 |
- my $projects = app->manager->projects($user); |
|
22 |
+ my $projects = app->manager->projects($user_id); |
|
20 | 23 |
my $reps = []; |
21 | 24 |
for my $project (@$projects) { |
22 |
- my $rep = app->git->repository($user, $project->{name}) || {none => 1}; |
|
25 |
+ my $rep = app->git->repository($user_id, $project->{name}) || {none => 1}; |
|
23 | 26 |
$rep->{name} = $project->{name}; |
24 | 27 |
$rep->{private} = $project->{private}; |
25 | 28 |
push @$reps, $rep; |
26 | 29 |
} |
27 | 30 |
%> |
28 | 31 |
|
29 |
-% layout 'common', title => $user; |
|
32 |
+% layout 'common', title => $user_id; |
|
30 | 33 |
%= include '/include/header', title => 'Repositories'; |
31 | 34 |
|
32 | 35 |
<div class="container"> |
33 | 36 |
%= include '/include/message', message => flash('message'); |
34 |
- |
|
35 |
- <div class="topic1">Repositories</div> |
|
36 | 37 |
|
37 |
- <ul class="repositories"> |
|
38 |
- % for my $rep (sort { $a->{age} <=> $b->{age} } @$reps) { |
|
39 |
- % if (!$rep->{private} || $api->can_access_private_project($user, $rep->{name})) { |
|
40 |
- <li> |
|
41 |
- % my $pname = $rep->{name}; |
|
42 |
- <div class="repositories-name"> |
|
43 |
- <a href="<%= url_for("/$user/$pname") %>"> |
|
44 |
- <%= $rep->{name} %> |
|
45 |
- </a> |
|
46 |
- % if ($rep->{private}) { |
|
47 |
- <i class="icon icon-lock"></i> |
|
48 |
- % } |
|
49 |
- </div> |
|
50 |
- <div class="repositories-description"> |
|
51 |
- <%= $rep->{description} %> |
|
52 |
- </div> |
|
53 |
- <div class="repositories-age"> |
|
54 |
- % my $age = $rep->{age_string}; |
|
55 |
- % if ($rep->{none}) { |
|
56 |
- <span style="color:red">Repository not exists</span> |
|
57 |
- <a href="<%= "/$user/$rep->{name}/settings" %>" class="btn btn-mini">Settings</a> |
|
58 |
- % } else { |
|
59 |
- <%= $age ? "last updated $age" : 'new repository' %> |
|
60 |
- % } |
|
61 |
- </div> |
|
62 |
- </li> |
|
63 |
- % } |
|
64 |
- % } |
|
65 |
- </ul> |
|
66 |
- </div> |
|
38 |
+ <div class="repositories-container"> |
|
39 |
+ <div class="repositories-left"> |
|
40 |
+ <div class="repositories-user-name"> |
|
41 |
+ % if (defined $user->{name} && length $user->{name}) { |
|
42 |
+ <%= $user->{name} %> |
|
43 |
+ % } else { |
|
44 |
+ No Name |
|
45 |
+ % } |
|
46 |
+ </div> |
|
47 |
+ <div class="repositories-user-id"><%= $user->{id} %></div> |
|
48 |
+ <div class="repositories-user-mail"><i class="icon icon-envelope"></i> <a href="mailto:<%= $user->{mail} %>"><%= $user->{mail} %></a></div> |
|
49 |
+ </div> |
|
50 |
+ <div class="repositories-right"> |
|
51 |
+ <div class="topic1">Repositories</div> |
|
52 |
+ |
|
53 |
+ <ul class="repositories"> |
|
54 |
+ % for my $rep (sort { $a->{age} <=> $b->{age} } @$reps) { |
|
55 |
+ % if (!$rep->{private} || $api->can_access_private_project($user_id, $rep->{name})) { |
|
56 |
+ <li> |
|
57 |
+ % my $pname = $rep->{name}; |
|
58 |
+ <div class="repositories-name"> |
|
59 |
+ <a href="<%= url_for("/$user_id/$pname") %>"> |
|
60 |
+ <%= $rep->{name} %> |
|
61 |
+ </a> |
|
62 |
+ % if ($rep->{private}) { |
|
63 |
+ <i class="icon icon-lock"></i> |
|
64 |
+ % } |
|
65 |
+ </div> |
|
66 |
+ <div class="repositories-description"> |
|
67 |
+ <%= $rep->{description} %> |
|
68 |
+ </div> |
|
69 |
+ <div class="repositories-age"> |
|
70 |
+ % my $age = $rep->{age_string}; |
|
71 |
+ % if ($rep->{none}) { |
|
72 |
+ <span style="color:red">Repository not exists</span> |
|
73 |
+ <a href="<%= "/$user_id/$rep->{name}/settings" %>" class="btn btn-mini">Settings</a> |
|
74 |
+ % } else { |
|
75 |
+ <%= $age ? "last updated $age" : 'new repository' %> |
|
76 |
+ % } |
|
77 |
+ </div> |
|
78 |
+ </li> |
|
79 |
+ % } |
|
80 |
+ % } |
|
81 |
+ </ul> |
|
82 |
+ </div> |
|
83 |
+ </div> |
|
67 | 84 |
%= include '/include/footer'; |