Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap tooltips for location tags #9734

Merged
merged 1 commit into from
Jun 6, 2021

Conversation

TildaDares
Copy link
Member

Fixes #9732 (<=== Add issue number here)

Part of larger planning issue #9667

image

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@TildaDares TildaDares requested review from jywarren and RuthNjeri June 4, 2021 12:29
@gitpod-io
Copy link

gitpod-io bot commented Jun 4, 2021

app/models/node_tag.rb Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 4, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@e9a36f6). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 0108e80 differs from pull request most recent head 30e9e2e. Consider uploading reports for the commit 30e9e2e to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9734   +/-   ##
=======================================
  Coverage        ?   49.05%           
=======================================
  Files           ?       98           
  Lines           ?     6112           
  Branches        ?        0           
=======================================
  Hits            ?     2998           
  Misses          ?     3114           
  Partials        ?        0           

@codeclimate
Copy link

codeclimate bot commented Jun 4, 2021

Code Climate has analyzed commit 30e9e2e and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Collaborator

@cesswairimu cesswairimu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me 🎉 🎉 thanks @TildaDares

@jywarren
Copy link
Member

jywarren commented Jun 6, 2021

Agreed! Let's merge!

@@ -11,7 +17,7 @@
<a class="show-more-tags" href="javascript:void(0);"><p style="float:left; color:#666; margin-top:14px; margin-left:5px;"><u><%= tags.length - 2 %> more</u> &nbsp </p></a>
<% end %>

<p class="badge <%= badge_name %> pop more-tags" style="display:none;cursor:pointer;margin-bottom:3px;" id="tag_<%= tag.tid %>" data-toggle="popover" data-trigger="focus" data-count=0 data-placement="top" data-content="<p style='text-align:center;'><a href='/tag/<%= tag.name %>'><%= Tag.tagged_node_count(tag.name) || 0 %> notes</a> - <a href='/contributors/<%= tag.name %>'><%= Tag.contributors(tag.name).count %> people <br></a></p> <p style='text-align:center;font-size:12px;'><%if tag.description %><%= tag.description %> |<% end %> created by <a href='/profile/<%= tag.try(:author).try(:username) %>'><%= tag.try(:author).try(:username) %></a> <%= time_ago_in_words(Time.at(tag.date)) %> ago </p><div class='text-center'><a href='/subscribe/tag/<%= tag.name %>' class='btn btn-primary'>Follow</a></div>" data-html="true" title="<%= tag.name %>">
<p class="badge <%= badge_name %> pop more-tags" style="display:none;cursor:pointer;margin-bottom:3px;" id="tag_<%= tag.tid %>" data-toggle="popover" data-trigger="focus" data-count=0 data-placement="top" data-content="<p style='text-align:center;'><a href='/tag/<%= tag.name %>'><%= Tag.tagged_node_count(tag.name) || 0 %> notes</a> - <a href='/contributors/<%= tag.name %>'><%= Tag.contributors(tag.name).count %> people <br></a></p><% if tag.location_tag? %><p>This is a geographical tag for placing this content on a map. Please visit our <a href='https://publiclab.org/wiki/location-privacy'>location privacy</a> page. </p><% end %> <p style='text-align:center;font-size:12px;'><%if tag.description %><%= tag.description %> |<% end %> created by <a href='/profile/<%= tag.try(:author).try(:username) %>'><%= tag.try(:author).try(:username) %></a> <%= time_ago_in_words(Time.at(tag.date)) %> ago </p><div class='text-center'><a href='/subscribe/tag/<%= tag.name %>' class='btn btn-primary'>Follow</a></div>" data-html="true" title="<%= tag.name %>">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple ideas here, i think it's not possible in the attribute to break this onto multiple lines, but are there any other follow-ups we could do to make this more readable?

Also, shall we try to put this text into the translation system?

Great work!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jywarren The data-content attribute is still long but it's an improvement

<p 
  class="badge <%= badge_name %> pop more-tags"  
  style="display:none;cursor:pointer;margin-bottom:3px;" 
  id="tag_<%= tag.tid %>" 
  data-toggle="popover" 
  data-trigger="focus" 
  data-count=0 
  data-placement="top" 
  data-content="<p style='text-align:center;'><a href='/tag/<%= tag.name %>'><%= Tag.tagged_node_count(tag.name) || 0 %> notes</a> - <a href='/contributors/<%= tag.name %>'><%= Tag.contributors(tag.name).count %> people <br></a></p><% if tag.location_tag? %><p>This is a geographical tag for placing this content on a map. Please visit our <a href='https://publiclab.org/wiki/location-privacy'>location privacy</a> page. </p><% end %> <p style='text-align:center;font-size:12px;'><%if tag.description %><%= tag.description %> |<% end %> created by <a href='/profile/<%= tag.try(:author).try(:username) %>'><%= tag.try(:author).try(:username) %></a> <%= time_ago_in_words(Time.at(tag.date)) %> ago </p><div class='text-center'><a href='/subscribe/tag/<%= tag.name %>' class='btn btn-primary'>Follow</a></div>" 
  data-html="true" 
  title="<%= tag.name %>"
 >

I'll also work on putting the text into the translation system.

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discussion] Add Bootstrap Tooltips to Location Tags
3 participants