Skip to content

metadata to display on question cards - design discussion #8731

@jywarren

Description

@jywarren

Just breaking out a discussion from #8479 (comment) on what to display on each card style. Right now, we show a pretty minimal card (re style guide https://publiclab.org/style-guide) for regular posts/notes:

image

This is driven by the following template: https://github.com/publiclab/plots2/blob/main/app/views/notes/_card.html.erb

Question cards look a little different, unfortunately:

image

Question cards are driven by a separate template, actually - we should try to make them more consistent, which would include:

  • grey meta text
  • smaller meta text size
  • black title and author text
  • more bottom-padding in card

Template here:

<div class="card bg-white rounded<% if node.status == 4 %> moderated<% end %>">
<div class="card-header">
<%= render partial: 'dashboard/node_moderate', locals: { node: node } %>
<h4><a <% if @widget %>target="_blank"<% end %> href="<%= node.path(:question) %>"><%= node.title %></a></h4>
</div>
<div class="card-footer">
<p class="meta"><%= render partial: "dashboard/node_meta", locals: { node: node } %></p>
</div>

Design questions

Note that questions have tags listed. I think this makes them already quite cluttered and that adding a count of comments might make them even a bit harder to read, but we could do it. Is there anywhere else we could reduce clutter to improve readability? Are we still committed to the topics listing on each card?

For reference, look at how posts are displayed on the dashboard. Do we like the amount of info on each item here?

image

Coding

In any case, instead of making the templates match, we should just start using the regular card template, and add a condition to cover questions:

<% if node.type == 'note' %>
Post by <a <% if @widget %>target="_blank"<% end %> href="/profile/<%= node.author.name %>" style="color: #303030">@<%= node.author.name %></a> <%= node.author.new_contributor %>
<span style="color:darkgray;">
<i class="fa fa-comment-o"></i>
<%= node.comments.size %> &nbsp; | &nbsp; <%= distance_of_time_in_words(node.created_at, Time.current, { include_seconds: false, scope:'datetime.time_ago_in_words' }).gsub('about ','') %>
</span>
<% elsif node.type == 'page' %>

Metadata

Metadata

Assignees

No one assigned

    Labels

    designissue requires more design work and discussion (i.e. mockups and sketches)fto-candidateissues which are meant to be solved by first timers but aren't well-formatted yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions