From f34f88e25acef18deb4078b274325e304d5d8876 Mon Sep 17 00:00:00 2001 From: Markus-Rost Date: Sat, 19 Dec 2020 13:40:48 +0100 Subject: [PATCH] contentmodel/new #187 --- settings.json.example | 5 +++++ src/rc_formatters.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/settings.json.example b/settings.json.example index 6971898..ab27c7c 100644 --- a/settings.json.example +++ b/settings.json.example @@ -273,6 +273,11 @@ "color": 25600, "emoji": "📋" }, + "contentmodel/new": { + "icon": "", + "color": 25600, + "emoji": "📋" + }, "cargo/deletetable": { "icon": "", "color": 16776960, diff --git a/src/rc_formatters.py b/src/rc_formatters.py index 03176a8..1e1a004 100644 --- a/src/rc_formatters.py +++ b/src/rc_formatters.py @@ -402,6 +402,9 @@ def compact_formatter(action, change, parsed_comment, categories, recent_changes link = link_formatter(create_article_path(change["title"])) content = _("[{author}]({author_url}) changed the content model of the page [{article}]({article_url}) from {old} to {new}{comment}").format(author=author, author_url=author_url, article=change["title"], article_url=link, old=change["logparams"]["oldmodel"], new=change["logparams"]["newmodel"], comment=parsed_comment) + elif action == "contentmodel/new": + link = link_formatter(create_article_path(change["title"])) + content = _("[{author}]({author_url}) created the page [{article}]({article_url}) using a non-default content model {new}{comment}").format(author=author, author_url=author_url, article=change["title"], article_url=link, new=change["logparams"]["newmodel"], comment=parsed_comment) elif action == "sprite/sprite": link = link_formatter(create_article_path(change["title"])) content = _("[{author}]({author_url}) edited the sprite for [{article}]({article_url})").format(author=author, author_url=author_url, article=change["title"], article_url=link) @@ -1070,6 +1073,10 @@ def embed_formatter(action, change, parsed_comment, categories, recent_changes): parsed_comment = _("Model changed from {old} to {new}: {reason}").format(old=change["logparams"]["oldmodel"], new=change["logparams"]["newmodel"], reason=parsed_comment) + elif action == "contentmodel/new": + link = create_article_path(change["title"]) + embed["title"] = _("Created the page {article} using a non-default content model").format(article=change["title"]) + parsed_comment = _("Created with model {new}: {reason}").format(new=change["logparams"]["newmodel"], reason=parsed_comment) elif action == "sprite/sprite": link = create_article_path(change["title"]) embed["title"] = _("Edited the sprite for {article}").format(article=change["title"])