mirror of
https://github.com/Calamitous/iris.git
synced 2024-06-27 16:37:04 +00:00
Tweak topic listing
- Display topic timestamp OR latest reply timestamp - Remove leading space - Clean up 'T' and 'Z' in timestamp for readability - Fix topic list left alignment bug
This commit is contained in:
parent
eee023dab3
commit
efd496cecc
|
@ -65,7 +65,7 @@ jimmy_foo@ctrl-c.club> topics
|
||||||
```
|
```
|
||||||
|
|
||||||
1. The first column is the topic index. This is the reference number to use when displaying or replying to a topic.
|
1. The first column is the topic index. This is the reference number to use when displaying or replying to a topic.
|
||||||
1. The second column is the timestamp. This is the server-local time when the topic was composed.
|
1. The second column is the timestamp. This is the server-local time when the topic was composed or last replied to.
|
||||||
1. The third column is the author. This is the user who composed the topic.
|
1. The third column is the author. This is the user who composed the topic.
|
||||||
1. The fourth column is the title. This is the truncated first line of the topic.
|
1. The fourth column is the title. This is the truncated first line of the topic.
|
||||||
|
|
||||||
|
|
2
TODO.md
2
TODO.md
|
@ -18,7 +18,6 @@
|
||||||
* Split helptext into separate file?
|
* Split helptext into separate file?
|
||||||
|
|
||||||
# Features:
|
# Features:
|
||||||
* Change listing to show last updated timestamp, instead of thread creation timestamp
|
|
||||||
* Message deletion
|
* Message deletion
|
||||||
* Message editing
|
* Message editing
|
||||||
* Gracefully handle bad message files
|
* Gracefully handle bad message files
|
||||||
|
@ -54,3 +53,4 @@
|
||||||
* Add color
|
* Add color
|
||||||
* Add full message corpus dump for backup/debugging
|
* Add full message corpus dump for backup/debugging
|
||||||
* Add startup enviro health check
|
* Add startup enviro health check
|
||||||
|
* Change listing to show last updated timestamp, instead of thread creation timestamp
|
||||||
|
|
12
iris.rb
12
iris.rb
|
@ -299,11 +299,15 @@ class Message
|
||||||
stub.slice(0, length - 6) + '...'
|
stub.slice(0, length - 6) + '...'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def latest_topic_timestamp
|
||||||
|
(replies.map(&:timestamp).max || timestamp).gsub(/T/, ' ').gsub(/Z/, '')
|
||||||
|
end
|
||||||
|
|
||||||
def to_topic_line(index)
|
def to_topic_line(index)
|
||||||
error_marker = valid? ? ' ' : 'X'
|
error_marker = valid? ? '|' : 'X'
|
||||||
head = [error_marker, Display.print_index(index), timestamp, Display.print_author(author)].join(' | ')
|
head = [Display.print_index(index), latest_topic_timestamp, Display.print_author(author)].join(' | ')
|
||||||
message_stub = truncated_message(Display::WIDTH - head.length)
|
message_stub = truncated_message(Display::WIDTH - head.decolorize.length - 1)
|
||||||
[head, message_stub].join(' | ')
|
error_marker + ' ' + [head, message_stub].join(' | ')
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_display
|
def to_display
|
||||||
|
|
Loading…
Reference in New Issue
Block a user