Show More
@@ -102,11 +102,9 b' class _ToolTip(object):' | |||||
102 | .replace('\n', '<br/>') |
|
102 | .replace('\n', '<br/>') | |
103 |
|
103 | |||
104 | def activate(self): |
|
104 | def activate(self): | |
105 | """ |
|
105 | """Adds tooltip mechanism to the given Html all tooltips have to have | |
106 | Adds tooltip mechanism to the given Html all tooltips have to have |
|
106 | set class `tooltip` and set attribute `tooltip_title`. | |
107 | set class tooltip and set attribute tooltip_title. |
|
107 | Then a tooltip will be generated based on that. All with yui js tooltip | |
108 | Then a tooltip will be generated based on that |
|
|||
109 | All with yui js tooltip |
|
|||
110 | """ |
|
108 | """ | |
111 |
|
109 | |||
112 | js = ''' |
|
110 | js = ''' | |
@@ -116,7 +114,7 b' class _ToolTip(object):' | |||||
116 | var tts = YAHOO.util.Dom.getElementsByClassName('tooltip'); |
|
114 | var tts = YAHOO.util.Dom.getElementsByClassName('tooltip'); | |
117 |
|
115 | |||
118 | for (var i = 0; i < tts.length; i++) { |
|
116 | for (var i = 0; i < tts.length; i++) { | |
119 | //if element doesn't not have and id autgenerate one for tooltip |
|
117 | //if element doesn't not have and id autogenerate one for tooltip | |
120 |
|
118 | |||
121 | if (!tts[i].id){ |
|
119 | if (!tts[i].id){ | |
122 | tts[i].id='tt'+i*100; |
|
120 | tts[i].id='tt'+i*100; | |
@@ -134,35 +132,15 b' class _ToolTip(object):' | |||||
134 | showdelay:20, |
|
132 | showdelay:20, | |
135 | }); |
|
133 | }); | |
136 |
|
134 | |||
137 | //Mouse Over event disabled for new repositories since they don't |
|
|||
138 | //have last commit message |
|
|||
139 | myToolTips.contextMouseOverEvent.subscribe( |
|
|||
140 | function(type, args) { |
|
|||
141 | var context = args[0]; |
|
|||
142 | var txt = context.getAttribute('tooltip_title'); |
|
|||
143 | if(txt){ |
|
|||
144 | return true; |
|
|||
145 | } |
|
|||
146 | else{ |
|
|||
147 | return false; |
|
|||
148 | } |
|
|||
149 | }); |
|
|||
150 |
|
||||
151 |
|
||||
152 | // Set the text for the tooltip just before we display it. Lazy method |
|
135 | // Set the text for the tooltip just before we display it. Lazy method | |
153 | myToolTips.contextTriggerEvent.subscribe( |
|
136 | myToolTips.contextTriggerEvent.subscribe( | |
154 | function(type, args) { |
|
137 | function(type, args) { | |
155 |
|
138 | |||
156 |
|
||||
157 | var context = args[0]; |
|
139 | var context = args[0]; | |
158 |
|
140 | |||
159 | var txt = context.getAttribute('tooltip_title'); |
|
141 | //positioning of tooltip | |
160 | this.cfg.setProperty("text", txt); |
|
142 | var tt_w = this.element.clientWidth;//tooltip width | |
161 |
|
143 | var tt_h = this.element.clientHeight;//tooltip height | ||
162 |
|
||||
163 | // positioning of tooltip |
|
|||
164 | var tt_w = this.element.clientWidth; |
|
|||
165 | var tt_h = this.element.clientHeight; |
|
|||
166 |
|
144 | |||
167 | var context_w = context.offsetWidth; |
|
145 | var context_w = context.offsetWidth; | |
168 | var context_h = context.offsetHeight; |
|
146 | var context_h = context.offsetHeight; | |
@@ -170,13 +148,13 b' class _ToolTip(object):' | |||||
170 | var pos_x = YAHOO.util.Dom.getX(context); |
|
148 | var pos_x = YAHOO.util.Dom.getX(context); | |
171 | var pos_y = YAHOO.util.Dom.getY(context); |
|
149 | var pos_y = YAHOO.util.Dom.getY(context); | |
172 |
|
150 | |||
173 |
var display_strategy = 't |
|
151 | var display_strategy = 'right'; | |
174 | var xy_pos = [0,0]; |
|
152 | var xy_pos = [0,0]; | |
175 | switch (display_strategy){ |
|
153 | switch (display_strategy){ | |
176 |
|
154 | |||
177 | case 'top': |
|
155 | case 'top': | |
178 | var cur_x = (pos_x+context_w/2)-(tt_w/2); |
|
156 | var cur_x = (pos_x+context_w/2)-(tt_w/2); | |
179 | var cur_y = pos_y-tt_h-4; |
|
157 | var cur_y = (pos_y-tt_h-4); | |
180 | xy_pos = [cur_x,cur_y]; |
|
158 | xy_pos = [cur_x,cur_y]; | |
181 | break; |
|
159 | break; | |
182 | case 'bottom': |
|
160 | case 'bottom': | |
@@ -303,7 +281,7 b' def pygmentize_annotation(filenode, **kw' | |||||
303 | revision=changeset.raw_id), |
|
281 | revision=changeset.raw_id), | |
304 | style=get_color_string(changeset.raw_id), |
|
282 | style=get_color_string(changeset.raw_id), | |
305 | class_='tooltip', |
|
283 | class_='tooltip', | |
306 |
|
|
284 | title=tooltip_html | |
307 | ) |
|
285 | ) | |
308 |
|
286 | |||
309 | uri += '\n' |
|
287 | uri += '\n' | |
@@ -428,7 +406,7 b' def action_parser(user_log):' | |||||
428 | cs_links = " " + ', '.join ([link_to(rev, |
|
406 | cs_links = " " + ', '.join ([link_to(rev, | |
429 | url('changeset_home', |
|
407 | url('changeset_home', | |
430 | repo_name=repo_name, |
|
408 | repo_name=repo_name, | |
431 |
revision=rev), |
|
409 | revision=rev), title=message(rev), | |
432 | class_='tooltip') for rev in revs[:revs_limit] ]) |
|
410 | class_='tooltip') for rev in revs[:revs_limit] ]) | |
433 | if len(revs) > revs_limit: |
|
411 | if len(revs) > revs_limit: | |
434 | uniq_id = revs[0] |
|
412 | uniq_id = revs[0] | |
@@ -443,7 +421,7 b' def action_parser(user_log):' | |||||
443 | cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev, |
|
421 | cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev, | |
444 | url('changeset_home', |
|
422 | url('changeset_home', | |
445 | repo_name=repo_name, revision=rev), |
|
423 | repo_name=repo_name, revision=rev), | |
446 |
|
|
424 | title=message(rev), class_='tooltip') | |
447 | for rev in revs[revs_limit:revs_top_limit]])) |
|
425 | for rev in revs[revs_limit:revs_top_limit]])) | |
448 |
|
426 | |||
449 | return cs_links |
|
427 | return cs_links |
@@ -46,7 +46,7 b'' | |||||
46 | ${h.checkbox('overwrite_default','true')} |
|
46 | ${h.checkbox('overwrite_default','true')} | |
47 | <label for="overwrite_default"> |
|
47 | <label for="overwrite_default"> | |
48 | <span class="tooltip" |
|
48 | <span class="tooltip" | |
49 |
|
|
49 | title="${h.tooltip(_('All default permissions on each repository will be reset to choosen permission, note that all custom default permission on repositories will be lost'))}"> | |
50 | ${_('overwrite existing settings')}</span> </label> |
|
50 | ${_('overwrite existing settings')}</span> </label> | |
51 | </div> |
|
51 | </div> | |
52 | </div> |
|
52 | </div> |
@@ -68,7 +68,7 b'' | |||||
68 | ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), |
|
68 | ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), | |
69 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), |
|
69 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), | |
70 | class_="tooltip", |
|
70 | class_="tooltip", | |
71 |
t |
|
71 | title=h.tooltip(repo['last_msg']))} | |
72 | %else: |
|
72 | %else: | |
73 | ${_('No changesets yet')} |
|
73 | ${_('No changesets yet')} | |
74 | %endif |
|
74 | %endif |
@@ -35,7 +35,7 b'' | |||||
35 | <div class="checkbox"> |
|
35 | <div class="checkbox"> | |
36 | ${h.checkbox('destroy',True)} |
|
36 | ${h.checkbox('destroy',True)} | |
37 | <label for="checkbox-1"> |
|
37 | <label for="checkbox-1"> | |
38 |
<span class="tooltip" |
|
38 | <span class="tooltip" title="${h.tooltip(_('In case a repository was deleted from filesystem and there are leftovers in the database check this option to scan obsolete data in database and remove it.'))}"> | |
39 | ${_('destroy old data')}</span> </label> |
|
39 | ${_('destroy old data')}</span> </label> | |
40 | </div> |
|
40 | </div> | |
41 | </div> |
|
41 | </div> | |
@@ -165,7 +165,7 b'' | |||||
165 | <div class="input"> |
|
165 | <div class="input"> | |
166 | ${h.text('paths_root_path',size=30,readonly="readonly")} |
|
166 | ${h.text('paths_root_path',size=30,readonly="readonly")} | |
167 | <span id="path_unlock" class="tooltip" |
|
167 | <span id="path_unlock" class="tooltip" | |
168 |
|
|
168 | title="${h.tooltip(_('This a crucial application setting. If You really sure you need to change this, you must restart application in order to make this settings take effect. Click this label to unlock.'))}"> | |
169 | ${_('unlock')}</span> |
|
169 | ${_('unlock')}</span> | |
170 | </div> |
|
170 | </div> | |
171 | </div> |
|
171 | </div> |
@@ -140,7 +140,7 b'' | |||||
140 | src="/images/icons/arrow_divide.png"/></a> |
|
140 | src="/images/icons/arrow_divide.png"/></a> | |
141 | %endif |
|
141 | %endif | |
142 | </td> |
|
142 | </td> | |
143 |
<td><span class="tooltip" |
|
143 | <td><span class="tooltip" title="${repo['repo'].last_change}">${("r%s:%s") % (h.get_changeset_safe(repo['repo'],'tip').revision,h.short_id(h.get_changeset_safe(repo['repo'],'tip').raw_id))}</span></td> | |
144 | <td><a href="${h.url('repo_settings_home',repo_name=repo['repo'].name)}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="/images/icons/application_form_edit.png"/></a></td> |
|
144 | <td><a href="${h.url('repo_settings_home',repo_name=repo['repo'].name)}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="/images/icons/application_form_edit.png"/></a></td> | |
145 | <td> |
|
145 | <td> | |
146 | ${h.form(url('repo_settings_delete', repo_name=repo['repo'].name),method='delete')} |
|
146 | ${h.form(url('repo_settings_delete', repo_name=repo['repo'].name),method='delete')} |
@@ -9,7 +9,7 b'' | |||||
9 | </tr> |
|
9 | </tr> | |
10 | %for cnt,branch in enumerate(c.repo_branches.items()): |
|
10 | %for cnt,branch in enumerate(c.repo_branches.items()): | |
11 | <tr class="parity${cnt%2}"> |
|
11 | <tr class="parity${cnt%2}"> | |
12 |
<td><span class="tooltip" |
|
12 | <td><span class="tooltip" title="${h.age(branch[1].date)}"> | |
13 | ${branch[1].date}</span> |
|
13 | ${branch[1].date}</span> | |
14 | </td> |
|
14 | </td> | |
15 | <td> |
|
15 | <td> |
@@ -71,9 +71,9 b'' | |||||
71 | return ': '+_('No Files') |
|
71 | return ': '+_('No Files') | |
72 | %> |
|
72 | %> | |
73 |
|
73 | |||
74 |
<span class="removed tooltip" |
|
74 | <span class="removed tooltip" title="${_('removed')}${h.literal(changed_tooltip(cs.removed))}">${len(cs.removed)}</span> | |
75 |
<span class="changed tooltip" |
|
75 | <span class="changed tooltip" title="${_('changed')}${h.literal(changed_tooltip(cs.changed))}">${len(cs.changed)}</span> | |
76 |
<span class="added tooltip" |
|
76 | <span class="added tooltip" title="${_('added')}${h.literal(changed_tooltip(cs.added))}">${len(cs.added)}</span> | |
77 | </div> |
|
77 | </div> | |
78 | %if len(cs.parents)>1: |
|
78 | %if len(cs.parents)>1: | |
79 | <div class="merge"> |
|
79 | <div class="merge"> |
@@ -78,13 +78,13 b'' | |||||
78 | </td> |
|
78 | </td> | |
79 | <td> |
|
79 | <td> | |
80 | %if node.is_file(): |
|
80 | %if node.is_file(): | |
81 |
<span class="tooltip" |
|
81 | <span class="tooltip" title="${node.last_changeset.raw_id}"> | |
82 | ${node.last_changeset.revision}</span> |
|
82 | ${node.last_changeset.revision}</span> | |
83 | %endif |
|
83 | %endif | |
84 | </td> |
|
84 | </td> | |
85 | <td> |
|
85 | <td> | |
86 | %if node.is_file(): |
|
86 | %if node.is_file(): | |
87 |
<span class="tooltip" |
|
87 | <span class="tooltip" title="${node.last_changeset.date}"> | |
88 | ${h.age(node.last_changeset.date)}</span> |
|
88 | ${h.age(node.last_changeset.date)}</span> | |
89 | %endif |
|
89 | %endif | |
90 | </td> |
|
90 | </td> |
@@ -87,12 +87,12 b'' | |||||
87 | </div> |
|
87 | </div> | |
88 | </td> |
|
88 | </td> | |
89 | ##DESCRIPTION |
|
89 | ##DESCRIPTION | |
90 |
<td><span class="tooltip" |
|
90 | <td><span class="tooltip" title="${repo['description']}"> | |
91 | ${h.truncate(repo['description'],60)}</span> |
|
91 | ${h.truncate(repo['description'],60)}</span> | |
92 | </td> |
|
92 | </td> | |
93 | ##LAST CHANGE |
|
93 | ##LAST CHANGE | |
94 | <td> |
|
94 | <td> | |
95 |
<span class="tooltip" |
|
95 | <span class="tooltip" title="${repo['last_change']}"> | |
96 | ${h.age(repo['last_change'])}</span> |
|
96 | ${h.age(repo['last_change'])}</span> | |
97 | </td> |
|
97 | </td> | |
98 | <td> |
|
98 | <td> | |
@@ -100,7 +100,7 b'' | |||||
100 | ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), |
|
100 | ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), | |
101 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), |
|
101 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), | |
102 | class_="tooltip", |
|
102 | class_="tooltip", | |
103 |
t |
|
103 | title=h.tooltip(repo['last_msg']))} | |
104 | %else: |
|
104 | %else: | |
105 | ${_('No changesets yet')} |
|
105 | ${_('No changesets yet')} | |
106 | %endif |
|
106 | %endif |
@@ -18,7 +18,7 b'' | |||||
18 | h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id), |
|
18 | h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id), | |
19 | title=cs.message)} |
|
19 | title=cs.message)} | |
20 | </td> |
|
20 | </td> | |
21 |
<td><span class="tooltip" |
|
21 | <td><span class="tooltip" title="${cs.date}"> | |
22 | ${h.age(cs.date)}</span> |
|
22 | ${h.age(cs.date)}</span> | |
23 | </td> |
|
23 | </td> | |
24 | <td title="${cs.author}">${h.person(cs.author)}</td> |
|
24 | <td title="${cs.author}">${h.person(cs.author)}</td> |
@@ -9,7 +9,7 b'' | |||||
9 | </tr> |
|
9 | </tr> | |
10 | %for cnt,tag in enumerate(c.repo_tags.items()): |
|
10 | %for cnt,tag in enumerate(c.repo_tags.items()): | |
11 | <tr class="parity${cnt%2}"> |
|
11 | <tr class="parity${cnt%2}"> | |
12 |
<td><span class="tooltip" |
|
12 | <td><span class="tooltip" title="${h.age(tag[1].date)}"> | |
13 | ${tag[1].date}</span> |
|
13 | ${tag[1].date}</span> | |
14 | </td> |
|
14 | </td> | |
15 | <td> |
|
15 | <td> |
@@ -9,9 +9,9 b' class TestChangelogController(TestContro' | |||||
9 | assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number of changes' |
|
9 | assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number of changes' | |
10 | assert """<div class="date">commit 154: 5e204e7583b9@2010-08-10 01:18:46</div>""" in response.body , 'no info on this commit' |
|
10 | assert """<div class="date">commit 154: 5e204e7583b9@2010-08-10 01:18:46</div>""" in response.body , 'no info on this commit' | |
11 | assert """Small update at simplevcs app""" in response.body, 'missing info about commit message' |
|
11 | assert """Small update at simplevcs app""" in response.body, 'missing info about commit message' | |
12 |
assert """<span class="removed tooltip" t |
|
12 | assert """<span class="removed tooltip" title="removed: No Files">0</span>""" in response.body, 'wrong info about removed nodes' | |
13 |
assert """<span class="changed tooltip" t |
|
13 | assert """<span class="changed tooltip" title="changed: vcs/backends/hg.py<br/> vcs/web/simplevcs/models.py">2</span>""" in response.body, 'wrong info about changed nodes' | |
14 |
assert """<span class="added tooltip" t |
|
14 | assert """<span class="added tooltip" title="added: vcs/web/simplevcs/managers.py">1</span>""" in response.body, 'wrong info about added nodes' | |
15 |
|
15 | |||
16 | #pagination |
|
16 | #pagination | |
17 |
|
17 | |||
@@ -24,9 +24,9 b' class TestChangelogController(TestContro' | |||||
24 |
|
24 | |||
25 | # Test response after pagination... |
|
25 | # Test response after pagination... | |
26 | assert """<div class="date">commit 64: 46ad32a4f974@2010-04-20 00:33:21</div>"""in response.body, 'wrong info about commit 64' |
|
26 | assert """<div class="date">commit 64: 46ad32a4f974@2010-04-20 00:33:21</div>"""in response.body, 'wrong info about commit 64' | |
27 |
assert """<span class="removed tooltip" t |
|
27 | assert """<span class="removed tooltip" title="removed: docs/api.rst">1</span>"""in response.body, 'wrong info about number of removed' | |
28 |
assert """<span class="changed tooltip" t |
|
28 | assert """<span class="changed tooltip" title="changed: .hgignore<br/> README.rst<br/> docs/conf.py<br/> docs/index.rst<br/> setup.py<br/> tests/test_hg.py<br/> tests/test_nodes.py<br/> vcs/__init__.py<br/> vcs/backends/__init__.py<br/> vcs/backends/base.py<br/> vcs/backends/hg.py<br/> vcs/nodes.py<br/> vcs/utils/__init__.py">13</span>"""in response.body, 'wrong info about number of changes' | |
29 |
assert """<span class="added tooltip" t |
|
29 | assert """<span class="added tooltip" title="added: docs/api/backends/hg.rst<br/> docs/api/backends/index.rst<br/> docs/api/index.rst<br/> docs/api/nodes.rst<br/> docs/api/web/index.rst<br/> docs/api/web/simplevcs.rst<br/> docs/installation.rst<br/> docs/quickstart.rst<br/> setup.cfg<br/> vcs/utils/baseui_config.py<br/> vcs/utils/web.py<br/> vcs/web/__init__.py<br/> vcs/web/exceptions.py<br/> vcs/web/simplevcs/__init__.py<br/> vcs/web/simplevcs/exceptions.py<br/> vcs/web/simplevcs/middleware.py<br/> vcs/web/simplevcs/models.py<br/> vcs/web/simplevcs/settings.py<br/> vcs/web/simplevcs/utils.py<br/> vcs/web/simplevcs/views.py">20</span>"""in response.body, 'wrong info about number of added' | |
30 | assert """<div class="message"><a href="/%s/changeset/46ad32a4f974e45472a898c6b0acb600320579b1">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>""" % HG_REPO in response.body, 'wrong info about commit 64 is a merge' |
|
30 | assert """<div class="message"><a href="/%s/changeset/46ad32a4f974e45472a898c6b0acb600320579b1">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>""" % HG_REPO in response.body, 'wrong info about commit 64 is a merge' | |
31 |
|
31 | |||
32 |
|
32 |
@@ -12,4 +12,4 b' class TestHomeController(TestController)' | |||||
12 |
|
12 | |||
13 | assert """<img class="icon" title="Mercurial repository" alt="Mercurial repository" src="/images/icons/hgicon.png"/>""" in response.body, 'wrong info about type of repositry' |
|
13 | assert """<img class="icon" title="Mercurial repository" alt="Mercurial repository" src="/images/icons/hgicon.png"/>""" in response.body, 'wrong info about type of repositry' | |
14 | assert """<img class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/>""" in response.body, 'wrong info about repository availabilty' |
|
14 | assert """<img class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/>""" in response.body, 'wrong info about repository availabilty' | |
15 |
assert """<a class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc" t |
|
15 | assert """<a class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc" title="merge">r173:27cd5cce30c9</a>""" in response.body, 'no info about tooltip' |
General Comments 0
You need to be logged in to leave comments.
Login now