##// END OF EJS Templates
rhodecode.js: initialize filter input field when passing search=1 in GET
Mads Kiilerich -
r4167:1cb909e6 rhodecode-2.2.5-gpl
parent child Browse files
Show More
@@ -1,120 +1,120 b''
1 <%def name="file_class(node)">
1 <%def name="file_class(node)">
2 %if node.is_file():
2 %if node.is_file():
3 <%return "browser-file" %>
3 <%return "browser-file" %>
4 %else:
4 %else:
5 <%return "browser-dir"%>
5 <%return "browser-dir"%>
6 %endif
6 %endif
7 </%def>
7 </%def>
8 <div id="body" class="browserblock">
8 <div id="body" class="browserblock">
9 <div class="browser-header">
9 <div class="browser-header">
10 <div class="browser-nav">
10 <div class="browser-nav">
11 ${h.form(h.url.current())}
11 ${h.form(h.url.current())}
12 <div class="info_box">
12 <div class="info_box">
13 <div class="info_box_elem rev">${_('revision')}</div>
13 <div class="info_box_elem rev">${_('revision')}</div>
14 <div class="info_box_elem"><a class="btn btn-mini ypjax-link" href="${c.url_prev}" title="${_('Previous revision')}"><i class="icon-chevron-left"></i></a></div>
14 <div class="info_box_elem"><a class="btn btn-mini ypjax-link" href="${c.url_prev}" title="${_('Previous revision')}"><i class="icon-chevron-left"></i></a></div>
15 <div class="info_box_elem">${h.text('at_rev',value=c.changeset.revision,size=5)}</div>
15 <div class="info_box_elem">${h.text('at_rev',value=c.changeset.revision,size=5)}</div>
16 <div class="info_box_elem"><a class="btn btn-mini ypjax-link" href="${c.url_next}" title="${_('Next revision')}"><i class="icon-chevron-right"></i></a></div>
16 <div class="info_box_elem"><a class="btn btn-mini ypjax-link" href="${c.url_next}" title="${_('Next revision')}"><i class="icon-chevron-right"></i></a></div>
17 </div>
17 </div>
18 ${h.end_form()}
18 ${h.end_form()}
19 </div>
19 </div>
20 <div class="browser-branch">
20 <div class="browser-branch">
21 ${h.checkbox('stay_at_branch',c.changeset.branch,c.changeset.branch==c.branch)}
21 ${h.checkbox('stay_at_branch',c.changeset.branch,c.changeset.branch==c.branch)}
22 <label>${_('Follow current branch')}</label>
22 <label>${_('Follow current branch')}</label>
23 </div>
23 </div>
24 <div id="search_activate_id" class="search_activate">
24 <div id="search_activate_id" class="search_activate">
25 <a class="btn btn-mini" id="filter_activate" href="#">${_('Search File List')}</a>
25 <a class="btn btn-mini" id="filter_activate" href="#">${_('Search File List')}</a>
26 </div>
26 </div>
27 <div class="browser-search">
27 <div class="browser-search">
28 <div>
28 <div>
29 <div id="node_filter_box_loading" style="display:none">${_('Loading file list...')}</div>
29 <div id="node_filter_box_loading" style="display:none">${_('Loading file list...')}</div>
30 <div id="node_filter_box" style="display:none">
30 <div id="node_filter_box" style="display:none">
31 ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.file.path)}/<input class="init" type="text" value="type to search..." name="filter" size="25" id="node_filter" autocomplete="off">
31 ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.file.path)}/<input class="init" type="text" value="type to search..." name="filter" size="25" id="node_filter" autocomplete="off">
32 </div>
32 </div>
33 </div>
33 </div>
34 </div>
34 </div>
35 </div>
35 </div>
36
36
37 <div class="browser-body">
37 <div class="browser-body">
38 <table class="code-browser">
38 <table class="code-browser">
39 <thead>
39 <thead>
40 <tr>
40 <tr>
41 <th>${_('Name')}</th>
41 <th>${_('Name')}</th>
42 <th>${_('Size')}</th>
42 <th>${_('Size')}</th>
43 <th>${_('Mimetype')}</th>
43 <th>${_('Mimetype')}</th>
44 <th>${_('Last Revision')}</th>
44 <th>${_('Last Revision')}</th>
45 <th>${_('Last modified')}</th>
45 <th>${_('Last modified')}</th>
46 <th>${_('Last committer')}</th>
46 <th>${_('Last committer')}</th>
47 </tr>
47 </tr>
48 </thead>
48 </thead>
49
49
50 <tbody id="tbody">
50 <tbody id="tbody">
51 %if c.file.parent:
51 %if c.file.parent:
52 <tr class="parity0">
52 <tr class="parity0">
53 <td>
53 <td>
54 ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.parent.path),class_="browser-dir ypjax-link")}
54 ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.parent.path),class_="browser-dir ypjax-link")}
55 </td>
55 </td>
56 <td></td>
56 <td></td>
57 <td></td>
57 <td></td>
58 <td></td>
58 <td></td>
59 <td></td>
59 <td></td>
60 <td></td>
60 <td></td>
61 </tr>
61 </tr>
62 %endif
62 %endif
63
63
64 %for cnt,node in enumerate(c.file):
64 %for cnt,node in enumerate(c.file):
65 <tr class="parity${cnt%2}">
65 <tr class="parity${cnt%2}">
66 <td>
66 <td>
67 %if node.is_submodule():
67 %if node.is_submodule():
68 ${h.link_to(node.name,node.url or '#',class_="submodule-dir ypjax-link")}
68 ${h.link_to(node.name,node.url or '#',class_="submodule-dir ypjax-link")}
69 %else:
69 %else:
70 ${h.link_to(node.name, h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=h.safe_unicode(node.path)),class_=file_class(node)+" ypjax-link")}
70 ${h.link_to(node.name, h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=h.safe_unicode(node.path)),class_=file_class(node)+" ypjax-link")}
71 %endif:
71 %endif:
72 </td>
72 </td>
73 <td>
73 <td>
74 %if node.is_file():
74 %if node.is_file():
75 ${h.format_byte_size(node.size,binary=True)}
75 ${h.format_byte_size(node.size,binary=True)}
76 %endif
76 %endif
77 </td>
77 </td>
78 <td>
78 <td>
79 %if node.is_file():
79 %if node.is_file():
80 ${node.mimetype}
80 ${node.mimetype}
81 %endif
81 %endif
82 </td>
82 </td>
83 <td>
83 <td>
84 %if node.is_file():
84 %if node.is_file():
85 <div class="tooltip" title="${h.tooltip(node.last_changeset.message)}">
85 <div class="tooltip" title="${h.tooltip(node.last_changeset.message)}">
86 <pre>${'r%s:%s' % (node.last_changeset.revision,node.last_changeset.short_id)}</pre>
86 <pre>${'r%s:%s' % (node.last_changeset.revision,node.last_changeset.short_id)}</pre>
87 </div>
87 </div>
88 %endif
88 %endif
89 </td>
89 </td>
90 <td>
90 <td>
91 %if node.is_file():
91 %if node.is_file():
92 <span class="tooltip" title="${h.tooltip(h.fmt_date(node.last_changeset.date))}">
92 <span class="tooltip" title="${h.tooltip(h.fmt_date(node.last_changeset.date))}">
93 ${h.age(node.last_changeset.date)}</span>
93 ${h.age(node.last_changeset.date)}</span>
94 %endif
94 %endif
95 </td>
95 </td>
96 <td>
96 <td>
97 %if node.is_file():
97 %if node.is_file():
98 <span title="${node.last_changeset.author}">
98 <span title="${node.last_changeset.author}">
99 ${h.person(node.last_changeset.author)}
99 ${h.person(node.last_changeset.author)}
100 </span>
100 </span>
101 %endif
101 %endif
102 </td>
102 </td>
103 </tr>
103 </tr>
104 %endfor
104 %endfor
105 </tbody>
105 </tbody>
106 <tbody id="tbody_filtered" style="display:none">
106 <tbody id="tbody_filtered" style="display:none">
107 </tbody>
107 </tbody>
108 </table>
108 </table>
109 </div>
109 </div>
110 </div>
110 </div>
111
111
112 <script>
112 <script>
113 $(document).ready(function(){
113 $(document).ready(function(){
114 // init node filter if we pass GET param ?search=1
114 // init node filter if we pass GET param ?search=1
115 var search_GET = "${request.GET.get('search','')}";
115 var search_GET = "${request.GET.get('search','')}";
116 if(search_GET == "1"){
116 if(search_GET == "1"){
117 _NODEFILTER.initFilter();
117 $("#filter_activate").click();
118 }
118 }
119 })
119 })
120 </script>
120 </script>
General Comments 0
You need to be logged in to leave comments. Login now