Mercurial > kallithea
annotate rhodecode/templates/journal/journal.html @ 3695:45df84d36b44 beta
Implemented preview for comments
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 06 Apr 2013 02:49:42 +0200 |
parents | 690a955ba785 |
children | 3563bb7b4b82 13241a4075e9 |
rev | line source |
---|---|
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
995
d14723711d17
fixes for journal, added paging now it's possible to view whole journal
Marcin Kuzminski <marcin@python-works.com>
parents:
994
diff
changeset
|
2 <%inherit file="/base/base.html"/> |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 <%def name="title()"> |
3582
1f334a68d057
improved title consistency
Marcin Kuzminski <marcin@python-works.com>
parents:
3295
diff
changeset
|
4 ${_('Journal')} · ${c.rhodecode_name} |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 </%def> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 <%def name="breadcrumbs()"> |
3070
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
7 <h5> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
8 <form id="filter_form"> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
9 <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('quick filter...')}"/> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
10 <span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
11 <input type='submit' value="${_('filter')}" class="ui-btn" style="padding:0px 2px 0px 2px;margin:0px"/> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
12 ${_('journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)} |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
13 </form> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
14 ${h.end_form()} |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
15 </h5> |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 </%def> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 <%def name="page_nav()"> |
3208
1ac47c961f70
Set current pages indication for search and journal
Marcin Kuzminski <marcin@python-works.com>
parents:
3197
diff
changeset
|
18 ${self.menu('journal')} |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 </%def> |
2413
6bef2a9f73e2
added discoverable rss/atom links in pages
Marcin Kuzminski <marcin@python-works.com>
parents:
2412
diff
changeset
|
20 <%def name="head_extra()"> |
6bef2a9f73e2
added discoverable rss/atom links in pages
Marcin Kuzminski <marcin@python-works.com>
parents:
2412
diff
changeset
|
21 <link href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" /> |
6bef2a9f73e2
added discoverable rss/atom links in pages
Marcin Kuzminski <marcin@python-works.com>
parents:
2412
diff
changeset
|
22 <link href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" /> |
6bef2a9f73e2
added discoverable rss/atom links in pages
Marcin Kuzminski <marcin@python-works.com>
parents:
2412
diff
changeset
|
23 </%def> |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 <%def name="main()"> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
25 |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 <div class="box box-left"> |
3197 | 27 <!-- box / title --> |
28 <div class="title"> | |
3070
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
29 ${self.breadcrumbs()} |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
30 <ul class="links"> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
31 <li> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
32 <span><a id="refresh" href="${h.url('journal')}"><img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/></a></span> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
33 </li> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
34 <li> |
3295
2e618376cef8
don't show rss links - atom is the present and the future
Mads Kiilerich <madski@unity3d.com>
parents:
3293
diff
changeset
|
35 <span><a href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('ATOM feed')}" alt="${_('ATOM feed')}" src="${h.url('/images/icons/rss_16.png')}"/></a></span> |
3070
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
36 </li> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
37 </ul> |
3197 | 38 </div> |
39 <div id="journal">${c.journal_data}</div> | |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 </div> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
41 <div class="box box-right"> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
42 <!-- box / title --> |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
43 |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
44 <div class="title"> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
45 <h5> |
3665
690a955ba785
use placeholders in qfilter, not the ugly JS logic
Marcin Kuzminski <marcin@python-works.com>
parents:
3582
diff
changeset
|
46 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/> |
690a955ba785
use placeholders in qfilter, not the ugly JS logic
Marcin Kuzminski <marcin@python-works.com>
parents:
3582
diff
changeset
|
47 <input class="q_filter_box" id="q_filter_watched" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/> |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
48 </h5> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
49 <ul class="links" style="color:#DADADA"> |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
50 <li> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
51 <span><a id="show_watched" class="link-white current" href="#watched">${_('Watched')}</a> </span> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
52 </li> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
53 <li> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
54 <span><a id="show_my" class="link-white" href="#my">${_('My repos')}</a> </span> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
55 </li> |
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
56 </ul> |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
57 </div> |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
58 |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
59 <!-- end box / title --> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
60 <div id="my_container" style="display:none"> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
61 <div class="table yui-skin-sam" id="repos_list_wrap"></div> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
62 <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
63 </div> |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
64 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
65 <div id="watched_container"> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
66 <div class="table yui-skin-sam" id="watched_repos_list_wrap"></div> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
67 <div id="watched-user-paginator" style="padding: 0px 0px 0px 20px"></div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
68 </div> |
1746
753aeb4a5c58
Journal refresh button
Marcin Kuzminski <marcin@python-works.com>
parents:
1741
diff
changeset
|
69 </div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
70 |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
71 <script type="text/javascript"> |
3149
68f9c216377d
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
72 |
3070
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
73 YUE.on('j_filter','click',function(){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
74 var jfilter = YUD.get('j_filter'); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
75 if(YUD.hasClass(jfilter, 'initial')){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
76 jfilter.value = ''; |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
77 } |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
78 }); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
79 var fix_j_filter_width = function(len){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
80 YUD.setStyle(YUD.get('j_filter'),'width',Math.max(80, len*6.50)+'px'); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
81 } |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
82 YUE.on('j_filter','keyup',function(){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
83 fix_j_filter_width(YUD.get('j_filter').value.length); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
84 }); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
85 YUE.on('filter_form','submit',function(e){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
86 YUE.preventDefault(e) |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
87 var val = YUD.get('j_filter').value; |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
88 window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
89 }); |
3149
68f9c216377d
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
90 fix_j_filter_width(YUD.get('j_filter').value.length); |
68f9c216377d
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
91 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
92 YUE.on('refresh','click',function(e){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
93 ypjax("${h.url.current(filter=c.search_term)}","journal",function(){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
94 show_more_event(); |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
95 tooltip_activate(); |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
96 show_changeset_tooltip(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
97 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
98 YUE.preventDefault(e); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
99 }); |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
100 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
101 var show_my = function(e){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
102 YUD.setStyle('watched_container','display','none'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
103 YUD.setStyle('my_container','display',''); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
104 YUD.setStyle('q_filter','display',''); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
105 YUD.setStyle('q_filter_watched','display','none'); |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
106 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
107 YUD.addClass('show_my', 'current'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
108 YUD.removeClass('show_watched','current'); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
109 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
110 if(!YUD.hasClass('show_my', 'loaded')){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
111 table_renderer(${c.data |n}); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
112 YUD.addClass('show_my', 'loaded'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
113 } |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
114 } |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
115 YUE.on('show_my','click',function(e){ |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
116 show_my(e); |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
117 }) |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
118 var show_watched = function(e){ |
3197 | 119 YUD.setStyle('my_container','display','none'); |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
120 YUD.setStyle('watched_container','display',''); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
121 YUD.setStyle('q_filter_watched','display',''); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
122 YUD.setStyle('q_filter','display','none'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
123 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
124 YUD.addClass('show_watched', 'current'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
125 YUD.removeClass('show_my','current'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
126 if(!YUD.hasClass('show_watched', 'loaded')){ |
3197 | 127 watched_renderer(${c.watched_data |n}); |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
128 YUD.addClass('show_watched', 'loaded'); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
129 } |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
130 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
131 return |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
132 var nodes = YUQ('#watched_container .watched_repo a'); |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
133 var target = 'q_filter'; |
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
134 var func = function(node){ |
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
135 return node.parentNode.parentNode; |
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
136 } |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
137 q_filter(target,nodes,func); |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
138 } |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
139 YUE.on('show_watched','click',function(e){ |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
140 show_watched(e); |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
141 }) |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
142 //init watched |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
143 show_watched(); |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
144 |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
145 var tabs = { |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
146 'watched': show_watched, |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
147 'my': show_my, |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
148 } |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
149 var url = location.href.split('#'); |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
150 if (url[1]) { |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
151 //We have a hash |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
152 var tabHash = url[1]; |
3120
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
153 var func = tabs[tabHash] |
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
154 if (func){ |
3197 | 155 func(); |
3120
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
156 } |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
157 } |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
158 function watched_renderer(data){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
159 var myDataSource = new YAHOO.util.DataSource(data); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
160 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
161 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
162 myDataSource.responseSchema = { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
163 resultsList: "records", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
164 fields: [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
165 {key:"menu"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
166 {key:"raw_name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
167 {key:"name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
168 {key:"last_changeset"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
169 {key:"action"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
170 ] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
171 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
172 myDataSource.doBeforeCallback = function(req,raw,res,cb) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
173 // This is the filter function |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
174 var data = res.results || [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
175 filtered = [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
176 i,l; |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
177 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
178 if (req) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
179 req = req.toLowerCase(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
180 for (i = 0; i<data.length; i++) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
181 var pos = data[i].raw_name.toLowerCase().indexOf(req) |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
182 if (pos != -1) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
183 filtered.push(data[i]); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
184 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
185 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
186 res.results = filtered; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
187 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
188 return res; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
189 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
190 // main table sorting |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
191 var myColumnDefs = [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
192 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
193 {key:"name",label:"${_('Name')}",sortable:true, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
194 sortOptions: { sortFunction: nameSort }}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
195 {key:"last_changeset",label:"${_('Tip')}",sortable:true, |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
196 sortOptions: { sortFunction: revisionSort }}, |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
197 {key:"action",label:"${_('Action')}",sortable:false}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
198 ]; |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
199 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
200 var myDataTable = new YAHOO.widget.DataTable("watched_repos_list_wrap", myColumnDefs, myDataSource,{ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
201 sortedBy:{key:"name",dir:"asc"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
202 paginator: new YAHOO.widget.Paginator({ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
203 rowsPerPage: 25, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
204 alwaysVisible: false, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
205 template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
206 pageLinks: 5, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
207 containerClass: 'pagination-wh', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
208 currentPageClass: 'pager_curpage', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
209 pageLinkClass: 'pager_link', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
210 nextPageLinkLabel: '>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
211 previousPageLinkLabel: '<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
212 firstPageLinkLabel: '<<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
213 lastPageLinkLabel: '>>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
214 containers:['watched-user-paginator'] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
215 }), |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
216 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
217 MSG_SORTASC:"${_('Click to sort ascending')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
218 MSG_SORTDESC:"${_('Click to sort descending')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
219 MSG_EMPTY:"${_('No records found.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
220 MSG_ERROR:"${_('Data error.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
221 MSG_LOADING:"${_('Loading...')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
222 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
223 ); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
224 myDataTable.subscribe('postRenderEvent',function(oArgs) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
225 tooltip_activate(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
226 quick_repo_menu(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
227 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
228 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
229 var filterTimeout = null; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
230 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
231 updateFilter = function () { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
232 // Reset timeout |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
233 filterTimeout = null; |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
234 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
235 // Reset sort |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
236 var state = myDataTable.getState(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
237 state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
238 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
239 // Get filtered data |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
240 myDataSource.sendRequest(YUD.get('q_filter_watched').value,{ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
241 success : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
242 failure : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
243 scope : myDataTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
244 argument: state |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
245 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
246 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
247 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
248 YUE.on('q_filter_watched','click',function(){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
249 if(!YUD.hasClass('q_filter_watched', 'loaded')){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
250 //TODO: load here full list later to do search within groups |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
251 YUD.addClass('q_filter_watched', 'loaded'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
252 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
253 }); |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
254 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
255 YUE.on('q_filter_watched','keyup',function (e) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
256 clearTimeout(filterTimeout); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
257 filterTimeout = setTimeout(updateFilter,600); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
258 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
259 } |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
260 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
261 function table_renderer(data){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
262 var myDataSource = new YAHOO.util.DataSource(data); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
263 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
264 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
265 myDataSource.responseSchema = { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
266 resultsList: "records", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
267 fields: [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
268 {key:"menu"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
269 {key:"raw_name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
270 {key:"name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
271 {key:"last_changeset"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
272 {key:"action"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
273 ] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
274 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
275 myDataSource.doBeforeCallback = function(req,raw,res,cb) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
276 // This is the filter function |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
277 var data = res.results || [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
278 filtered = [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
279 i,l; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
280 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
281 if (req) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
282 req = req.toLowerCase(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
283 for (i = 0; i<data.length; i++) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
284 var pos = data[i].raw_name.toLowerCase().indexOf(req) |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
285 if (pos != -1) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
286 filtered.push(data[i]); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
287 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
288 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
289 res.results = filtered; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
290 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
291 return res; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
292 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
293 // main table sorting |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
294 var myColumnDefs = [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
295 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
296 {key:"name",label:"${_('Name')}",sortable:true, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
297 sortOptions: { sortFunction: nameSort }}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
298 {key:"last_changeset",label:"${_('Tip')}",sortable:true, |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
299 sortOptions: { sortFunction: revisionSort }}, |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
300 {key:"action",label:"${_('Action')}",sortable:false}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
301 ]; |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
302 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
303 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
304 sortedBy:{key:"name",dir:"asc"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
305 paginator: new YAHOO.widget.Paginator({ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
306 rowsPerPage: 25, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
307 alwaysVisible: false, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
308 template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
309 pageLinks: 5, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
310 containerClass: 'pagination-wh', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
311 currentPageClass: 'pager_curpage', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
312 pageLinkClass: 'pager_link', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
313 nextPageLinkLabel: '>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
314 previousPageLinkLabel: '<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
315 firstPageLinkLabel: '<<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
316 lastPageLinkLabel: '>>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
317 containers:['user-paginator'] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
318 }), |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
319 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
320 MSG_SORTASC:"${_('Click to sort ascending')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
321 MSG_SORTDESC:"${_('Click to sort descending')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
322 MSG_EMPTY:"${_('No records found.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
323 MSG_ERROR:"${_('Data error.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
324 MSG_LOADING:"${_('Loading...')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
325 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
326 ); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
327 myDataTable.subscribe('postRenderEvent',function(oArgs) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
328 tooltip_activate(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
329 quick_repo_menu(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
330 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
331 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
332 var filterTimeout = null; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
333 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
334 updateFilter = function () { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
335 // Reset timeout |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
336 filterTimeout = null; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
337 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
338 // Reset sort |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
339 var state = myDataTable.getState(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
340 state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
341 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
342 // Get filtered data |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
343 myDataSource.sendRequest(YUD.get('q_filter').value,{ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
344 success : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
345 failure : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
346 scope : myDataTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
347 argument: state |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
348 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
349 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
350 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
351 YUE.on('q_filter','click',function(){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
352 if(!YUD.hasClass('q_filter', 'loaded')){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
353 //TODO: load here full list later to do search within groups |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
354 YUD.addClass('q_filter', 'loaded'); |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
355 } |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
356 }); |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
357 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
358 YUE.on('q_filter','keyup',function (e) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
359 clearTimeout(filterTimeout); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
360 filterTimeout = setTimeout(updateFilter,600); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
361 }); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
362 } |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
363 |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
364 </script> |
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
365 </%def> |