##// END OF EJS Templates
fixed html in admin templates. Litle refactors
marcink -
r174:fec7d070 default
parent child Browse files
Show More
@@ -1,70 +1,70 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3 <%def name="get_form_error(element)">
3 <%def name="get_form_error(element)">
4 %if hasattr(c,'form_errors'):
4 %if hasattr(c,'form_errors'):
5 %if type(c.form_errors) == dict:
5 %if type(c.form_errors) == dict:
6 %if c.form_errors.get(element,False):
6 %if c.form_errors.get(element,False):
7 <span class="error-message">
7 <span class="error-message">
8 ${c.form_errors.get(element,'')}
8 ${c.form_errors.get(element,'')}
9 </span>
9 </span>
10 %endif
10 %endif
11 %endif
11 %endif
12 %endif
12 %endif
13 </%def>
13 </%def>
14 <%def name="title()">
14 <%def name="title()">
15 ${_('Repository managment')}
15 ${_('Repository managment')}
16 </%def>
16 </%def>
17 <%def name="breadcrumbs()">
17 <%def name="breadcrumbs()">
18 ${h.link_to(u'Home',h.url('/'))}
18 ${h.link_to(u'Admin',h.url('admin_home'))}
19 /
19 /
20 ${h.link_to(u'Admin',h.url('admin_home'))}
20
21 </%def>
21 </%def>
22 <%def name="page_nav()">
22 <%def name="page_nav()">
23 <ul class="page-nav">
23 <ul class="page-nav">
24 <li>${h.link_to(u'Home',h.url('/'))}</li>
24 <li>${h.link_to(u'Home',h.url('/'))}</li>
25 <li class="current">${_('Admin')}</li>
25 <li class="current">${_('Admin')}</li>
26 </ul>
26 </ul>
27 </%def>
27 </%def>
28 <%def name="main()">
28 <%def name="main()">
29 %if c.admin_user:
29 %if c.admin_user:
30 <ul class="submenu">
30 <ul class="submenu">
31 <li>
31 <li>
32 ${h.link_to(u'Repos',h.url('repos'))}
32 ${h.link_to(u'Repos',h.url('repos'))}
33 </li>
33 </li>
34 <li>
34 <li>
35 ${h.link_to(u'Users',h.url('users'))}
35 ${h.link_to(u'Users',h.url('users'))}
36 </li>
36 </li>
37 </ul>
37 </ul>
38 <br/>
38 <br/>
39 <div>
39 <div>
40 <h2>Welcome ${c.admin_username}</h2>
40 <h2>Welcome ${c.admin_username}</h2>
41 <div id="user_log">
41 <div id="user_log">
42 ${c.log_data}
42 ${c.log_data}
43 </div>
43 </div>
44 </div>
44 </div>
45 %else:
45 %else:
46 <div>
46 <div>
47 <br />
47 <br />
48 <h2>${_('Login')}</h2>
48 <h2>${_('Login')}</h2>
49 ${h.form(h.url.current())}
49 ${h.form(h.url.current())}
50 <table>
50 <table>
51 <tr>
51 <tr>
52 <td>${_('Username')}</td>
52 <td>${_('Username')}</td>
53 <td>${h.text('username')}</td>
53 <td>${h.text('username')}</td>
54 <td>${get_form_error('username')} </td>
54 <td>${get_form_error('username')} </td>
55 </tr>
55 </tr>
56 <tr>
56 <tr>
57 <td>${_('Password')}</td>
57 <td>${_('Password')}</td>
58 <td>${h.password('password')}</td>
58 <td>${h.password('password')}</td>
59 <td>${get_form_error('password')}</td>
59 <td>${get_form_error('password')}</td>
60 </tr>
60 </tr>
61 <tr>
61 <tr>
62 <td></td>
62 <td></td>
63 <td>${h.submit('login','login')}</td>
63 <td>${h.submit('login','login')}</td>
64 </tr>
64 </tr>
65 </table>
65 </table>
66 ${h.end_form()}
66 ${h.end_form()}
67 </div>
67 </div>
68 %endif
68 %endif
69
69
70 </%def> No newline at end of file
70 </%def>
@@ -1,44 +1,43 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Add new repository')}
5 ${_('Add new repository')}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs()">
8 <%def name="breadcrumbs()">
9 ${h.link_to(u'Home',h.url('/'))}
9 ${h.link_to(u'Admin',h.url('admin_home'))}
10 /
10 /
11 ${h.link_to(u'Admin',h.url('admin_home'))}
12 </%def>
11 </%def>
13
12
14 <%def name="page_nav()">
13 <%def name="page_nav()">
15 <ul class="page-nav">
14 <ul class="page-nav">
16 <li>${h.link_to(u'Home',h.url('/'))}</li>
15 <li>${h.link_to(u'Home',h.url('/'))}</li>
17 <li class="current">${_('Admin')}</li>
16 <li class="current">${_('Admin')}</li>
18 </ul>
17 </ul>
19 </%def>
18 </%def>
20
19
21 <%def name="main()">
20 <%def name="main()">
22 <table cellspacing="0">
21 <table cellspacing="0">
23 <tr>
22 <tr>
24 <td><h1>${c.msg}</h1></td>
23 <td><h1>${c.msg}</h1></td>
25 </tr>
24 </tr>
26 <tr>
25 <tr>
27 <td><h2>${c.new_repo}</h2></td>
26 <td><h2>${c.new_repo}</h2></td>
28 </tr>
27 </tr>
29 </table>
28 </table>
30 </%def>
29 </%def>
31
30
32
31
33
32
34
33
35
34
36
35
37
36
38
37
39
38
40
39
41
40
42
41
43
42
44
43
@@ -1,28 +1,26 b''
1 <%inherit file="base/base.html"/>
1 <%inherit file="base/base.html"/>
2 <%def name="title()">
2 <%def name="title()">
3 ${_('Repository managment')}
3 ${_('Repository managment')}
4 </%def>
4 </%def>
5 <%def name="breadcrumbs()">
5 <%def name="breadcrumbs()">
6 ${h.link_to(u'Home',h.url('/'))}
7 /
8 ${h.link_to(u'Admin',h.url('admin_home'))}
6 ${h.link_to(u'Admin',h.url('admin_home'))}
9 /
7 /
10 ${h.link_to(u'Repos managment',h.url('repos'))}
8 ${h.link_to(u'Repos managment',h.url('repos'))}
11 </%def>
9 </%def>
12 <%def name="page_nav()">
10 <%def name="page_nav()">
13 <li>${h.link_to(u'Home',h.url('/'))}</li>
11 <li>${h.link_to(u'Home',h.url('/'))}</li>
14 <li class="current">${_('Admin')}</li>
12 <li class="current">${_('Admin')}</li>
15 </%def>
13 </%def>
16 <%def name="main()">
14 <%def name="main()">
17 <ul class="submenu">
15 <ul class="submenu">
18 <li class="current_submenu">
16 <li class="current_submenu">
19 ${h.link_to(u'Repos',h.url('repos'))}
17 ${h.link_to(u'Repos',h.url('repos'))}
20 </li>
18 </li>
21 <li>
19 <li>
22 ${h.link_to(u'Users',h.url('users'))}
20 ${h.link_to(u'Users',h.url('users'))}
23 </li>
21 </li>
24 </ul>
22 </ul>
25 <div>
23 <div>
26 <h2>${_('Mercurial repos')}</h2>
24 <h2>${_('Mercurial repos')}</h2>
27 </div>
25 </div>
28 </%def> No newline at end of file
26 </%def>
@@ -1,43 +1,41 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2 <%def name="title()">
2 <%def name="title()">
3 ${_('Repository managment')}
3 ${_('Repository managment')}
4 </%def>
4 </%def>
5 <%def name="breadcrumbs()">
5 <%def name="breadcrumbs()">
6 ${h.link_to(u'Home',h.url('/'))}
7 /
8 ${h.link_to(u'Admin',h.url('admin_home'))}
6 ${h.link_to(u'Admin',h.url('admin_home'))}
9 /
7 /
10 ${h.link_to(u'Repos managment',h.url('repos'))}
8 ${h.link_to(u'Repos managment',h.url('repos'))}
11 </%def>
9 </%def>
12 <%def name="page_nav()">
10 <%def name="page_nav()">
13 <ul class="page-nav">
11 <ul class="page-nav">
14 <li>${h.link_to(u'Home',h.url('/'))}</li>
12 <li>${h.link_to(u'Home',h.url('/'))}</li>
15 <li class="current">${_('Admin')}</li>
13 <li class="current">${_('Admin')}</li>
16 </ul>
14 </ul>
17 </%def>
15 </%def>
18 <%def name="main()">
16 <%def name="main()">
19 <ul class="submenu">
17 <ul class="submenu">
20 <li>
18 <li>
21 ${h.link_to(u'Repos',h.url('repos'), class_="current_submenu")}
19 ${h.link_to(u'Repos',h.url('repos'), class_="current_submenu")}
22 </li>
20 </li>
23 <li>
21 <li>
24 ${h.link_to(u'Users',h.url('users'))}
22 ${h.link_to(u'Users',h.url('users'))}
25 </li>
23 </li>
26 </ul>
24 </ul>
27 <div>
25 <div>
28 <h2>${_('Mercurial repos')}</h2>
26 <h2>${_('Mercurial repos')}</h2>
29 <table>
27 <table>
30 %for cnt,repo in enumerate(c.repos_list):
28 %for cnt,repo in enumerate(c.repos_list):
31 <tr class="parity${cnt%2}">
29 <tr class="parity${cnt%2}">
32 <td>${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td>
30 <td>${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td>
33 <td>r${repo['rev']}:${repo['tip']}</td>
31 <td>r${repo['rev']}:${repo['tip']}</td>
34 <td>
32 <td>
35 ${h.form(url('repo', id=repo['name']),method='delete')}
33 ${h.form(url('repo', id=repo['name']),method='delete')}
36 ${h.submit('remove','remove',class_="submit",onclick="return confirm('Confirm to delete this repository');")}
34 ${h.submit('remove','remove',class_="submit",onclick="return confirm('Confirm to delete this repository');")}
37 ${h.end_form()}
35 ${h.end_form()}
38 </td>
36 </td>
39 </tr>
37 </tr>
40 %endfor
38 %endfor
41 </table>
39 </table>
42 </div>
40 </div>
43 </%def> No newline at end of file
41 </%def>
@@ -1,52 +1,50 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2 <%def name="title()">
2 <%def name="title()">
3 ${_('User')} - ${_('add new')}
3 ${_('User')} - ${_('add new')}
4 </%def>
4 </%def>
5 <%def name="breadcrumbs()">
5 <%def name="breadcrumbs()">
6 ${h.link_to(u'Home',h.url('/'))}
7 /
8 ${h.link_to(u'Admin',h.url('admin_home'))}
6 ${h.link_to(u'Admin',h.url('admin_home'))}
9 /
7 /
10 ${h.link_to(u'Users',h.url('users'))}
8 ${h.link_to(u'Users',h.url('users'))}
11 </%def>
9 </%def>
12 <%def name="page_nav()">
10 <%def name="page_nav()">
13 <ul class="page-nav">
11 <ul class="page-nav">
14 <li>${h.link_to(u'Home',h.url('/'))}</li>
12 <li>${h.link_to(u'Home',h.url('/'))}</li>
15 <li class="current">${_('Admin')}</li>
13 <li class="current">${_('Admin')}</li>
16 </ul>
14 </ul>
17 </%def>
15 </%def>
18 <%def name="main()">
16 <%def name="main()">
19 <ul class="submenu">
17 <ul class="submenu">
20 <li>
18 <li>
21 ${h.link_to(u'Repos',h.url('repos'))}
19 ${h.link_to(u'Repos',h.url('repos'))}
22 </li>
20 </li>
23 <li class="current_submenu">
21 <li class="current_submenu">
24 ${h.link_to(u'Users',h.url('users'))}
22 ${h.link_to(u'Users',h.url('users'))}
25 </li>
23 </li>
26 </ul>
24 </ul>
27 <div>
25 <div>
28 <h2>${_('User')} - ${_('add new')}</h2>
26 <h2>${_('User')} - ${_('add new')}</h2>
29 ${h.form(url('users'))}
27 ${h.form(url('users'))}
30 <table>
28 <table>
31 <tr>
29 <tr>
32 <td>${_('Username')}</td>
30 <td>${_('Username')}</td>
33 <td>${h.text('username')}</td>
31 <td>${h.text('username')}</td>
34 </tr>
32 </tr>
35 <tr>
33 <tr>
36 <td>${_('password')}</td>
34 <td>${_('password')}</td>
37 <td>${h.text('password')}</td>
35 <td>${h.text('password')}</td>
38 </tr>
36 </tr>
39 <tr>
37 <tr>
40 <td>${_('Active')}</td>
38 <td>${_('Active')}</td>
41 <td>${h.checkbox('active')}</td>
39 <td>${h.checkbox('active')}</td>
42 </tr>
40 </tr>
43 <tr>
41 <tr>
44 <td></td>
42 <td></td>
45 <td>${h.submit('add','add')}</td>
43 <td>${h.submit('add','add')}</td>
46 </tr>
44 </tr>
47
45
48 </table>
46 </table>
49
47
50 ${h.end_form()}
48 ${h.end_form()}
51 </div>
49 </div>
52 </%def> No newline at end of file
50 </%def>
@@ -1,52 +1,50 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2 <%def name="title()">
2 <%def name="title()">
3 ${_('User')} - ${c.user.username}
3 ${_('User')} - ${c.user.username}
4 </%def>
4 </%def>
5 <%def name="breadcrumbs()">
5 <%def name="breadcrumbs()">
6 ${h.link_to(u'Home',h.url('/'))}
7 /
8 ${h.link_to(u'Admin',h.url('admin_home'))}
6 ${h.link_to(u'Admin',h.url('admin_home'))}
9 /
7 /
10 ${h.link_to(u'Users',h.url('users'))}
8 ${h.link_to(u'Users',h.url('users'))}
11 </%def>
9 </%def>
12 <%def name="page_nav()">
10 <%def name="page_nav()">
13 <ul class="page-nav">
11 <ul class="page-nav">
14 <li>${h.link_to(u'Home',h.url('/'))}</li>
12 <li>${h.link_to(u'Home',h.url('/'))}</li>
15 <li class="current">${_('Admin')}</li>
13 <li class="current">${_('Admin')}</li>
16 </ul>
14 </ul>
17 </%def>
15 </%def>
18 <%def name="main()">
16 <%def name="main()">
19 <ul class="submenu">
17 <ul class="submenu">
20 <li>
18 <li>
21 ${h.link_to(u'Repos',h.url('repos'))}
19 ${h.link_to(u'Repos',h.url('repos'))}
22 </li>
20 </li>
23 <li class="current_submenu">
21 <li class="current_submenu">
24 ${h.link_to(u'Users',h.url('users'))}
22 ${h.link_to(u'Users',h.url('users'))}
25 </li>
23 </li>
26 </ul>
24 </ul>
27 <div>
25 <div>
28 <h2>${_('User')} - ${c.user.username}</h2>
26 <h2>${_('User')} - ${c.user.username}</h2>
29 ${h.form(url('user', id=c.user.user_id),method='put')}
27 ${h.form(url('user', id=c.user.user_id),method='put')}
30 <table>
28 <table>
31 <tr>
29 <tr>
32 <td>${_('Username')}</td>
30 <td>${_('Username')}</td>
33 <td>${h.text('username')}</td>
31 <td>${h.text('username')}</td>
34 </tr>
32 </tr>
35 <tr>
33 <tr>
36 <td>${_('New password')}</td>
34 <td>${_('New password')}</td>
37 <td>${h.text('new_password')}</td>
35 <td>${h.text('new_password')}</td>
38 </tr>
36 </tr>
39 <tr>
37 <tr>
40 <td>${_('Active')}</td>
38 <td>${_('Active')}</td>
41 <td>${h.checkbox('active',value=True)}</td>
39 <td>${h.checkbox('active',value=True)}</td>
42 </tr>
40 </tr>
43 <tr>
41 <tr>
44 <td></td>
42 <td></td>
45 <td>${h.submit('save','save')}</td>
43 <td>${h.submit('save','save')}</td>
46 </tr>
44 </tr>
47
45
48 </table>
46 </table>
49
47
50 ${h.end_form()}
48 ${h.end_form()}
51 </div>
49 </div>
52 </%def> No newline at end of file
50 </%def>
@@ -1,54 +1,52 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2 <%def name="title()">
2 <%def name="title()">
3 ${_('Repository managment')}
3 ${_('Users managment')}
4 </%def>
4 </%def>
5 <%def name="breadcrumbs()">
5 <%def name="breadcrumbs()">
6 ${h.link_to(u'Home',h.url('/'))}
7 /
8 ${h.link_to(u'Admin',h.url('admin_home'))}
6 ${h.link_to(u'Admin',h.url('admin_home'))}
9 /
7 /
10 ${h.link_to(u'Users managment',h.url('users'))}
8 ${h.link_to(u'Users managment',h.url('users'))}
11 </%def>
9 </%def>
12 <%def name="page_nav()">
10 <%def name="page_nav()">
13 <ul class="page-nav">
11 <ul class="page-nav">
14 <li>${h.link_to(u'Home',h.url('/'))}</li>
12 <li>${h.link_to(u'Home',h.url('/'))}</li>
15 <li class="current">${_('Admin')}</li>
13 <li class="current">${_('Admin')}</li>
16 </ul>
14 </ul>
17 </%def>
15 </%def>
18 <%def name="main()">
16 <%def name="main()">
19 <ul class="submenu">
17 <ul class="submenu">
20 <li>
18 <li>
21 ${h.link_to(u'Repos',h.url('repos'))}
19 ${h.link_to(u'Repos',h.url('repos'))}
22 </li>
20 </li>
23 <li>
21 <li>
24 ${h.link_to(u'Users',h.url('users'), class_="current_submenu")}
22 ${h.link_to(u'Users',h.url('users'), class_="current_submenu")}
25 </li>
23 </li>
26 </ul>
24 </ul>
27 <div>
25 <div>
28 <h2>${_('Mercurial users')}</h2>
26 <h2>${_('Mercurial users')}</h2>
29 <table>
27 <table>
30 <tr>
28 <tr>
31 <th>Id</th>
29 <th>Id</th>
32 <th>Username</th>
30 <th>Username</th>
33 <th>Active</th>
31 <th>Active</th>
34 <th>Admin</th>
32 <th>Admin</th>
35 <th>Action</th>
33 <th>Action</th>
36 </tr>
34 </tr>
37 %for user in c.users_list:
35 %for user in c.users_list:
38 <tr>
36 <tr>
39 <td>${user.user_id}</td>
37 <td>${user.user_id}</td>
40 <td>${h.link_to(user.username,h.url('edit_user', id=user.user_id))}</td>
38 <td>${h.link_to(user.username,h.url('edit_user', id=user.user_id))}</td>
41 <td>${user.active}</td>
39 <td>${user.active}</td>
42 <td>${user.admin}</td>
40 <td>${user.admin}</td>
43 <td>
41 <td>
44 ${h.form(url('user', id=user.user_id),method='delete')}
42 ${h.form(url('user', id=user.user_id),method='delete')}
45 ${h.submit('remove','remove',class_="submit")}
43 ${h.submit('remove','remove',class_="submit")}
46 ${h.end_form()}
44 ${h.end_form()}
47 </td>
45 </td>
48 </tr>
46 </tr>
49 %endfor
47 %endfor
50 </table>
48 </table>
51 <h3>${h.link_to(u'Add user',h.url('new_user'))}</h3>
49 <h3>${h.link_to(u'Add user',h.url('new_user'))}</h3>
52 </div>
50 </div>
53
51
54 </%def> No newline at end of file
52 </%def>
General Comments 0
You need to be logged in to leave comments. Login now