Mercurial > kallithea
annotate rhodecode/templates/journal/journal.html @ 3169:a649599ad8b7 beta
added my gist script for another detailed installation instructions
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 18 Jan 2013 01:11:28 +0100 |
parents | 2fb94c52e20e |
children | cd50d1b5f35b b4f401524060 |
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()"> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 ${_('Journal')} - ${c.rhodecode_name} |
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()"> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 ${self.menu('home')} |
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"> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 <!-- box / title --> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
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> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
35 <span><a href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('RSS feed')}" alt="${_('RSS feed')}" src="${h.url('/images/icons/rss_16.png')}"/></a></span> |
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 <li> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
38 <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/atom.png')}"/></a></span> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
39 </li> |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
40 </ul> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
41 </div> |
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
|
42 <div id="journal">${c.journal_data}</div> |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
43 </div> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
44 <div class="box box-right"> |
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
45 <!-- box / title --> |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
46 |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
47 <div class="title"> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
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 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}" style="display: none"/> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
50 <input class="q_filter_box" id="q_filter_watched" size="15" type="text" name="filter" value="${_('quick filter...')}" style="display: none"/> |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
51 </h5> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
52 <ul class="links" style="color:#DADADA"> |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
53 <li> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
54 <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
|
55 </li> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
56 <li> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
57 <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
|
58 </li> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
59 %if h.HasPermissionAny('hg.admin','hg.create.repository')(): |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
60 <li> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
61 <span>${h.link_to(_('Add repo'),h.url('admin_settings_create_repository'))}</span> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
62 </li> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
63 %endif |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
64 </ul> |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
65 </div> |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
66 |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
67 <!-- end box / title --> |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
68 <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
|
69 <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
|
70 <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
|
71 </div> |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
72 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
73 <div id="watched_container"> |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
74 <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
|
75 <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
|
76 </div> |
1746
753aeb4a5c58
Journal refresh button
Marcin Kuzminski <marcin@python-works.com>
parents:
1741
diff
changeset
|
77 </div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
78 |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
79 <script type="text/javascript"> |
3149
68f9c216377d
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
80 |
3070
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
81 YUE.on('j_filter','click',function(){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
82 var jfilter = YUD.get('j_filter'); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
83 if(YUD.hasClass(jfilter, 'initial')){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
84 jfilter.value = ''; |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
85 } |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
86 }); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
87 var fix_j_filter_width = function(len){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
88 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
|
89 } |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
90 YUE.on('j_filter','keyup',function(){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
91 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
|
92 }); |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
93 YUE.on('filter_form','submit',function(e){ |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
94 YUE.preventDefault(e) |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
95 var val = YUD.get('j_filter').value; |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
96 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
|
97 }); |
3149
68f9c216377d
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
98 fix_j_filter_width(YUD.get('j_filter').value.length); |
68f9c216377d
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3120
diff
changeset
|
99 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
100 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
|
101 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
|
102 show_more_event(); |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
103 tooltip_activate(); |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
104 show_changeset_tooltip(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
105 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
106 YUE.preventDefault(e); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
107 }); |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
108 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
109 var show_my = function(e){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
110 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
|
111 YUD.setStyle('my_container','display',''); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
112 YUD.setStyle('q_filter','display',''); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
113 YUD.setStyle('q_filter_watched','display','none'); |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
114 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
115 YUD.addClass('show_my', 'current'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
116 YUD.removeClass('show_watched','current'); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
117 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
118 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
|
119 table_renderer(${c.data |n}); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
120 YUD.addClass('show_my', 'loaded'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
121 } |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
122 } |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
123 YUE.on('show_my','click',function(e){ |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
124 show_my(e); |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
125 }) |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
126 var show_watched = function(e){ |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
127 YUD.setStyle('my_container','display','none'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
128 YUD.setStyle('watched_container','display',''); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
129 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
|
130 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
|
131 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
132 YUD.addClass('show_watched', 'current'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
133 YUD.removeClass('show_my','current'); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
134 if(!YUD.hasClass('show_watched', 'loaded')){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
135 watched_renderer(${c.watched_data |n}); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
136 YUD.addClass('show_watched', 'loaded'); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
137 } |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
138 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
139 return |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
140 var nodes = YUQ('#watched_container .watched_repo a'); |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
141 var target = 'q_filter'; |
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
142 var func = function(node){ |
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
143 return node.parentNode.parentNode; |
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
144 } |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
145 q_filter(target,nodes,func); |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
146 } |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
147 YUE.on('show_watched','click',function(e){ |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
148 show_watched(e); |
1741
fcbc35ecb024
personal Journal UI
Marcin Kuzminski <marcin@python-works.com>
parents:
1701
diff
changeset
|
149 }) |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
150 //init watched |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
151 show_watched(); |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
152 |
2951
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
153 var tabs = { |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
154 'watched': show_watched, |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
155 'my': show_my, |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
156 } |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
157 var url = location.href.split('#'); |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
158 if (url[1]) { |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
159 //We have a hash |
301773d07012
Lazy loading on my journal page
Marcin Kuzminski <marcin@python-works.com>
parents:
2944
diff
changeset
|
160 var tabHash = url[1]; |
3120
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
161 var func = tabs[tabHash] |
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
162 if (func){ |
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
163 func(); |
c69006a70e6b
fix small issue with anchor autolinks
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
164 } |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
165 } |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
166 function watched_renderer(data){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
167 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
|
168 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2971
diff
changeset
|
169 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
170 myDataSource.responseSchema = { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
171 resultsList: "records", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
172 fields: [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
173 {key:"menu"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
174 {key:"raw_name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
175 {key:"name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
176 {key:"last_changeset"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
177 {key:"action"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
178 ] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
179 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
180 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
|
181 // This is the filter function |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
182 var data = res.results || [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
183 filtered = [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
184 i,l; |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
185 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
186 if (req) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
187 req = req.toLowerCase(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
188 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
|
189 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
|
190 if (pos != -1) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
191 filtered.push(data[i]); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
192 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
193 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
194 res.results = filtered; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
195 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
196 return res; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
197 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
198 // main table sorting |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
199 var myColumnDefs = [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
200 {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
|
201 {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
|
202 sortOptions: { sortFunction: nameSort }}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
203 {key:"last_changeset",label:"${_('Tip')}",sortable:true, |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
204 sortOptions: { sortFunction: revisionSort }}, |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
205 {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
|
206 ]; |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
207 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
208 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
|
209 sortedBy:{key:"name",dir:"asc"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
210 paginator: new YAHOO.widget.Paginator({ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
211 rowsPerPage: 25, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
212 alwaysVisible: false, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
213 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
|
214 pageLinks: 5, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
215 containerClass: 'pagination-wh', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
216 currentPageClass: 'pager_curpage', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
217 pageLinkClass: 'pager_link', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
218 nextPageLinkLabel: '>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
219 previousPageLinkLabel: '<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
220 firstPageLinkLabel: '<<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
221 lastPageLinkLabel: '>>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
222 containers:['watched-user-paginator'] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
223 }), |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
224 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
225 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
|
226 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
|
227 MSG_EMPTY:"${_('No records found.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
228 MSG_ERROR:"${_('Data error.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
229 MSG_LOADING:"${_('Loading...')}", |
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 ); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
232 myDataTable.subscribe('postRenderEvent',function(oArgs) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
233 tooltip_activate(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
234 quick_repo_menu(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
235 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
236 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
237 var filterTimeout = null; |
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 updateFilter = function () { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
240 // Reset timeout |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
241 filterTimeout = null; |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
242 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
243 // Reset sort |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
244 var state = myDataTable.getState(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
245 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
|
246 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
247 // Get filtered data |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
248 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
|
249 success : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
250 failure : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
251 scope : myDataTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
252 argument: state |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
253 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
254 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
255 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
256 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
|
257 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
|
258 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
|
259 //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
|
260 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
|
261 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
262 }); |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
263 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
264 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
|
265 clearTimeout(filterTimeout); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
266 filterTimeout = setTimeout(updateFilter,600); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
267 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
268 } |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
269 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
270 function table_renderer(data){ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
271 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
|
272 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
|
273 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
274 myDataSource.responseSchema = { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
275 resultsList: "records", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
276 fields: [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
277 {key:"menu"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
278 {key:"raw_name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
279 {key:"name"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
280 {key:"last_changeset"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
281 {key:"action"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
282 ] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
283 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
284 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
|
285 // This is the filter function |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
286 var data = res.results || [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
287 filtered = [], |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
288 i,l; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
289 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
290 if (req) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
291 req = req.toLowerCase(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
292 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
|
293 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
|
294 if (pos != -1) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
295 filtered.push(data[i]); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
296 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
297 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
298 res.results = filtered; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
299 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
300 return res; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
301 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
302 // main table sorting |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
303 var myColumnDefs = [ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
304 {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
|
305 {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
|
306 sortOptions: { sortFunction: nameSort }}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
307 {key:"last_changeset",label:"${_('Tip')}",sortable:true, |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
308 sortOptions: { sortFunction: revisionSort }}, |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
309 {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
|
310 ]; |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
311 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
312 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
|
313 sortedBy:{key:"name",dir:"asc"}, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
314 paginator: new YAHOO.widget.Paginator({ |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
315 rowsPerPage: 25, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
316 alwaysVisible: false, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
317 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
|
318 pageLinks: 5, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
319 containerClass: 'pagination-wh', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
320 currentPageClass: 'pager_curpage', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
321 pageLinkClass: 'pager_link', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
322 nextPageLinkLabel: '>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
323 previousPageLinkLabel: '<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
324 firstPageLinkLabel: '<<', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
325 lastPageLinkLabel: '>>', |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
326 containers:['user-paginator'] |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
327 }), |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
328 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
329 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
|
330 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
|
331 MSG_EMPTY:"${_('No records found.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
332 MSG_ERROR:"${_('Data error.')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
333 MSG_LOADING:"${_('Loading...')}", |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
334 } |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
335 ); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
336 myDataTable.subscribe('postRenderEvent',function(oArgs) { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
337 tooltip_activate(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
338 quick_repo_menu(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
339 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
340 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
341 var filterTimeout = null; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
342 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
343 updateFilter = function () { |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
344 // Reset timeout |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
345 filterTimeout = null; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
346 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
347 // Reset sort |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
348 var state = myDataTable.getState(); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
349 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
|
350 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
351 // Get filtered data |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
352 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
|
353 success : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
354 failure : myDataTable.onDataReturnInitializeTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
355 scope : myDataTable, |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
356 argument: state |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
357 }); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
358 |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
359 }; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
360 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
|
361 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
|
362 YUD.get('q_filter').value = ''; |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
363 //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
|
364 YUD.addClass('q_filter', 'loaded'); |
1779
9edd6ac132f0
Added sorting into journal and admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1770
diff
changeset
|
365 } |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
366 }); |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
367 |
3154
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
368 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
|
369 clearTimeout(filterTimeout); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
370 filterTimeout = setTimeout(updateFilter,600); |
0226b6d6b2b5
Use common function for generation of grid data
Marcin Kuzminski <marcin@python-works.com>
parents:
3149
diff
changeset
|
371 }); |
3168
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
372 } |
2fb94c52e20e
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3154
diff
changeset
|
373 |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
374 </script> |
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1780
diff
changeset
|
375 </%def> |