publiclab / infragram

A minimal core of the Infragram.org project in JavaScript
https://infragram.org/sandbox/
GNU General Public License v2.0
46 stars 165 forks source link

Place Ask a Question button #301

Open komal3120 opened 2 years ago

komal3120 commented 2 years ago

Screenshot from 2022-04-01 13-31-01

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! Please follow the issue template to help us help you 👍🎉😄 If you have screenshots to share demonstrating the issue, that's really helpful! 📸 You can make a gif too!

vincent-simon commented 2 years ago

Actually I find the whole Q&A section and its behavior a little bit funny. I think that as @komal3120 mentioned the Ask Question button should be strategically placed on the top right corner of the page so that it is used much more.

Further I feel that after pressing on the button it should hyperlink to the page in a new tab instead of the Q&A section itself.

@jywarren @TildaDares please share your opinions on the same.

jywarren commented 2 years ago

Hi @vincent-simon the button is placed at the bottom because it uses the design from PublicLab.org (it's actually an iframe) as you can see at https://publiclab.org/wiki/infragram#Questions

The question button could go on top, but we might have to add our own custom button in addition to the one at the bottom. But one advantage to having it at the bottom is to encourage people to skim through other questions before posting, so there are fewer duplicates. What do you think of that?

I definitely agree that it should open in a new page. I think we would need to make that change on PublicLab.org's repository, though - on this line:

https://github.com/publiclab/plots2/blob/cf10caaefb78b631c15a54f44ec35e9a77d2bbdb/app/views/grids/_nodes.html.erb#L16

We should really break that out into its own issue, but for reference, to do it, we could add a ruby conditional like:

<% if params[:action] == "gridsEmbed" %> target="_blank"<% end %>

I think that's the correct code for a new tab, right? If so, then we'd be displaying it that way ONLY if the table is embedded in an iFrame, not in normal use on pages like https://publiclab.org/infragram. Does that make sense?

image
girija0707 commented 2 years ago

Hi @vincent-simon the button is placed at the bottom because it uses the design from PublicLab.org (it's actually an iframe) as you can see at https://publiclab.org/wiki/infragram#Questions

The question button could go on top, but we might have to add our own custom button in addition to the one at the bottom. But one advantage to having it at the bottom is to encourage people to skim through other questions before posting, so there are fewer duplicates. What do you think of that?

I definitely agree that it should open in a new page. I think we would need to make that change on PublicLab.org's repository, though - on this line:

https://github.com/publiclab/plots2/blob/cf10caaefb78b631c15a54f44ec35e9a77d2bbdb/app/views/grids/_nodes.html.erb#L16

We should really break that out into its own issue, but for reference, to do it, we could add a ruby conditional like:

<% if params[:action] == "gridsEmbed" %> target="_blank"<% end %>

I think that's the correct code for a new tab, right? If so, then we'd be displaying it that way ONLY if the table is embedded in an iFrame, not in normal use on pages like https://publiclab.org/infragram. Does that make sense?

image

hello @jywarren and @TildaDares can we open the Q&A in new tab using javascript with the help of window.open function

jywarren commented 2 years ago

Hi @komal3120 I think that's possible, can you test it out? The other solution is to use the target="_blank" attribute, described here; https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target

Thank you!

komal3120 commented 2 years ago

Yes, Can I start work on this issue?