diff --git a/tildes/tildes/enums.py b/tildes/tildes/enums.py
index 0cd7bf5..0bafee1 100644
--- a/tildes/tildes/enums.py
+++ b/tildes/tildes/enums.py
@@ -201,6 +201,9 @@ class TopicContentType(enum.Enum):
ARTICLE = enum.auto()
ASK = enum.auto()
+ ASK_ADVICE = enum.auto()
+ ASK_RECOMMENDATIONS = enum.auto()
+ ASK_SURVEY = enum.auto()
IMAGE = enum.auto()
PDF = enum.auto()
TEXT = enum.auto()
@@ -214,6 +217,10 @@ class TopicContentType(enum.Enum):
if self.name == "PDF":
return self.name
+ if self.name.startswith("ASK_"):
+ subtype_name = self.name.partition("_")[-1].capitalize()
+ return f"Ask ({subtype_name})"
+
return self.name.capitalize()
diff --git a/tildes/tildes/models/topic/topic.py b/tildes/tildes/models/topic/topic.py
index 3469e33..9c7a575 100644
--- a/tildes/tildes/models/topic/topic.py
+++ b/tildes/tildes/models/topic/topic.py
@@ -440,6 +440,15 @@ class Topic(DatabaseModel):
def content_type(self) -> Optional[TopicContentType]:
"""Return the content's type based on the topic's attributes."""
if self.is_text_type:
+ if self.has_tag("ask.survey"):
+ return TopicContentType.ASK_SURVEY
+
+ if self.has_tag("ask.recommendations"):
+ return TopicContentType.ASK_RECOMMENDATIONS
+
+ if self.has_tag("ask.advice"):
+ return TopicContentType.ASK_ADVICE
+
if self.has_tag("ask"):
return TopicContentType.ASK
@@ -466,6 +475,14 @@ class Topic(DatabaseModel):
return None
+ @property
+ def content_type_for_display(self) -> str:
+ """Return a string of the topic's content type, suitable for display."""
+ if not self.content_type:
+ return "Link"
+
+ return self.content_type.display_name
+
def get_content_metadata(self, key: str) -> Any:
"""Get a piece of content metadata "safely".
diff --git a/tildes/tildes/templates/macros/topics.jinja2 b/tildes/tildes/templates/macros/topics.jinja2
index d7ba417..338d9b9 100644
--- a/tildes/tildes/templates/macros/topics.jinja2
+++ b/tildes/tildes/templates/macros/topics.jinja2
@@ -46,7 +46,7 @@
{% endif %}
- {{ topic.content_type.display_name if topic.content_type else "Link" }}
+ {{ topic.content_type_for_display }}
{% if topic.content_metadata_for_display %}
{{ topic.content_metadata_for_display }}