aboutsummaryrefslogtreecommitdiffstats
path: root/lib/templates
Commit message (Collapse)AuthorAgeFilesLines
* templates: correctly return week format when necessaryNojus Gudinavičius2023-01-111-1/+1
| | | | | | | | | This fixes a bug when thisDayTimeFmt was returned for both this day and this week. Fixes: d758441fe0c4 ("templates: add more fields and functions") Signed-off-by: Nojus Gudinavičius <nojus.gudinavicius@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* config: add columns based index formatRobin Jarry2023-01-061-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The index-format option comes from mutt and is neither user friendly, nor intuitive. Introduce a new way of configuring the message list contents. Replace index-format with multiple settings to make everything more intuitive. Reuse the table widget added in the previous commit. index-columns Comma-separated list of column names followed by optional alignment and width specifiers. column-separator String separator between columns. column-$name One setting for every name defined in index-columns. This supports golang text/template syntax and allows access to the same message information than before and much more. When index-format is still defined in aerc.conf (which will most likely happen when users will update after this patch), convert it to the new index-columns + column-$name and column-separator system and a warning is displayed on startup so that users are aware that they need to update their config. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* templates: add more fields and functionsRobin Jarry2023-01-043-24/+401
| | | | | | | | | | | Add functions and fields in preparation for more than only message templates. The idea is to reuse the same symbols for the message list format and other parts of the UI. Update the man page accordingly. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* templates: change fields as lazy functionsRobin Jarry2023-01-041-35/+67
| | | | | | | | | No need to pre-render fields that are not necessarily accessed in templates. Change fields to functions that are evaluated only when required. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* templates: split code in multiple filesRobin Jarry2023-01-043-182/+193
| | | | | | | This makes room in preparation for more code in here. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* lint: apply new formatting rulesMoritz Poldrack2022-08-011-2/+2
| | | | | | | Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* config: do not hardcode sharedirRobin Jarry2022-02-191-0/+8
| | | | | | | | | | | | Instead of using a static SHAREDIR at compile time, use a list of standard paths to use at runtime for templates, config files and stylesets. This implies removing all default filters in the default configuration. Replace them with basic commands. New users can configure the filters as they wish. Signed-off-by: Robin Jarry <robin@jarry.cc>
* go.mod: change base git urlRobin Jarry2021-11-051-1/+1
| | | | | | | I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
* compose: use a proper header instead of a string mapReto Brunner2020-11-141-33/+49
| | | | | | | | | | | | | Prior to this commit, the composer was based on a map[string]string. While this approach was very versatile, it lead to a constant encoding / decoding of addresses and other headers. This commit switches to a different model, where the composer is based on a header. Commands which want to interact with it can simply set some defaults they would like to have. Users can overwrite them however they like. In order to get access to the functions generating / getting the msgid go-message was upgraded.
* templates: Remove ParseTemplate as it's unusedReto Brunner2020-11-141-14/+0
|
* templates: better error messageReto Brunner2020-11-111-2/+3
|
* Fix dates in reply/forward commands.Reto Brunner2020-06-261-3/+2
| | | | | | The data was passed around as a string for some reason, which led to time precision loss and wrong dates being displayed. Simply pass the time as is to fix that.
* templates: add version funcReto Brunner2020-05-061-0/+8
| | | | Fixes #316
* Remove ability to specify headers in the editorReto Brunner2020-04-241-4/+5
| | | | | | | | | | Due to headers being essentially free text, we constantly run into issues with parts of the body being interpreted as headers. Remove the ability to overwrite headers to avoid that, while keeping the ability to specify headers in the template files. Fixes #383
* toLocal template functionsqwishy2020-02-251-0/+5
| | | | | | | | | | Hi. This adds a template function to convert a time to the local time zone. And modifies the default quoted_reply template to use it and show the time zone when formatting the timestamp of the quoted message. Previously, the quoted message timestamp was UTC and it would format it without the time zone. And I thought it might be a little confusing or weird to some normal people when I email them and I don't want normal people to be confused or think that I'm weird.
* template: add exec and wrapLeszek Cimała2020-01-091-0/+23
|
* template: remove last \n to fix additional new lines after quoteLeszek Cimała2020-01-091-0/+2
|
* add .OriginalMIMEType variable to reply templateLeszek Cimała2020-01-091-15/+18
|
* create OriginalMail structLeszek Cimała2020-01-091-12/+16
|
* Fix double >\n when quoting empty lineSrivathsan Murali2020-01-041-0/+1
|
* Correct capitalization in quoted_replyDrew DeVault2019-11-101-12/+32
|
* Add some defaults for template optionsDrew DeVault2019-11-101-2/+2
|
* Add Templates with ParsingSrivathsan Murali2019-11-101-0/+160
+ Changes NewComposer to return error. + Add lib to handle templates using "text/template". + Add -T option to following commands - compose. - reply - forward + Quoted replies using templates. + Forwards as body using templates + Default templates are installed similar to filters. + Templates Config in aerc.conf. - Required templates are parsed while loading config. + Add aerc-templates.7 manual for using template data.