tree checksum vpatch file split hunks
all signers: lobbes bvt diana_coman asciilifeform
antecedents: search_all_chans.kv
press order:
patch:
(16 . 3)(16 . 4)
5 598372 shlex_removal asciilifeform "Reverted defective attempt at double-quoted search."
6 640165 hide_inactive asciilifeform "Configurable default-hide of idle chans"
7 641046 search_all_chans asciilifeform "Button to search in all logged chans"
8 641484 navbar_date_auto asciilifeform "Automatically skip empty days in navbar. Handle 'dawn of time' case."
- 0A75AB02402BD83BDA90E41A341753044860EB7E0013943687B0B0797356E8D9E21BA4346A71123357D791CE422ECF789A29AD8EA759BC8799F88C54CA7E66D3(151 . 3)(151 . 11)
13
14 (1) Fix unclosed 'table' tag from earlier.
15 (2) 'Search all chans' button.
16
17 ####################
18 Jul. 2020 Update #3:
19 ####################
20
21 (1) Automatically skip empty days in date navigation bar. At the same time, handle empty days correctly when these are requested.
22 (2) Handle 'dawn of time' case for any given channel, to avoid infinite loop insanity from search engines.
23
- 3B5645290A520A3F935B44372A1C98F60A0BC967EA3D6AD4160EF72E455C7C9636847847007334053703765FA80176A2509E3609005E4AB8D2518D27869F8002(306 . 31)(306 . 6)- C65B0971E605CBF05445F2562F4E363BFBFAC914D389D81F946FD534E79FF3BA4B00245536FBFBAA3527127A4DEC005FBE1C3242182C76C47112498CEF0505D6
28 app.jinja_env.globals.update(format_logline=format_logline)
29
30
31 # Generate navbar for the given date:
32 def generate_navbar(date, tail, chan):
33 cur_day = datetime.strptime(date, Date_Short_Format)
34 prev_day = cur_day - timedelta(days=1)
35 prev_day_txt = prev_day.strftime(Date_Short_Format)
36
37 s = "<a href='{0}log/{1}/{2}'>← {2}</a>".format(
38 get_base(),
39 chan,
40 prev_day_txt)
41
42 if not tail:
43 next_day = cur_day + timedelta(days=1)
44 next_day_txt = next_day.strftime(Date_Short_Format)
45 s = s + " | <a href='{0}log/{1}/{2}'>{2} →</a>".format(
46 get_base(),
47 chan,
48 next_day_txt)
49
50 return s
51
52 # Make above callable from inside htm templater:
53 app.jinja_env.globals.update(generate_navbar=generate_navbar)
54
55
56 @app.route('/rnd/<chan>')
57 def rnd(chan):
58 # Handle rubbish chan:
(387 . 7)(362 . 7)
60 # Enable 'tail' is day_end is after end of current day
61 if day_end > now:
62 tail = True
63
64
65 # Get the loglines from DB
66 lines = query_db(
67 '''select * from loglines where chan=%s
(397 . 14)(372 . 36)
69 # Optional 'reverse gear' knob:
70 if rev == 1:
71 lines.reverse()
72
73
74 # Generate navbar for the given date:
75 prev_day = ""
76 next_day = ""
77
78 prev_t = query_db(
79 '''select t from loglines where chan=%s
80 and t < %s order by idx desc limit 1;''',
81 [chan, day_start], one=True)
82
83 if prev_t != None:
84 prev_day = prev_t['t'].strftime(Date_Short_Format)
85
86 if not tail:
87 next_t = query_db(
88 '''select t from loglines where chan=%s
89 and t > %s order by idx asc limit 1;''',
90 [chan, day_end], one=True)
91
92 if next_t != None:
93 next_day = next_t['t'].strftime(Date_Short_Format)
94
95 # Return the HTMLized text
96 return render_template('log.html',
97 chan = chan,
98 loglines = lines,
99 sel = (sel_start, sel_end),
100 date = date,
101 tail = tail,
102 prev_day = prev_day,
103 next_day = next_day,
104 rev = not rev,
105 show_all = show_all,
106 idle_day = Days_Hide)
(138 . 8)(138 . 6)
111
112 <form align="center" id="search" method='get' action='/log-search'>
113 <input type='text' name='q' value='{{ query }}' maxlength='2048' spellcheck='false' size='55' value='' />
114 <!-- <input type='hidden' name='chan' value='{{chan}}'> -->
115
116 {% if chan != 'all' %}
117 <button type='submit' name='chan' value='{{chan}}'>search {{chan}}</button>
118 {% endif %}
- 1B71B2BB4CDAFD0561FE834175983923A32C5E91729347E894D77AC283A608F4047FA16638D2A949936F40F3A0B5659100B4D6B7DA5260008970B9F99A1F9C81(7 . 7)(7 . 7)
123 {% block body %}
124
125 <div id="navbarblock">
126 <p class='navbar'>{{ generate_navbar(date, tail, chan) | safe }}</p>
127 <p class='navbar'>{% if prev_day != '' %}<a href='/log/{{ chan }}/{{ prev_day }}'>← {{ prev_day }}</a>{% else %}<i>Dawn of Time</i>{% endif %} {% if next_day != '' %}| <a href='/log/{{ chan }}/{{ next_day }}'>{{ next_day }} →</a>{% endif %}</p>
128 <p class='jump'><a href="#tail">↓</a></p>
129 </div>
130 <div style="clear: both;"></div>
(19 . 7)(19 . 7)
132 </div>
133
134 <div id="navbarblock">
135 <p class='navbar'>{{ generate_navbar(date, tail, chan) | safe }}</p>
136 <p class='navbar'>{% if prev_day != '' %}<a href='/log/{{ chan }}/{{ prev_day }}'>← {{ prev_day }}</a>{% else %}<i>Dawn of Time</i>{% endif %} {% if next_day != '' %}| <a href='/log/{{ chan }}/{{ next_day }}'>{{ next_day }} →</a>{% endif %}</p>
137 <p class='jump'><a href="#head">↑</a></p>
138 </div>
139 <div style="clear: both;"></div>