Showing 4 changed files with 106 additions and 50 deletions
+1
templates/css/common.html.ep
... ...
@@ -58,6 +58,7 @@
58 58
   .main_panel {
59 59
     width:900px;
60 60
     margin:5px auto;
61
+    min-height:300px;
61 62
   }
62 63
   
63 64
   /* Diff */
-1
templates/include/footer.html.ep
... ...
@@ -1,7 +1,6 @@
1 1
 %= stylesheet begin
2 2
   /* Footer */
3 3
   .footer {
4
-    background-color:#F3F3F3;
5 4
     margin-top:10px;
6 5
     padding:10px;
7 6
     border-top:1px solid #E5E5E5;
+102 -49
templates/include/header.html.ep
... ...
@@ -1,52 +1,105 @@
1
-%= stylesheet begin
1
+<%
2
+  my $user_id = stash('user_id');
3
+%>
2 4
 
3
-  /* Header */
4
-  .header {
5
-    background-color:#F3F3F3;
6
-    margin-bottom:10px;
7
-    border-bottom:1px solid #E5E5E5;
8
-    height:40px;
9
-    font-weight:bold;
10
-  }
11
-  .header .panel {
12
-    width:900px;
13
-    margin:auto;
14
-    overflow:hidden;
15
-  }
16
-  .header .left {
17
-    width:400px;
18
-  }
19
-  .header li {
20
-    padding:10px;
21
-  }
22
-  .header .left li {
23
-    float:left;
24
-  }
25
-  .header .right li{
26
-    float:right;
27
-  }
28
-  .header a {
29
-    color:#333;
30
-  }
31
-  .header a:hover {
32
-    color:#4183C4;
33
-  }
34
-% end
5
+% if (defined $user_id) {
6
+  %= stylesheet begin
35 7
 
36
-<div class="header">
37
-  <div class="panel">
38
-    <ul class="left">
39
-      <li><a href="<%= url_for('/') %>">Home</a></li>
40
-    </ul>
41
-    <ul class="right">
42
-      <li><a href="<%= url_for("/logout") %>"><s>Sign out</s></a></li>
43
-      <li>
44
-        <a href="<%= url_for("/setting/profile") %>"><s>Account setting</s></a>
45
-      </li>
46
-      <li><a href="<%= url_for("/_admin/create") %>">Create a new repo</a></li>
47
-      % if (my $user = stash('user')) {
48
-        <li><a href="<%= url_for("/$user") %>"><%= $user %></a></li>
49
-      % }
50
-    </ul>
8
+    /* Header */
9
+    .header {
10
+      background-color:#F3F3F3;
11
+      margin-bottom:10px;
12
+      border-bottom:1px solid #E5E5E5;
13
+      height:40px;
14
+      font-weight:bold;
15
+    }
16
+    .header .panel {
17
+      width:900px;
18
+      margin:auto;
19
+      overflow:hidden;
20
+    }
21
+    .header .left {
22
+      width:400px;
23
+    }
24
+    .header li {
25
+      padding:10px;
26
+    }
27
+    .header .left li {
28
+      float:left;
29
+    }
30
+    .header .right li{
31
+      float:right;
32
+    }
33
+    .header a {
34
+      color:#333;
35
+    }
36
+    .header a:hover {
37
+      color:#4183C4;
38
+    }
39
+  % end
40
+
41
+  <div class="header">
42
+    <div class="panel">
43
+      <ul class="left">
44
+        <li><a href="<%= url_for('/') %>">GitPrep</a></li>
45
+      </ul>
46
+      <ul class="right">
47
+        <li><a href="<%= url_for("/logout") %>"><s>Sign out</s></a></li>
48
+        <li>
49
+          <a href="<%= url_for("/setting/profile") %>"><s>Account setting</s></a>
50
+        </li>
51
+        <li><a href="<%= url_for("/_admin/create") %>">Create a new repo</a></li>
52
+        % if (my $user = stash('user')) {
53
+          <li><a href="<%= url_for("/$user") %>"><%= $user %></a></li>
54
+        % }
55
+      </ul>
56
+    </div>
51 57
   </div>
52
-</div>
58
+% } else {
59
+  %= stylesheet begin
60
+
61
+    /* Header */
62
+    .header {
63
+      background-color:white;
64
+      margin-bottom:10px;
65
+      border-bottom:1px solid #E5E5E5;
66
+      height:65px;
67
+      font-weight:bold;
68
+    }
69
+    .header .hpanel {
70
+      width:900px;
71
+      margin:auto;
72
+      overflow:hidden;
73
+      padding:10px;
74
+    }
75
+    .header h1 {
76
+      font-size:140%;
77
+      float:left;
78
+      padding-top:12px;
79
+    }
80
+    .header .hsignin {
81
+      float:right;
82
+      background-color:#EEE;
83
+      border:1px solid #d8dee2;
84
+      margin-top:5px;
85
+      padding:10px;
86
+      display:block;
87
+      border-radius:3px;
88
+    }
89
+    .header a {
90
+      color:#333;
91
+    }
92
+    .header a:hover {
93
+      color:white;
94
+      background-color:#4183C4;
95
+    }
96
+  % end
97
+
98
+  <div class="header">
99
+    <div class="hpanel">
100
+      <h1><a href="<%= url_for('/') %>">GitPrep</a></h1>
101
+      <a class="hsignin" href="<%= url_for('/_login') %>">Sing in</a>
102
+    </div>
103
+  </div>
104
+% }
105
+
+3
templates/main/login.html.ep
... ...
@@ -73,6 +73,7 @@
73 73
   }
74 74
 %>
75 75
 
76
+
76 77
 %= stylesheet begin
77 78
   .signin {
78 79
     width:350px;
... ...
@@ -148,6 +149,8 @@
148 149
 
149 150
 % layout 'common';
150 151
 %= include '/css/common';
152
+%= include '/include/header';
153
+
151 154
 % my $id = '';
152 155
 % if (flash('success')) {
153 156
   <br>