-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
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:
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:
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:
plots2/app/views/questions/_questions.html.erb
Lines 5 to 12 in 5c23901
| <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?
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:
plots2/app/views/notes/_card.html.erb
Lines 39 to 45 in 5c23901
| <% 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 %> | <%= 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' %> |


