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

Image added to the post #735

Merged
merged 1 commit into from
Jun 26, 2019
Merged

Conversation

divyabaid16
Copy link
Contributor

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

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/mapknitter-reviewers for help, in a comment below

Thanks!

@codeclimate
Copy link

codeclimate bot commented Jun 22, 2019

Code Climate has analyzed commit 3dc2417c and detected 0 issues on this pull request.

View more on Code Climate.

@divyabaid16
Copy link
Contributor Author

The post after image is uploaded will look like:
Selection_188

@@ -82,7 +82,7 @@
</button>

<!-- Write a research note on Public Lab -->
<a target="_blank" class="btn btn-outline-secondary" title="Post a research note on Public Lab" href="//publiclab.org/post?title=MapKnitter map of <%= @map.name %>&tags=lat:<%= @map.lat %>,lon:<%= @map.lon %>,mapknitter&body=%3Ciframe%20src=%22https://mapknitter.org/embed/<%= @map.slug %>%22%20style=%22border:none%22%20width=%22100%25%22%20height=%22400px%22%3E%3C/iframe%3E%3Cbr /%3E%3Cbr /%3E<%= @map.description %>%3Cbr /%3Ehttps://mapknitter.org/embed/<%= @map.slug %>" type="button">
<a target="_blank" class="btn btn-outline-secondary" title="Post a research note on Public Lab" href="//publiclab.org/post?title=MapKnitter map of <%= @map.name %>&tags=lat:<%= @map.lat %>,lon:<%= @map.lon %>,mapknitter&body=<img src='<%= @map.warpables.first.image.url(:medium) %>'></img>%3Ciframe%20src=%22https://mapknitter.org/embed/<%= @map.slug %>%22%20style=%22border:none%22%20width=%22100%25%22%20height=%22400px%22%3E%3C/iframe%3E%3Cbr /%3E%3Cbr /%3E<%= @map.description %>%3Cbr /%3Ehttps://mapknitter.org/embed/<%= @map.slug %>" type="button">
Copy link
Member

Choose a reason for hiding this comment

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

Here, do we have to encode the < characters as %3C and such? I saw you tested it, so maybe it just works, but I guess I'd worry about it rendering properly with nested < chars... did you just try the URL or did you click on it in the page? Thanks!!!

@divyabaid16
Copy link
Contributor Author

Hi @jywarren
I changed my code as per your suggestion and it's working fine.
Thank you for always guiding me :)
It's weird that it was working in both the ways with < and with %3C.

@jywarren
Copy link
Member

Yeah I dunno why! But ok sounds great. Thanks!!!

@jywarren jywarren merged commit 5f59c7e into publiclab:main Jun 26, 2019
@divyabaid16 divyabaid16 deleted the image-button branch July 6, 2019 16:27
chen-robert pushed a commit to chen-robert/mapknitter that referenced this pull request Dec 5, 2019
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.

Collection of bug reports/input from Mapping Fellows (Community Atlas)
2 participants