diff --git a/app/helpers/portal_helper.rb b/app/helpers/portal_helper.rb index 8bc234415..ef16e9797 100644 --- a/app/helpers/portal_helper.rb +++ b/app/helpers/portal_helper.rb @@ -61,4 +61,9 @@ module PortalHelper def render_category_content(content) ChatwootMarkdownRenderer.new(content).render_markdown_to_plain_text end + + def thumbnail_bg_color(username) + colors = ['#6D95BA', '#A4C3C3', '#E19191'] + colors[username.length % colors.size] + end end diff --git a/app/views/icons/_user.html.erb b/app/views/icons/_user.html.erb new file mode 100644 index 000000000..885c26fc9 --- /dev/null +++ b/app/views/icons/_user.html.erb @@ -0,0 +1 @@ + diff --git a/app/views/public/api/v1/portals/_authors.html.erb b/app/views/public/api/v1/portals/_authors.html.erb new file mode 100644 index 000000000..86a0dae89 --- /dev/null +++ b/app/views/public/api/v1/portals/_authors.html.erb @@ -0,0 +1,24 @@ +<% author_count = category.articles.published.order(position: :asc).map(&:author).uniq.size %> +<% if author_count > 0 %> +
<%= render_category_content(article.content) %>
+<%= render_category_content(article.content) %>
+