Switch to unified view

a/webui.py b/webui.py
...
...
122
    # get mountpoints
122
    # get mountpoints
123
    config['mounts'] = {}
123
    config['mounts'] = {}
124
    for d in config['dirs']:
124
    for d in config['dirs']:
125
        name = 'mount_%s' % urllib.quote(d,'')
125
        name = 'mount_%s' % urllib.quote(d,'')
126
        config['mounts'][d] = select([bottle.request.get_cookie(name), 'file://%s' % d], [None, ''])
126
        config['mounts'][d] = select([bottle.request.get_cookie(name), 'file://%s' % d], [None, ''])
127
128
    # Parameters set by the admin in the recoll configuration
129
    # file. These override anything else, so read them last
130
    config['rclc_nojsoncsv'] = bool(int(rclconf.getConfParam('webui_nojsoncsv')))
131
    val = rclconf.getConfParam('webui_maxperpage')
132
    val = 0 if val is None else int(val)
133
    if val:
134
        if config['perpage'] == 0 or config['perpage'] > val:
135
            config['perpage'] = val
136
    config['rclc_nosettings'] = int(rclconf.getConfParam('webui_nosettings'))
127
    return config
137
    return config
128
#}}}
138
#}}}
129
#{{{ get_dirs
139
#{{{ get_dirs
130
def get_dirs(tops, depth):
140
def get_dirs(tops, depth):
131
    v = []
141
    v = []
...
...
238
@bottle.route('/')
248
@bottle.route('/')
239
@bottle.view('main')
249
@bottle.view('main')
240
def main():
250
def main():
241
    config = get_config()
251
    config = get_config()
242
    return { 'dirs': get_dirs(config['dirs'], config['dirdepth']),
252
    return { 'dirs': get_dirs(config['dirs'], config['dirdepth']),
243
            'query': get_query(), 'sorts': SORTS }
253
            'query': get_query(), 'sorts': SORTS, 'config': config}
244
#}}}
254
#}}}
245
#{{{ results
255
#{{{ results
246
@bottle.route('/results')
256
@bottle.route('/results')
247
@bottle.view('results')
257
@bottle.view('results')
248
def results():
258
def results():
...
...
256
        config['perpage'] = nres
266
        config['perpage'] = nres
257
    return { 'res': res, 'time': timer, 'query': query, 'dirs':
267
    return { 'res': res, 'time': timer, 'query': query, 'dirs':
258
            get_dirs(config['dirs'], config['dirdepth']),
268
            get_dirs(config['dirs'], config['dirdepth']),
259
             'qs': qs, 'sorts': SORTS, 'config': config,
269
             'qs': qs, 'sorts': SORTS, 'config': config,
260
            'query_string': bottle.request.query_string, 'nres': nres,
270
            'query_string': bottle.request.query_string, 'nres': nres,
261
             'hasrclextract': hasrclextract }
271
             'hasrclextract': hasrclextract, 'config': config}
262
#}}}
272
#}}}
263
#{{{ preview
273
#{{{ preview
264
@bottle.route('/preview/<resnum:int>')
274
@bottle.route('/preview/<resnum:int>')
265
def preview(resnum):
275
def preview(resnum):
266
    if not hasrclextract:
276
    if not hasrclextract: