Show More
@@ -1,103 +1,103 b'' | |||||
1 | from pylons_app.model.meta import Base |
|
1 | from pylons_app.model.meta import Base | |
2 | from sqlalchemy.orm import relation, backref |
|
2 | from sqlalchemy.orm import relation, backref | |
3 | from sqlalchemy import * |
|
3 | from sqlalchemy import * | |
4 | from vcs.utils.lazy import LazyProperty |
|
4 | from vcs.utils.lazy import LazyProperty | |
5 |
|
5 | |||
6 | class HgAppSettings(Base): |
|
6 | class HgAppSettings(Base): | |
7 | __tablename__ = 'hg_app_settings' |
|
7 | __tablename__ = 'hg_app_settings' | |
8 | __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True}) |
|
8 | __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True}) | |
9 | app_settings_id = Column("app_settings_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
9 | app_settings_id = Column("app_settings_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
10 | app_settings_name = Column("app_settings_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
10 | app_settings_name = Column("app_settings_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
11 | app_settings_value = Column("app_settings_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
11 | app_settings_value = Column("app_settings_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
12 |
|
12 | |||
13 | class HgAppUi(Base): |
|
13 | class HgAppUi(Base): | |
14 | __tablename__ = 'hg_app_ui' |
|
14 | __tablename__ = 'hg_app_ui' | |
15 | __table_args__ = {'useexisting':True} |
|
15 | __table_args__ = {'useexisting':True} | |
16 | ui_id = Column("ui_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
16 | ui_id = Column("ui_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
17 | ui_section = Column("ui_section", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
17 | ui_section = Column("ui_section", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
18 | ui_key = Column("ui_key", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
18 | ui_key = Column("ui_key", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
19 | ui_value = Column("ui_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
19 | ui_value = Column("ui_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
20 | ui_active = Column("ui_active", BOOLEAN(), nullable=True, unique=None, default=True) |
|
20 | ui_active = Column("ui_active", BOOLEAN(), nullable=True, unique=None, default=True) | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | class User(Base): |
|
23 | class User(Base): | |
24 | __tablename__ = 'users' |
|
24 | __tablename__ = 'users' | |
25 | __table_args__ = {'useexisting':True} |
|
25 | __table_args__ = {'useexisting':True} | |
26 | user_id = Column("user_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
26 | user_id = Column("user_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
27 | username = Column("username", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
27 | username = Column("username", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
28 | password = Column("password", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
28 | password = Column("password", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
29 | active = Column("active", BOOLEAN(), nullable=True, unique=None, default=None) |
|
29 | active = Column("active", BOOLEAN(), nullable=True, unique=None, default=None) | |
30 | admin = Column("admin", BOOLEAN(), nullable=True, unique=None, default=False) |
|
30 | admin = Column("admin", BOOLEAN(), nullable=True, unique=None, default=False) | |
31 | name = Column("name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
31 | name = Column("name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
32 | lastname = Column("lastname", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
32 | lastname = Column("lastname", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
33 | email = Column("email", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
33 | email = Column("email", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
34 | last_login = Column("last_login", DATETIME(timezone=False), nullable=True, unique=None, default=None) |
|
34 | last_login = Column("last_login", DATETIME(timezone=False), nullable=True, unique=None, default=None) | |
35 |
|
35 | |||
36 | user_log = relation('UserLog') |
|
36 | user_log = relation('UserLog') | |
37 |
|
37 | |||
38 | @LazyProperty |
|
38 | @LazyProperty | |
39 | def full_contact(self): |
|
39 | def full_contact(self): | |
40 | return '%s %s <%s>' % (self.name, self.lastname, self.email) |
|
40 | return '%s %s <%s>' % (self.name, self.lastname, self.email) | |
41 |
|
41 | |||
42 | def __repr__(self): |
|
42 | def __repr__(self): | |
43 | return "<User('%s:%s')>" % (self.user_id, self.username) |
|
43 | return "<User('%s:%s')>" % (self.user_id, self.username) | |
44 |
|
44 | |||
45 | class UserLog(Base): |
|
45 | class UserLog(Base): | |
46 | __tablename__ = 'user_logs' |
|
46 | __tablename__ = 'user_logs' | |
47 | __table_args__ = {'useexisting':True} |
|
47 | __table_args__ = {'useexisting':True} | |
48 | user_log_id = Column("user_log_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
48 | user_log_id = Column("user_log_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
49 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) |
|
49 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) | |
50 | user_ip = Column("user_ip", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
50 | user_ip = Column("user_ip", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
51 | repository = Column("repository", TEXT(length=None, convert_unicode=False, assert_unicode=None), ForeignKey(u'repositories.repo_name'), nullable=False, unique=None, default=None) |
|
51 | repository = Column("repository", TEXT(length=None, convert_unicode=False, assert_unicode=None), ForeignKey(u'repositories.repo_name'), nullable=False, unique=None, default=None) | |
52 | action = Column("action", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
52 | action = Column("action", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
53 | action_date = Column("action_date", DATETIME(timezone=False), nullable=True, unique=None, default=None) |
|
53 | action_date = Column("action_date", DATETIME(timezone=False), nullable=True, unique=None, default=None) | |
54 |
|
54 | |||
55 | user = relation('User') |
|
55 | user = relation('User') | |
56 |
|
56 | |||
57 | class Repository(Base): |
|
57 | class Repository(Base): | |
58 | __tablename__ = 'repositories' |
|
58 | __tablename__ = 'repositories' | |
59 | __table_args__ = (UniqueConstraint('repo_name'), {'useexisting':True},) |
|
59 | __table_args__ = (UniqueConstraint('repo_name'), {'useexisting':True},) | |
60 | repo_id = Column("repo_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
60 | repo_id = Column("repo_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
61 | repo_name = Column("repo_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=True, default=None) |
|
61 | repo_name = Column("repo_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=True, default=None) | |
62 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=False, default=None) |
|
62 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=False, default=None) | |
63 | private = Column("private", BOOLEAN(), nullable=True, unique=None, default=None) |
|
63 | private = Column("private", BOOLEAN(), nullable=True, unique=None, default=None) | |
64 | description = Column("description", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
64 | description = Column("description", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
65 |
|
65 | |||
66 | user = relation('User') |
|
66 | user = relation('User') | |
67 | repo_to_perm = relation('RepoToPerm', cascade='all') |
|
67 | repo_to_perm = relation('RepoToPerm', cascade='all') | |
68 |
|
68 | |||
69 | class Permission(Base): |
|
69 | class Permission(Base): | |
70 | __tablename__ = 'permissions' |
|
70 | __tablename__ = 'permissions' | |
71 | __table_args__ = {'useexisting':True} |
|
71 | __table_args__ = {'useexisting':True} | |
72 | permission_id = Column("permission_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
72 | permission_id = Column("permission_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
73 | permission_name = Column("permission_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
73 | permission_name = Column("permission_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
74 | permission_longname = Column("permission_longname", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
74 | permission_longname = Column("permission_longname", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
75 |
|
75 | |||
76 | def __repr__(self): |
|
76 | def __repr__(self): | |
77 | return "<Permission('%s:%s')>" % (self.permission_id, self.permission_name) |
|
77 | return "<Permission('%s:%s')>" % (self.permission_id, self.permission_name) | |
78 |
|
78 | |||
79 | class RepoToPerm(Base): |
|
79 | class RepoToPerm(Base): | |
80 | __tablename__ = 'repo_to_perm' |
|
80 | __tablename__ = 'repo_to_perm' | |
81 | __table_args__ = (UniqueConstraint('user_id', 'repository_id'), {'useexisting':True}) |
|
81 | __table_args__ = (UniqueConstraint('user_id', 'repository_id'), {'useexisting':True}) | |
82 | repo_to_perm_id = Column("repo_to_perm_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
82 | repo_to_perm_id = Column("repo_to_perm_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
83 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) |
|
83 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) | |
84 | permission_id = Column("permission_id", INTEGER(), ForeignKey(u'permissions.permission_id'), nullable=False, unique=None, default=None) |
|
84 | permission_id = Column("permission_id", INTEGER(), ForeignKey(u'permissions.permission_id'), nullable=False, unique=None, default=None) | |
85 | repository_id = Column("repository_id", INTEGER(), ForeignKey(u'repositories.repo_id'), nullable=False, unique=None, default=None) |
|
85 | repository_id = Column("repository_id", INTEGER(), ForeignKey(u'repositories.repo_id'), nullable=False, unique=None, default=None) | |
86 |
|
86 | |||
87 | user = relation('User') |
|
87 | user = relation('User') | |
88 | permission = relation('Permission') |
|
88 | permission = relation('Permission') | |
89 | repository = relation('Repository') |
|
89 | repository = relation('Repository') | |
90 |
|
90 | |||
91 | class UserToPerm(Base): |
|
91 | class UserToPerm(Base): | |
92 | __tablename__ = 'user_to_perm' |
|
92 | __tablename__ = 'user_to_perm' | |
93 | __table_args__ = {'useexisting':True} |
|
93 | __table_args__ = (UniqueConstraint('user_id', 'permission_id'), {'useexisting':True}) | |
94 | user_to_perm_id = Column("user_to_perm_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
94 | user_to_perm_id = Column("user_to_perm_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
95 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) |
|
95 | user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) | |
96 | permission_id = Column("permission_id", INTEGER(), ForeignKey(u'permissions.permission_id'), nullable=False, unique=None, default=None) |
|
96 | permission_id = Column("permission_id", INTEGER(), ForeignKey(u'permissions.permission_id'), nullable=False, unique=None, default=None) | |
97 |
|
97 | |||
98 | user = relation('User') |
|
98 | user = relation('User') | |
99 | permission = relation('Permission') |
|
99 | permission = relation('Permission') | |
100 |
|
100 | |||
101 |
|
101 | |||
102 |
|
102 | |||
103 |
|
103 |
@@ -1,255 +1,255 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
3 | <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml"> |
|
3 | <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml"> | |
4 | <head> |
|
4 | <head> | |
5 | <title>${next.title()}</title> |
|
5 | <title>${next.title()}</title> | |
6 | <link rel="icon" href="/images/hgicon.png" type="image/png" /> |
|
6 | <link rel="icon" href="/images/hgicon.png" type="image/png" /> | |
7 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
|
7 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
8 | <meta name="robots" content="index, nofollow"/> |
|
8 | <meta name="robots" content="index, nofollow"/> | |
9 | <!-- stylesheets --> |
|
9 | <!-- stylesheets --> | |
10 | ${self.css()} |
|
10 | ${self.css()} | |
11 | <!-- scripts --> |
|
11 | <!-- scripts --> | |
12 | ${self.js()} |
|
12 | ${self.js()} | |
13 | </head> |
|
13 | </head> | |
14 | <body> |
|
14 | <body> | |
15 | <!-- header --> |
|
15 | <!-- header --> | |
16 | <div id="header"> |
|
16 | <div id="header"> | |
17 | <!-- user --> |
|
17 | <!-- user --> | |
18 | <ul id="logged-user"> |
|
18 | <ul id="logged-user"> | |
19 | <li class="first"> |
|
19 | <li class="first"> | |
20 | <div class="gravatar"> |
|
20 | <div class="gravatar"> | |
21 | <img alt="gravatar" src="${h.gravatar_url(c.hg_app_user.email,24)}" /> |
|
21 | <img alt="gravatar" src="${h.gravatar_url(c.hg_app_user.email,24)}" /> | |
22 | </div> |
|
22 | </div> | |
23 | <div class="account"> |
|
23 | <div class="account"> | |
24 | ${h.link_to('%s %s'%(c.hg_app_user.name,c.hg_app_user.lastname),h.url('admin_settings_my_account'))}<br/> |
|
24 | ${h.link_to('%s %s'%(c.hg_app_user.name,c.hg_app_user.lastname),h.url('admin_settings_my_account'))}<br/> | |
25 | ${h.link_to(c.hg_app_user.username,h.url('admin_settings_my_account'))} |
|
25 | ${h.link_to(c.hg_app_user.username,h.url('admin_settings_my_account'))} | |
26 | </div> |
|
26 | </div> | |
27 | </li> |
|
27 | </li> | |
28 | <li class="last highlight">${h.link_to(u'Logout',h.url('logout_home'))}</li> |
|
28 | <li class="last highlight">${h.link_to(u'Logout',h.url('logout_home'))}</li> | |
29 | </ul> |
|
29 | </ul> | |
30 | <!-- end user --> |
|
30 | <!-- end user --> | |
31 | <div id="header-inner"> |
|
31 | <div id="header-inner"> | |
32 | <div id="home"> |
|
32 | <div id="home"> | |
33 | <a href="${h.url('hg_home')}"></a> |
|
33 | <a href="${h.url('hg_home')}"></a> | |
34 | </div> |
|
34 | </div> | |
35 | <!-- logo --> |
|
35 | <!-- logo --> | |
36 | <div id="logo"> |
|
36 | <div id="logo"> | |
37 | <h1><a href="${h.url('hg_home')}">${c.hg_app_name}</a></h1> |
|
37 | <h1><a href="${h.url('hg_home')}">${c.hg_app_name}</a></h1> | |
38 | </div> |
|
38 | </div> | |
39 | <!-- end logo --> |
|
39 | <!-- end logo --> | |
40 | <!-- quick menu --> |
|
40 | <!-- quick menu --> | |
41 | ${self.page_nav()} |
|
41 | ${self.page_nav()} | |
42 | <!-- end quick --> |
|
42 | <!-- end quick --> | |
43 | <div class="corner tl"></div> |
|
43 | <div class="corner tl"></div> | |
44 | <div class="corner tr"></div> |
|
44 | <div class="corner tr"></div> | |
45 | </div> |
|
45 | </div> | |
46 | </div> |
|
46 | </div> | |
47 | <!-- end header --> |
|
47 | <!-- end header --> | |
48 |
|
48 | |||
49 | <!-- CONTENT --> |
|
49 | <!-- CONTENT --> | |
50 | <div id="content"> |
|
50 | <div id="content"> | |
51 | <div class="flash_msg"> |
|
51 | <div class="flash_msg"> | |
52 | <% messages = h.flash.pop_messages() %> |
|
52 | <% messages = h.flash.pop_messages() %> | |
53 | % if messages: |
|
53 | % if messages: | |
54 | <ul id="flash-messages"> |
|
54 | <ul id="flash-messages"> | |
55 | % for message in messages: |
|
55 | % for message in messages: | |
56 | <li class="${message.category}_msg">${message}</li> |
|
56 | <li class="${message.category}_msg">${message}</li> | |
57 | % endfor |
|
57 | % endfor | |
58 | </ul> |
|
58 | </ul> | |
59 | % endif |
|
59 | % endif | |
60 | </div> |
|
60 | </div> | |
61 | <div id="main"> |
|
61 | <div id="main"> | |
62 | ${next.main()} |
|
62 | ${next.main()} | |
63 | </div> |
|
63 | </div> | |
64 | </div> |
|
64 | </div> | |
65 | <!-- END CONTENT --> |
|
65 | <!-- END CONTENT --> | |
66 |
|
66 | |||
67 | <!-- footer --> |
|
67 | <!-- footer --> | |
68 | <div id="footer"> |
|
68 | <div id="footer"> | |
69 | <p>Hg App ${c.hg_app_version} © 2010 by Marcin Kuzminski</p> |
|
69 | <p>Hg App ${c.hg_app_version} © 2010 by Marcin Kuzminski</p> | |
70 | <script type="text/javascript">${h.tooltip.activate()}</script> |
|
70 | <script type="text/javascript">${h.tooltip.activate()}</script> | |
71 | </div> |
|
71 | </div> | |
72 | <!-- end footer --> |
|
72 | <!-- end footer --> | |
73 | </body> |
|
73 | </body> | |
74 |
|
74 | |||
75 | </html> |
|
75 | </html> | |
76 |
|
76 | |||
77 | ### MAKO DEFS ### |
|
77 | ### MAKO DEFS ### | |
78 | <%def name="page_nav()"> |
|
78 | <%def name="page_nav()"> | |
79 | ${self.menu()} |
|
79 | ${self.menu()} | |
80 | </%def> |
|
80 | </%def> | |
81 |
|
81 | |||
82 | <%def name="menu(current=None)"> |
|
82 | <%def name="menu(current=None)"> | |
83 | <% |
|
83 | <% | |
84 | def is_current(selected): |
|
84 | def is_current(selected): | |
85 | if selected == current: |
|
85 | if selected == current: | |
86 |
return |
|
86 | return h.literal('class="current"') | |
87 | %> |
|
87 | %> | |
88 | %if current not in ['home','admin']: |
|
88 | %if current not in ['home','admin']: | |
89 | <script type="text/javascript"> |
|
89 | <script type="text/javascript"> | |
90 | YAHOO.util.Event.onDOMReady(function(){ |
|
90 | YAHOO.util.Event.onDOMReady(function(){ | |
91 | YAHOO.util.Event.addListener('repo_switcher','click',function(){ |
|
91 | YAHOO.util.Event.addListener('repo_switcher','click',function(){ | |
92 | if(YAHOO.util.Dom.hasClass('repo_switcher','selected')){ |
|
92 | if(YAHOO.util.Dom.hasClass('repo_switcher','selected')){ | |
93 | YAHOO.util.Dom.setStyle('switch_repos','display','none'); |
|
93 | YAHOO.util.Dom.setStyle('switch_repos','display','none'); | |
94 | YAHOO.util.Dom.setStyle('repo_switcher','background',''); |
|
94 | YAHOO.util.Dom.setStyle('repo_switcher','background',''); | |
95 | YAHOO.util.Dom.removeClass('repo_switcher','selected'); |
|
95 | YAHOO.util.Dom.removeClass('repo_switcher','selected'); | |
96 | YAHOO.util.Dom.get('repo_switcher').removeAttribute('style'); |
|
96 | YAHOO.util.Dom.get('repo_switcher').removeAttribute('style'); | |
97 | } |
|
97 | } | |
98 | else{ |
|
98 | else{ | |
99 | YAHOO.util.Dom.setStyle('switch_repos','display',''); |
|
99 | YAHOO.util.Dom.setStyle('switch_repos','display',''); | |
100 | YAHOO.util.Dom.addClass('repo_switcher','selected'); |
|
100 | YAHOO.util.Dom.addClass('repo_switcher','selected'); | |
101 | } |
|
101 | } | |
102 | }); |
|
102 | }); | |
103 | YAHOO.util.Event.addListener('repos_list','change',function(e){ |
|
103 | YAHOO.util.Event.addListener('repos_list','change',function(e){ | |
104 | var wa = YAHOO.util.Dom.get('repos_list').value; |
|
104 | var wa = YAHOO.util.Dom.get('repos_list').value; | |
105 |
|
105 | |||
106 | var url = "${h.url('summary_home',repo_name='__REPO__')}".replace('__REPO__',wa); |
|
106 | var url = "${h.url('summary_home',repo_name='__REPO__')}".replace('__REPO__',wa); | |
107 | window.location = url; |
|
107 | window.location = url; | |
108 | }) |
|
108 | }) | |
109 | }); |
|
109 | }); | |
110 | </script> |
|
110 | </script> | |
111 |
|
111 | |||
112 | ##REGULAR MENU |
|
112 | ##REGULAR MENU | |
113 | <ul id="quick"> |
|
113 | <ul id="quick"> | |
114 | <!-- repo switcher --> |
|
114 | <!-- repo switcher --> | |
115 | <li> |
|
115 | <li> | |
116 | <a id="repo_switcher" title="${_('Switch repository')}" href="#"> |
|
116 | <a id="repo_switcher" title="${_('Switch repository')}" href="#"> | |
117 | <span class="icon"> |
|
117 | <span class="icon"> | |
118 | <img src="/images/icons/database.png" alt="${_('Products')}" /> |
|
118 | <img src="/images/icons/database.png" alt="${_('Products')}" /> | |
119 | </span> |
|
119 | </span> | |
120 | <span>↓</span> |
|
120 | <span>↓</span> | |
121 | </a> |
|
121 | </a> | |
122 | <div id="switch_repos" style="display:none;"> |
|
122 | <div id="switch_repos" style="display:none;"> | |
123 | <select id="repos_list" size="10"> |
|
123 | <select id="repos_list" size="10"> | |
124 | %for repo in c.repo_switcher_list: |
|
124 | %for repo in c.repo_switcher_list: | |
125 | <option value="${repo}">${repo}</option> |
|
125 | <option value="${repo}">${repo}</option> | |
126 | %endfor |
|
126 | %endfor | |
127 | </select> |
|
127 | </select> | |
128 | </div> |
|
128 | </div> | |
129 | </li> |
|
129 | </li> | |
130 |
|
130 | |||
131 | <li ${is_current('summary')}> |
|
131 | <li ${is_current('summary')}> | |
132 | <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}"> |
|
132 | <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}"> | |
133 | <span class="icon"> |
|
133 | <span class="icon"> | |
134 | <img src="/images/icons/clipboard_16.png" alt="${_('Summary')}" /> |
|
134 | <img src="/images/icons/clipboard_16.png" alt="${_('Summary')}" /> | |
135 | </span> |
|
135 | </span> | |
136 | <span>${_('Summary')}</span> |
|
136 | <span>${_('Summary')}</span> | |
137 | </a> |
|
137 | </a> | |
138 | </li> |
|
138 | </li> | |
139 | <li ${is_current('shortlog')}> |
|
139 | <li ${is_current('shortlog')}> | |
140 | <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}"> |
|
140 | <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}"> | |
141 | <span class="icon"> |
|
141 | <span class="icon"> | |
142 | <img src="/images/icons/application_double.png" alt="${_('Shortlog')}" /> |
|
142 | <img src="/images/icons/application_double.png" alt="${_('Shortlog')}" /> | |
143 | </span> |
|
143 | </span> | |
144 | <span>${_('Shortlog')}</span> |
|
144 | <span>${_('Shortlog')}</span> | |
145 | </a> |
|
145 | </a> | |
146 | </li> |
|
146 | </li> | |
147 | <li ${is_current('changelog')}> |
|
147 | <li ${is_current('changelog')}> | |
148 | <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}"> |
|
148 | <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}"> | |
149 | <span class="icon"> |
|
149 | <span class="icon"> | |
150 | <img src="/images/icons/time.png" alt="${_('Changelog')}" /> |
|
150 | <img src="/images/icons/time.png" alt="${_('Changelog')}" /> | |
151 | </span> |
|
151 | </span> | |
152 | <span>${_('Changelog')}</span> |
|
152 | <span>${_('Changelog')}</span> | |
153 | </a> |
|
153 | </a> | |
154 | </li> |
|
154 | </li> | |
155 | <li ${is_current('branches')}> |
|
155 | <li ${is_current('branches')}> | |
156 | <a title="${_('Branches')}" href="${h.url('branches_home',repo_name=c.repo_name)}"> |
|
156 | <a title="${_('Branches')}" href="${h.url('branches_home',repo_name=c.repo_name)}"> | |
157 | <span class="icon"> |
|
157 | <span class="icon"> | |
158 | <img src="/images/icons/arrow_branch.png" alt="${_('Branches')}" /> |
|
158 | <img src="/images/icons/arrow_branch.png" alt="${_('Branches')}" /> | |
159 | </span> |
|
159 | </span> | |
160 | <span>${_('Branches')}</span> |
|
160 | <span>${_('Branches')}</span> | |
161 | </a> |
|
161 | </a> | |
162 | </li> |
|
162 | </li> | |
163 | <li ${is_current('tags')}> |
|
163 | <li ${is_current('tags')}> | |
164 | <a title="${_('Tags')}" href="${h.url('tags_home',repo_name=c.repo_name)}"> |
|
164 | <a title="${_('Tags')}" href="${h.url('tags_home',repo_name=c.repo_name)}"> | |
165 | <span class="icon"> |
|
165 | <span class="icon"> | |
166 | <img src="/images/icons/tag_blue.png" alt="${_('Tags')}" /> |
|
166 | <img src="/images/icons/tag_blue.png" alt="${_('Tags')}" /> | |
167 | </span> |
|
167 | </span> | |
168 | <span>${_('Tags')}</span> |
|
168 | <span>${_('Tags')}</span> | |
169 | </a> |
|
169 | </a> | |
170 | </li> |
|
170 | </li> | |
171 | <li ${is_current('files')}> |
|
171 | <li ${is_current('files')}> | |
172 | <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}"> |
|
172 | <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}"> | |
173 | <span class="icon"> |
|
173 | <span class="icon"> | |
174 | <img src="/images/icons/file.png" alt="${_('Files')}" /> |
|
174 | <img src="/images/icons/file.png" alt="${_('Files')}" /> | |
175 | </span> |
|
175 | </span> | |
176 | <span>${_('Files')}</span> |
|
176 | <span>${_('Files')}</span> | |
177 | </a> |
|
177 | </a> | |
178 | </li> |
|
178 | </li> | |
179 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): |
|
179 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
180 | <li ${is_current('settings')}> |
|
180 | <li ${is_current('settings')}> | |
181 | <a title="${_('Settings')}" href="${h.url('repo_settings_home',repo_name=c.repo_name)}"> |
|
181 | <a title="${_('Settings')}" href="${h.url('repo_settings_home',repo_name=c.repo_name)}"> | |
182 | <span class="icon"> |
|
182 | <span class="icon"> | |
183 | <img src="/images/icons/cog_edit.png" alt="${_('Settings')}" /> |
|
183 | <img src="/images/icons/cog_edit.png" alt="${_('Settings')}" /> | |
184 | </span> |
|
184 | </span> | |
185 | <span>${_('Settings')}</span> |
|
185 | <span>${_('Settings')}</span> | |
186 | </a> |
|
186 | </a> | |
187 | </li> |
|
187 | </li> | |
188 | %endif |
|
188 | %endif | |
189 | </ul> |
|
189 | </ul> | |
190 | %else: |
|
190 | %else: | |
191 | ##ROOT MENU |
|
191 | ##ROOT MENU | |
192 | <ul id="quick"> |
|
192 | <ul id="quick"> | |
193 | <li> |
|
193 | <li> | |
194 | <a title="${_('Home')}" href="${h.url('hg_home')}"> |
|
194 | <a title="${_('Home')}" href="${h.url('hg_home')}"> | |
195 | <span class="icon"> |
|
195 | <span class="icon"> | |
196 | <img src="/images/icons/home_16.png" alt="${_('Home')}" /> |
|
196 | <img src="/images/icons/home_16.png" alt="${_('Home')}" /> | |
197 | </span> |
|
197 | </span> | |
198 | <span>${_('Home')}</span> |
|
198 | <span>${_('Home')}</span> | |
199 | </a> |
|
199 | </a> | |
200 | </li> |
|
200 | </li> | |
201 |
|
201 | |||
202 | <li> |
|
202 | <li> | |
203 | <a title="${_('Search')}" href="${h.url('search')}"> |
|
203 | <a title="${_('Search')}" href="${h.url('search')}"> | |
204 | <span class="icon"> |
|
204 | <span class="icon"> | |
205 | <img src="/images/icons/search_16.png" alt="${_('Search')}" /> |
|
205 | <img src="/images/icons/search_16.png" alt="${_('Search')}" /> | |
206 | </span> |
|
206 | </span> | |
207 | <span>${_('Search')}</span> |
|
207 | <span>${_('Search')}</span> | |
208 | </a> |
|
208 | </a> | |
209 | </li> |
|
209 | </li> | |
210 |
|
210 | |||
211 | %if h.HasPermissionAll('hg.admin')('access admin main page'): |
|
211 | %if h.HasPermissionAll('hg.admin')('access admin main page'): | |
212 | <li ${is_current('admin')}> |
|
212 | <li ${is_current('admin')}> | |
213 | <a title="${_('Admin')}" href="${h.url('admin_home')}"> |
|
213 | <a title="${_('Admin')}" href="${h.url('admin_home')}"> | |
214 | <span class="icon"> |
|
214 | <span class="icon"> | |
215 | <img src="/images/icons/cog_edit.png" alt="${_('Admin')}" /> |
|
215 | <img src="/images/icons/cog_edit.png" alt="${_('Admin')}" /> | |
216 | </span> |
|
216 | </span> | |
217 | <span>${_('Admin')}</span> |
|
217 | <span>${_('Admin')}</span> | |
218 | </a> |
|
218 | </a> | |
219 | <ul> |
|
219 | <ul> | |
220 | <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> |
|
220 | <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | |
221 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> |
|
221 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | |
222 | <li>${h.link_to(_('permissions'),h.url('permissions'),class_='permissions')}</li> |
|
222 | <li>${h.link_to(_('permissions'),h.url('permissions'),class_='permissions')}</li> | |
223 | <li>${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> |
|
223 | <li>${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | |
224 | </ul> |
|
224 | </ul> | |
225 | </li> |
|
225 | </li> | |
226 | %endif |
|
226 | %endif | |
227 |
|
227 | |||
228 | </ul> |
|
228 | </ul> | |
229 | %endif |
|
229 | %endif | |
230 | </%def> |
|
230 | </%def> | |
231 |
|
231 | |||
232 |
|
232 | |||
233 | <%def name="css()"> |
|
233 | <%def name="css()"> | |
234 | <link rel="stylesheet" type="text/css" href="/css/reset.css" /> |
|
234 | <link rel="stylesheet" type="text/css" href="/css/reset.css" /> | |
235 | <link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" /> |
|
235 | <link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" /> | |
236 | <link rel="stylesheet" type="text/css" href="/css/style_full.css" /> |
|
236 | <link rel="stylesheet" type="text/css" href="/css/style_full.css" /> | |
237 | <link id="color" rel="stylesheet" type="text/css" href="/css/colors/blue.css" /> |
|
237 | <link id="color" rel="stylesheet" type="text/css" href="/css/colors/blue.css" /> | |
238 | <link rel="stylesheet" type="text/css" href="/css/pygments.css" /> |
|
238 | <link rel="stylesheet" type="text/css" href="/css/pygments.css" /> | |
239 | <link rel="stylesheet" type="text/css" href="/css/diff.css" /> |
|
239 | <link rel="stylesheet" type="text/css" href="/css/diff.css" /> | |
240 | </%def> |
|
240 | </%def> | |
241 |
|
241 | |||
242 | <%def name="js()"> |
|
242 | <%def name="js()"> | |
243 | <script type="text/javascript" src="/js/yui/utilities/utilities.js"></script> |
|
243 | <script type="text/javascript" src="/js/yui/utilities/utilities.js"></script> | |
244 | <!--[if IE]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]--> |
|
244 | <!--[if IE]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]--> | |
245 | <script type="text/javascript" src="/js/yui/container/container-min.js"></script> |
|
245 | <script type="text/javascript" src="/js/yui/container/container-min.js"></script> | |
246 | <script type="text/javascript" src="/js/yui/datasource/datasource-min.js"></script> |
|
246 | <script type="text/javascript" src="/js/yui/datasource/datasource-min.js"></script> | |
247 | <script type="text/javascript" src="/js/yui/autocomplete/autocomplete-min.js"></script> |
|
247 | <script type="text/javascript" src="/js/yui/autocomplete/autocomplete-min.js"></script> | |
248 | <script type="text/javascript" src="/js/yui.flot.js"></script> |
|
248 | <script type="text/javascript" src="/js/yui.flot.js"></script> | |
249 | </%def> |
|
249 | </%def> | |
250 |
|
250 | |||
251 | <%def name="breadcrumbs()"> |
|
251 | <%def name="breadcrumbs()"> | |
252 | <div class="breadcrumbs"> |
|
252 | <div class="breadcrumbs"> | |
253 | ${self.breadcrumbs_links()} |
|
253 | ${self.breadcrumbs_links()} | |
254 | </div> |
|
254 | </div> | |
255 | </%def> No newline at end of file |
|
255 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now