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

example powertag dropdown [WIP] #1558

Merged
merged 3 commits into from
Aug 4, 2017

Conversation

shelbyfirebaugh
Copy link
Collaborator

@shelbyfirebaugh shelbyfirebaugh commented Aug 1, 2017

Beginning of a solution: fixes #496

We just added the Bootstrap example code for a dropdown menu in a new file called _advanced_tagging.html.erb.

We added it just in the format of a normal HTML page, since we don't know the correct syntax to use for .erb files. It also is not clickable at the moment, as we also don't know how to actually call the powertag functions. Is Active Record Querying the solution that we should be looking at?

Any suggestions on how we should proceed would be greatly appreciated!

  • all tests pass -- rake test:all
  • 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 is descriptively named with #number reference back to original issue

@shelbyfirebaugh
Copy link
Collaborator Author

shelbyfirebaugh commented Aug 1, 2017

Also, this is what we got when running the tests. Should we proceed with rake:db migrate ?

@jywarren

screen shot 2017-08-01 at 13 16 01

@jywarren
Copy link
Member

jywarren commented Aug 1, 2017

Looks great! Yes, try rake db:migrate - and can you remove the npm debug file that's included?

Are you able to start the application with passenger start on your local machine?

Thanks!

@jywarren
Copy link
Member

jywarren commented Aug 1, 2017

And you should only need rake test, not the "all" option. Hope that helps!

@shelbyfirebaugh
Copy link
Collaborator Author

I ran rake db:migrate:

screen shot 2017-08-01 at 13 52 53

Then I ran rake test and got these errors:

screen shot 2017-08-01 at 13 51 18

Then I ran passenger start. It says I have an error, but that path that it specifies isn't a file that I edited. It also still says I'm not running mysql, if that matters.

screen shot 2017-08-01 at 13 48 24

@PublicLabBot
Copy link

PublicLabBot commented Aug 1, 2017

3 Messages
📖 @shelbyfirebaugh Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution!
📖 This pull request doesn’t link to a issue number. Please refer to the issue it fixes (if any) in the body of your PR, in the format: Fixes #123.
📖 Pull Request is marked as Work in Progress

Generated by 🚫 Danger

@shelbyfirebaugh shelbyfirebaugh changed the title example powertag dropdown example powertag dropdown [WIP] Aug 1, 2017
@jywarren
Copy link
Member

jywarren commented Aug 1, 2017

you probs need to run bower install to get bootstrap

@jywarren
Copy link
Member

jywarren commented Aug 1, 2017

  1. lets strip out the start and end tags, so just lines 17-27
  2. on line 20 of this file, add your dropdown partial with <%= render partial: "tag/advanced_tagging" %>
  3. we can put the render... line inside a secret <% if params[:potter] %>...<% end %> so that you have to add ?potter=harry to the end in order to test it out on the live site
  4. lets try adding style:fancy --like: <a href="#" onClick="addTag(...)">Tag 1</a> -- using example here

@jywarren jywarren mentioned this pull request Aug 1, 2017
5 tasks
@jywarren
Copy link
Member

jywarren commented Aug 3, 2017

Forgot to mention -- you can view the tagging partial on any note or wiki page, and I'll paste in a link to the relevant lines of code -- sorry should've done that already!

@shelbyfirebaugh
Copy link
Collaborator Author

okay, so yesterday we met with our coach Katie and were trying to make it so that the changes that i have made would show up on my local version of the app. so my file _advanced_tagging.html.erb is rendered as a partial inside of the file _tagging.html.erb. but after lots of digging, Katie said that she couldn't find a place where the _tagging partial is actually rendered, and thus _advanced_tagging as well. if you know that there is somewhere that it's being rendered, could you please point us to that path?

aside from that issue, we are unsure of how to approach the issue of defining the parameters to make the code only visible when you add something to the end of the url. Katie wanted to know where we would need to define the route for that, or if there is some other way that we should address this issue

@jywarren
Copy link
Member

jywarren commented Aug 3, 2017

So for example, on wiki pages like /wiki/_____ (you should be able to see a list of all at /wiki), you'll see the tagging interface below the main body content. But only if you're logged in!

That partial include is here: https://github.com/publiclab/plots2/blob/master/app/views/wiki/show.html.erb#L84

@shelbyfirebaugh
Copy link
Collaborator Author

shelbyfirebaugh commented Aug 3, 2017

wow okay we were definitely just on the wrong page, it works now! but could you just explain a little bit about why typing ?potter=harry at the end works even though we only defined the parameters to be potter?

@jywarren
Copy link
Member

jywarren commented Aug 4, 2017

Wow, cool! Does this work, can you see it on your local install? Is it ready to publish? This one is pretty straightforward, but sometimes with UI related work, it's helpful to attach a screenshot so I or another reviewer can get a look without having to pull the whole thing first.

But if this looks good I'll merge it in! Fantastic! And we can check it off the list at #1560.

@shelbyfirebaugh
Copy link
Collaborator Author

shelbyfirebaugh commented Aug 4, 2017 via email

@jywarren
Copy link
Member

jywarren commented Aug 4, 2017

Awesome -- I think this is all good though, since it'll be hidden. I'm going to merge!

@jywarren jywarren merged commit 96126c2 into publiclab:master Aug 4, 2017
@jywarren
Copy link
Member

jywarren commented Aug 4, 2017

🎈 🎉 Thanks! And onward to #1560 :-)

@jywarren
Copy link
Member

jywarren commented Aug 5, 2017

Great -- this is live now -- https://publiclab.org/wiki/sandbox?potter=harry

It's not exactly as I'd imagined -- there was a way I'd seen in Bootstrap for the button to be kind of attached to the input form, on the same line. Like these: http://getbootstrap.com/components/#input-groups-buttons-dropdowns

But the potter hidden thingy is working perfectly! https://publiclab.org/wiki/sandbox

Kudos -- you should share this out with your demo in my request for 1-line updates! @lilliankorinek @shelbyfirebaugh great work.

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.

dropdown menu for "power tags"
3 participants