From 278649e832bb4e61a3478f8838555529d4848934 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Sun, 30 Jul 2023 15:39:24 +0530 Subject: Reduce unnecessary repetition in views --- views/add_feed.tpl | 9 ++++----- views/index.tpl | 12 ++++++------ views/manage_feed.tpl | 7 +------ views/tag_hover_help.tpl | 1 - views/tag_input.tpl | 6 ++++++ 5 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 views/tag_hover_help.tpl create mode 100644 views/tag_input.tpl (limited to 'views') diff --git a/views/add_feed.tpl b/views/add_feed.tpl index 0110bac..4b139d3 100644 --- a/views/add_feed.tpl +++ b/views/add_feed.tpl @@ -17,12 +17,11 @@ % end

Add a feed

- +
-
- - % include("tag_hover_help.tpl") -
+ % include("tag_input.tpl", input_name="tags")
% include("footer.tpl") diff --git a/views/index.tpl b/views/index.tpl index f65a1af..b00b7d0 100644 --- a/views/index.tpl +++ b/views/index.tpl @@ -61,12 +61,12 @@ % include("hover_help.tpl", text="Space-separated feed IDs.") -
- - % include("tag_hover_help.tpl") -
+ % include( + % "tag_input.tpl", + % label="Included tags:", + % input_name="included_tags", + % input_value=included_tags_str if included_tags_str else "" + % ) diff --git a/views/manage_feed.tpl b/views/manage_feed.tpl index 0ff127e..dce9dc5 100644 --- a/views/manage_feed.tpl +++ b/views/manage_feed.tpl @@ -42,12 +42,7 @@ -
- - % include("tag_hover_help.tpl") -
+ % include("tag_input.tpl", input_name="tags", input_value=feed["serialised_tags"])
diff --git a/views/tag_hover_help.tpl b/views/tag_hover_help.tpl deleted file mode 100644 index 9007e55..0000000 --- a/views/tag_hover_help.tpl +++ /dev/null @@ -1 +0,0 @@ -% include("hover_help.tpl", text="Space-separated. Backslashes escape spaces.") diff --git a/views/tag_input.tpl b/views/tag_input.tpl new file mode 100644 index 0000000..99145e9 --- /dev/null +++ b/views/tag_input.tpl @@ -0,0 +1,6 @@ +
+ + % include("hover_help.tpl", text="Space-separated. Backslashes escape spaces.") +
-- cgit v1.2.3-57-g22cb