diff --git a/colab/search/templates/dashboard-message-preview.html b/colab/search/templates/dashboard-message-preview.html new file mode 100644 index 0000000..74596d6 --- /dev/null +++ b/colab/search/templates/dashboard-message-preview.html @@ -0,0 +1,3 @@ +{% load i18n tz highlight search_preview_templates %} +{% get_dashboard_search_preview_templates result as template_target %} +{% include template_target %} diff --git a/colab/search/templatetags/search_preview_templates.py b/colab/search/templatetags/search_preview_templates.py index 0c72484..ebda76d 100644 --- a/colab/search/templatetags/search_preview_templates.py +++ b/colab/search/templatetags/search_preview_templates.py @@ -9,3 +9,10 @@ def get_search_preview_templates(model_indexed): app_type = model_indexed.type return "search/{}_search_preview.html".format(app_type) + + +@register.assignment_tag +def get_dashboard_search_preview_templates(model_indexed): + app_type = model_indexed.type + + return "dashboard/{}_search_preview.html".format(app_type) diff --git a/colab/super_archives/templates/dashboard/thread_search_preview.html b/colab/super_archives/templates/dashboard/thread_search_preview.html new file mode 100644 index 0000000..deefeb5 --- /dev/null +++ b/colab/super_archives/templates/dashboard/thread_search_preview.html @@ -0,0 +1,69 @@ +{% load i18n tz highlight %} + +
  • + + +{% if result.tag %} + + {{ result.tag }} + +{% endif %} + +{% if result.title %} + + + + {% if query %} + {% highlight result.title with query max_length "1000" %} + {% else %} + {{ result.title }} + {% endif %} + + +{% endif %} + +{% if result.description %} + + - {% if query %} + {% highlight result.description with query max_length "150" %} + {% else %} + {% if result.latest_description %} + {{ result.latest_description|striptags|escape|truncatechars:150 }} + {% elif result.description %} + {{ result.description|striptags|escape|truncatechars:150 }} + {% endif %} + {% endif %} + +{% endif %} + +{% if result.fullname or result.modified or result.modified_by %} +
    + {% if result.modified_by %} + {% trans "by" %} + {% if result.modified_by_url %} + + {% else %} + + {% endif %} + + {% if query %} + {% highlight result.modified_by with query %} + {% else %} + {{ result.modified_by }} + {% endif %} + + {% if result.modified_by_url %} + + {% else %} + + {% endif %} + + {% else %} + {% trans "by" %} {% trans "Anonymous" %} + {% endif %} + {% if result.modified %} + {{ result.modified|localtime|timesince }} {% trans "ago" %} + {% endif %} +
    +{% endif %} +
  • \ No newline at end of file diff --git a/colab/templates/home.html b/colab/templates/home.html index 4ea63c3..6e2c787 100644 --- a/colab/templates/home.html +++ b/colab/templates/home.html @@ -22,7 +22,7 @@ @@ -72,7 +72,7 @@ -- libgit2 0.21.2