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

Modified views for Q & A Pages #628

Merged
merged 13 commits into from
Aug 16, 2016
Merged

Conversation

ananyo2012
Copy link
Member

@ananyo2012 ananyo2012 commented Jul 23, 2016

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

  • tests pass -- rake test
  • code is in uniquely-named feature branch, and has been rebased on top of latest master (especially if you've been asked to make additional changes)
  • pull request are descriptively named
  • if possible, multiple commits squashed if they're smaller changes
  • reviewed/confirmed/tested by another contributor or maintainer
  • development.sqlite.example has been updated if any database migrations were added

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

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays. Please alert developers on plots-dev@googlegroups.com when your request is ready or if you need assistance.

Thanks!

@ananyo2012
Copy link
Member Author

This is the Recently answered view for the questions index page
recently_answered_v1

@@ -66,11 +66,11 @@ def like_count
end

def liked_notes
DrupalNode.includes(:node_selections).where("type = 'note' AND node_selections.liking = true AND node_selections.user_id = ? AND node.status = 1", self.uid).order('node_selections.nid DESC')
DrupalNode.includes(:node_selections).where("type = 'note' AND node_selections.liking = ? AND node_selections.user_id = ? AND node.status = 1", true, self.uid).order('node_selections.nid DESC')
Copy link
Member Author

@ananyo2012 ananyo2012 Jul 23, 2016

Choose a reason for hiding this comment

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

Had to make this change because the sqlite db was showing an error probably because it wasn't taking true as a boolean. So the likes page was'nt rendering when using the sqlite db.

Copy link
Member

Choose a reason for hiding this comment

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

perfect, good catch.

@ananyo2012 ananyo2012 force-pushed the q_and_a_views branch 2 times, most recently from a3c21ea to 98e696f Compare July 23, 2016 03:39
@@ -18,7 +18,7 @@
<% end %>
</span>
<p style="margin-top:30px;"><% if logged_in_as(['admin','moderator']) %><a class="btn btn-default btn-xs" href="/moderate/spam/<%= node.id %>"><i class="fa fa-ban"></i> Spam</a><% end %>
<a href="#" class="btn btn-default btn-xs">Post an answer</a></p>
<a href="<%= node.path(:question) %>#post-answer" class="btn btn-default btn-xs">Post an answer</a></p>
Copy link
Member Author

Choose a reason for hiding this comment

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

Wierd! the Post an answer link that I added was somehow reverted in any previous changes. I added it back. Nevertheless it previously wan't correct so I put the correct one this time.

link = "<span class='pull-left'><i data-url='" + match.path(:question) +
"' class='fa fa-question-circle'></i> " + match.title + "</span>"
link = "<i data-url='" + match.path(:question) +
"' class='fa fa-question-circle'></i> " + match.title
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes the problem of dropdown link in the questions search box which is not working currently.

@ananyo2012 ananyo2012 force-pushed the q_and_a_views branch 2 times, most recently from 365a770 to 272954e Compare July 27, 2016 15:30
@ananyo2012
Copy link
Member Author

Also includes commits from #636.

@jywarren
Copy link
Member

what if:

  1. Answered questions were clearly marked as Answered (maybe with the same green indicator used on the Answer?)
  2. Profiles just had an "Questions" tab, then two sections below for Answered and Asked?

@ananyo2012
Copy link
Member Author

Yeah it's a good idea Jeff. I will work on it. I was thinking of the
listing the answers in the profile page too. So should we list the quoted
answer somewhere near the questions for the Answered section?

On Thu, Jul 28, 2016 at 10:09 PM, Jeffrey Warren notifications@github.com
wrote:

what if:

Answered questions were clearly marked as Answered (maybe with the
same green indicator used on the Answer?)
2.

Profiles just had an "Questions" tab, then two sections below for
Answered and Asked?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#628 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AKACR2fApXECw4dCcz1ALjQ5YFxJhJifks5qaNs0gaJpZM4JTQnt
.

@jywarren
Copy link
Member

Hmm, that would be a lot to show; maybe we could just say "Answered by
username" or "6 proposed answers" ?

On Thu, Jul 28, 2016 at 12:42 PM, Ananya Maiti notifications@github.com
wrote:

Yeah it's a good idea Jeff. I will work on it. I was thinking of the
listing the answers in the profile page too. So should we list the quoted
answer somewhere near the questions for the Answered section?

On Thu, Jul 28, 2016 at 10:09 PM, Jeffrey Warren <notifications@github.com

wrote:

what if:

Answered questions were clearly marked as Answered (maybe with the
same green indicator used on the Answer?)
2.

Profiles just had an "Questions" tab, then two sections below for
Answered and Asked?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#628 (comment),
or mute
the thread
<
https://github.com/notifications/unsubscribe-auth/AKACR2fApXECw4dCcz1ALjQ5YFxJhJifks5qaNs0gaJpZM4JTQnt

.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#628 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABfJyF2F92HIfHAA_YQSGaS9F7DQcfBks5qaNwMgaJpZM4JTQnt
.

@ananyo2012
Copy link
Member Author

Yes that's a better idea; just linking the answer with a text.

On Thu, Jul 28, 2016 at 10:16 PM, Jeffrey Warren notifications@github.com
wrote:

Hmm, that would be a lot to show; maybe we could just say "Answered by
username" or "6 proposed answers" ?

On Thu, Jul 28, 2016 at 12:42 PM, Ananya Maiti notifications@github.com
wrote:

Yeah it's a good idea Jeff. I will work on it. I was thinking of the
listing the answers in the profile page too. So should we list the quoted
answer somewhere near the questions for the Answered section?

On Thu, Jul 28, 2016 at 10:09 PM, Jeffrey Warren <
notifications@github.com

wrote:

what if:

Answered questions were clearly marked as Answered (maybe with the
same green indicator used on the Answer?)
2.

Profiles just had an "Questions" tab, then two sections below for
Answered and Asked?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#628 (comment),
or mute
the thread
<

https://github.com/notifications/unsubscribe-auth/AKACR2fApXECw4dCcz1ALjQ5YFxJhJifks5qaNs0gaJpZM4JTQnt

.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#628 (comment),
or mute
the thread
<
https://github.com/notifications/unsubscribe-auth/AABfJyF2F92HIfHAA_YQSGaS9F7DQcfBks5qaNwMgaJpZM4JTQnt

.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#628 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AKACRw9IXqNtYR_9E9DpahAmuPdeFIkQks5qaNz_gaJpZM4JTQnt
.

@jywarren
Copy link
Member

Shall I merge this now, or do you want to keep working on it? (or in another PR later?)

@ananyo2012
Copy link
Member Author

@jywarren Please wait till I complete all the features.

@ananyo2012
Copy link
Member Author

Probably it will be ready for merge by Tuesday.

@jywarren
Copy link
Member

Perfect, no problem.

On Jul 29, 2016 2:34 PM, "Ananya Maiti" notifications@github.com wrote:

Probably it will be ready for merge by Tuesday.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#628 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABfJ4m81rQiPLA9MrsT9jbMt3HWT2-Nks5qakelgaJpZM4JTQnt
.

@ananyo2012
Copy link
Member Author

ananyo2012 commented Aug 2, 2016

@jywarren Just some clarifications on what you asked

Answered questions were clearly marked as Answered (maybe with the same green indicator used on the Answer?)

When will a question marked as answered? When there is atleast one answer or when it is marked as accepted by the question author?

@jywarren
Copy link
Member

jywarren commented Aug 2, 2016

When an answer is accepted. Thanks!

@ananyo2012
Copy link
Member Author

@jywarren This is almost complete. Just need to add some more tests. You can review it in the mean time. I am posting the screenshots for the modified views below.

@ananyo2012
Copy link
Member Author

I have already posted a screenshot of the recently answered view. Link to the question page is added in the navbar under the Projects tab. The question links in dashboard now link to the new question views. Also the Ask question links in the Dashborad and tags page link to the question post page now.

@jywarren
Copy link
Member

It doesn't look like we have a test for admin (as opposed to a moderator) approving a first-timer post. I've added one and it seems to pass, so I'm not sure what's up. Maybe we should add one for approving a first-timer question, not a normal note.

@ananyo2012
Copy link
Member Author

@jywarren Updated and rebased on the latest master. Here is the screenshot
profile_answered_v3 2

@jywarren
Copy link
Member

Oh, i'm sorry, i meant green outlining of the Accepted badge, not the answers by user. Answers by user looks perfect, just needs the same color as the (?) icon -- not light green.Accepted` could be green borders with transparent interior, and on its own line.

Looking great on spacing, though!

@ananyo2012
Copy link
Member Author

@jywarren Ok updating it. I am also trying to look at the issue you mentioned. It looks like I have missed something for the first timer questions.

@jywarren
Copy link
Member

Ok, good luck! I am about to board a plane so won't be checking in again
today. Thanks as usual!

On Aug 14, 2016 3:00 PM, "Ananya Maiti" notifications@github.com wrote:

@jywarren https://github.com/jywarren Ok updating it. I am also trying
to look at the issue you mentioned. It looks like I have missed something
for the first timer questions.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#628 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABfJ_vxtUCieVxoCaQ2Zxu3lPrfxmG2ks5qfy2PgaJpZM4JTQnt
.

@ananyo2012
Copy link
Member Author

@jywarren Yes it is really looking great this way now.
profile_answered_v3 3

@ananyo2012
Copy link
Member Author

@jywarren First timer questions are now visible to admins in the questions index page. I have also modified the tests to justify it. Also flash messages are displayed while approving the first timer questions through proper redirects. Also added test for admin controller to support it.

Mark question as answered when an answer is accepted
Modify sort_questions_by_tag method to improve efficiency
Link tags in questions to 'question' tag views
Add post path to question from submit action

Use javascript submit only for input field on submit to question search
Add integration test for question sort feature

Fix failing tests caused due to the changes
Redirect question to question path while publishing first-timer-questions

Add functional test for admin controller
@ananyo2012
Copy link
Member Author

I have also changed the Answered label in the questions view similar to that in the profile answered views.
profile_asked_v2 1

@jywarren
Copy link
Member

Great, i'll do final review and merge tomorrow. Great work!

On Sun, Aug 14, 2016 at 10:23 PM, Ananya Maiti notifications@github.com
wrote:

I have also changed the Answered label in the questions view similar to
that in the profile answered views.
[image: profile_asked_v2 1]
https://cloud.githubusercontent.com/assets/10486343/17652176/5df9974c-6293-11e6-9094-87e6cc3225de.png


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#628 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABfJ-HYo0Bq05zSmCRzDkKajLwy38iJks5qf4c4gaJpZM4JTQnt
.

@jywarren jywarren merged commit dbc1717 into publiclab:master Aug 16, 2016
@jywarren
Copy link
Member

💯 merged!! I made some small final style tweaks, and hope to publish tonight. GREAT WORK, ananyo! Reach out to Liz and Stevie and ask them to help you test it out once it's published. I'll alert you.

@ananyo2012
Copy link
Member Author

Thanks Jeff! I was thining of adding some documentation for Q & A in the
same PR. Anyways I will make a new one for it.

On Wed, Aug 17, 2016 at 3:42 AM, Jeffrey Warren notifications@github.com
wrote:

💯 merged!! I made some small final style tweaks, and hope to publish
tonight. GREAT WORK, ananyo! Reach out to Liz and Stevie and ask them to
help you test it out once it's published. I'll alert you.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#628 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AKACR4_hAx8FF2aqtvL7SndIPgQv8r_Dks5qgjXjgaJpZM4JTQnt
.

@ananyo2012 ananyo2012 deleted the q_and_a_views branch August 16, 2016 22:40
@ananyo2012 ananyo2012 modified the milestone: Q & A Project Aug 22, 2016
jywarren added a commit that referenced this pull request Apr 27, 2021
* Remove outdated query as code in #628 no longer used, fixes #9571

* Update _question.html.erb
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
…lab#9572)

* Remove outdated query as code in publiclab#628 no longer used, fixes publiclab#9571

* Update _question.html.erb
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
…lab#9572)

* Remove outdated query as code in publiclab#628 no longer used, fixes publiclab#9571

* Update _question.html.erb
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.

2 participants