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

Refactoring profile.html.erb code pt.2 #4342

Closed
6 tasks
sashadev-sky opened this issue Dec 19, 2018 · 4 comments
Closed
6 tasks

Refactoring profile.html.erb code pt.2 #4342

sashadev-sky opened this issue Dec 19, 2018 · 4 comments
Labels
first-timers-only They need to be well-formatted using the First-timers_Issue_Template. help wanted requires help by anyone willing to contribute

Comments

@sashadev-sky
Copy link
Member

sashadev-sky commented Dec 19, 2018

First Time?

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.

The problem

Our code in app/views/users/profile.html.erb is very verbose... we could use some refactoring

We can start by refactoring out a re-occuring line from the code. For now, the 1st line of:

<% if @profile_user && current_user && @profile_user == current_user %>
<button data-toggle="modal" data-target="#socialModal" class="btn btn-default btn-block">Link Social media</button>
<div class="modal fade" id="socialModal" tabindex="-1" role="dialog" aria-labelledby="socialModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="socialModal">Link Social media</h5>
</div>

Solution

What to change it to:

Refactor the line in the code block found in the "The Problem" section to use your new helper method instead.

That line can be updated to <% if current_profile_user %>

Thanks!!

Steps to Fix

  • Claim this issue with a comment here, below, and ask any clarifying questions you need
  • Fork the repository and set it up locally following the main repo README instructions https://github.com/publiclab/plots2
  • Create a new feature branch with a unique name descriptive to the issue
  • Try to fix the issue following the steps above, but even before you're done, you can:
    commit your changes to your branch and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
  • Reference this issue in your pull request body
  • Once you submit your pull request, an additional checklist will be provided for getting it merged

💬 Get help

If you need any help - here are some options:

@grvsachdeva grvsachdeva added first-timers-only They need to be well-formatted using the First-timers_Issue_Template. help wanted requires help by anyone willing to contribute labels Dec 21, 2018
@dtlight
Copy link

dtlight commented Dec 22, 2018

I'm yet to make an opensource contribution so this'd warm me up. May I claim this?

@grvsachdeva
Copy link
Member

Hi @dave-light, please go ahead. And, Welcome to Public Lab and Open Source World 🌐 🌎 .

@mzmmlds
Copy link
Member

mzmmlds commented Dec 23, 2018

@dave-light : are you on it? or may claim this?

@dtlight
Copy link

dtlight commented Dec 24, 2018

Hey @mzmmlds, I'm on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-timers-only They need to be well-formatted using the First-timers_Issue_Template. help wanted requires help by anyone willing to contribute
Projects
None yet
Development

No branches or pull requests

4 participants