allura
修訂 | 3d3a34826219d73b3e8dd89995f42632b83f5218 (tree) |
---|---|
時間 | 2012-07-03 22:38:05 |
作者 | Igor Bondarenko <jetmind2@gmai...> |
Commiter | Igor Bondarenko |
[#1937] ticket:98 Fix "link" link
@@ -309,6 +309,9 @@ class Post(HierWidget): | ||
309 | 309 | evt.preventDefault(); |
310 | 310 | popup.lightbox_me(); |
311 | 311 | $('input', popup).select(); |
312 | + $('input', popup).click(function() { | |
313 | + this.select(); | |
314 | + }); | |
312 | 315 | }); |
313 | 316 | $('.close', popup).bind('click', function() { |
314 | 317 | popup.hide(); |
@@ -1,5 +1,14 @@ | ||
1 | 1 | {% import 'allura:templates/jinja_master/lib.html' as lib with context %} |
2 | 2 | |
3 | +{% if page == 0 %} | |
4 | + {% set params = None %} | |
5 | +{% else %} | |
6 | + {% set params = dict(page=page, limit=limit) %} | |
7 | +{% endif %} | |
8 | +{% set shortlink_url = tg.url( | |
9 | + request.scheme + '://' + request.host + url.current(), params) | |
10 | + + '#' + value.slug %} | |
11 | + | |
3 | 12 | <div> |
4 | 13 | <div id="{{value.slug}}" class="discussion-post"> |
5 | 14 | <div class="row"> |
@@ -67,7 +76,7 @@ | ||
67 | 76 | <a href="" class="reply_post btn"><b data-icon="{{g.icons['reply'].char}}" class="ico {{g.icons['reply'].css}}"></b>Reply</a> |
68 | 77 | {% endif %} |
69 | 78 | <div style="clear:both"> |
70 | - <a href="{{tg.url(url.current(),dict(page=page,limit=limit))}}#{{value.slug}}" class="little_link shortlink"><span>Link</span></a><br/> | |
79 | + <a href="{{shortlink_url}}" class="little_link shortlink"><span>Link</span></a><br/> | |
71 | 80 | {% if c.user != c.user.anonymous() %}<a href="" class="edit_post little_link"><span>Edit</span></a><br/>{% endif %} |
72 | 81 | {% if h.has_access(value, 'moderate')() %} |
73 | 82 | {{widgets.moderate_post.display(value=value, action=value.url()+'moderate')}} |
@@ -81,8 +90,7 @@ | ||
81 | 90 | <div class="shortlink_popup modal" style="display: none"> |
82 | 91 | <b data-icon="{{g.icons['close'].char}}" class="ico {{g.icons['close'].css}} close"></b> |
83 | 92 | If you would like to refer to this comment somewhere else in this project, copy and paste the following link: |
84 | - <input type="text" style="width:100%" | |
85 | - value='{% filter forceescape %}<a href="{{tg.url(url.current(),dict(page=page,limit=limit))}}#{{value.slug}}">{{value.subject or "comment"}}</a>{% endfilter %}'> | |
93 | + <input type="text" style="width:100%" value="{{shortlink_url}}"> | |
86 | 94 | </div> |
87 | 95 | </div> |
88 | 96 | <ul> |