infragram icon indicating copy to clipboard operation
infragram copied to clipboard

Place Ask a Question button

Open komal3120 opened this issue 2 years ago • 6 comments

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

  • Currently Ask a Question or help answer future questions on this topic placed at bottom of scroll bar and we have to scroll then we will find it. This is not visible to user all the time.

  • This is little unclear. This should be always visible to user and we can place it at top right side or bottom right side of the section. I want to fix this issue you can assign this to me.

komal3120 avatar Apr 01 '22 08:04 komal3120

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!

welcome[bot] avatar Apr 01 '22 08:04 welcome[bot]

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.

vincent-simon avatar Apr 01 '22 10:04 vincent-simon

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

jywarren avatar Apr 05 '22 19:04 jywarren

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

girija0707 avatar Apr 08 '22 15:04 girija0707

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!

jywarren avatar Apr 12 '22 20:04 jywarren

Yes, Can I start work on this issue?

komal3120 avatar Apr 13 '22 10:04 komal3120