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

Fix same CSS Id "#username-signup" #4680

Closed
5 tasks
rexagod opened this issue Jan 21, 2019 · 7 comments
Closed
5 tasks

Fix same CSS Id "#username-signup" #4680

rexagod opened this issue Jan 21, 2019 · 7 comments
Labels
CSS first-timers-only They need to be well-formatted using the First-timers_Issue_Template. good first issue

Comments

@rexagod
Copy link
Member

rexagod commented Jan 21, 2019

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • 🙋 Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!

  • 📝 Update: It looks like we have rather two different elements with the same Ids! I think replacing one of these with some other Id and fixing the snippet where it's being used should fix the problem.
    plots2id

The Ids are created in these two files.

./app/views/user_sessions/new.html.erb:
   16      <div class="form-group">
   17        <label for="username"><%= t('user_sessions.new.username') %></label>
   18:       <%= f.text_field :username, { tabindex: 1, placeholder: "Username", class: 'form-control', id: 'username-signup', style: 'width: 85%' } %>
   19        <label for="password"><%= t('user_sessions.new.password') %></label>
   20        <%= f.password_field :password, { tabindex: 2,placeholder: "Password",class: 'form-control', id: 'password-signup', style: 'width: 85%', onpaste: 'return false;' } %>

./app/views/users/_create_form.html.erb:
   32        <div class="form-group col-sm-12" id="username_div">
   33          <label for="username"><%= t('user_sessions.new.username') %></label>
   34:         <%= f.text_field :username, { tabindex: 1, placeholder: "Username", class: 'form-control', id: 'username-signup' } %>
   35        </div>
   36  

And the DOM manipulation is done here, which needs to replaced properly with the two seperate Ids accordingly (in place of #username-signup).

./app/views/layouts/_header.html.erb:
  225  
  226      $("#toLogin").click(function(){ //Function runs when the "login" buttin in the signup modal is clicked
  227:       var user = $("#signupContainer").find("#username-signup").val(); //Username and password data is transferred to the other partial
  228        var pass = $("#signupContainer").find("#password").val();
  229        showLogin(); // Modal switches to login view
  230:       $("#loginContainer").find("#username-signup").val(user);
  231        $("#loginContainer").find("#password-signup").val(pass);
  232      });
  233  
  234      $("#toSignup").click(function(){ //Function runs when the "sign up to join" link in the login modal is clicked
  235:       var user = $("#loginContainer").find("#username-signup").val(); //Username and password data is transferred to the other partial
  236        var pass = $("#loginContainer").find("#password-signup").val();
  237        showSignup(); // Modal switches to sign up view
  238:       $("#signupContainer").find("#username-signup:visible").val(user);
  239        $("#signupContainer").find("#password").val(pass);
  240        ;
  • 💾 Commit your changes

  • 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • 🏁 Done Ask in comments for a review :)

🤔❓ Questions?

Leave a comment below!

Is someone else already working on this?

We encourage you to link to this issue by mentioning the issue # in your pull request, so we can see if someone's already started on it. If someone seem stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

@rexagod rexagod added first-timers-only They need to be well-formatted using the First-timers_Issue_Template. CSS labels Jan 21, 2019
@Chrisyee22
Copy link
Contributor

Can I work on this?

@rexagod
Copy link
Member Author

rexagod commented Jan 22, 2019

I think you're currently assigned to #4681. Please leave this for any new contributors. Thanks!

@jdevo23
Copy link
Contributor

jdevo23 commented Jan 22, 2019

Can I claim this one?

@rexagod
Copy link
Member Author

rexagod commented Jan 22, 2019

Hello @jdevo23! Go ahead!!

@jywarren
Copy link
Member

jywarren commented Jan 22, 2019 via email

@arungoel123456
Copy link
Contributor

@jywarren is this issue resolved ?
If not can i please work on this issue

@grvsachdeva
Copy link
Member

grvsachdeva commented Jan 26, 2019

Hi @arungoel123456, this issue is just about to be completed, so please search https://code.publiclab.org/#r=all for finding more FTO issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS first-timers-only They need to be well-formatted using the First-timers_Issue_Template. good first issue
Projects
None yet
Development

No branches or pull requests

7 participants