Navigation Menu

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

fixes #134: Display license badge even when there is no license url #139

Merged
merged 3 commits into from Oct 3, 2019

Conversation

anku255
Copy link
Contributor

@anku255 anku255 commented Oct 2, 2019

When there is a license name but no license URL, we will show the license badge with href=#.

Example Image:

image

I ran the tests and all tests are passing.

If it is not the desired fix, please let me know and I will update my PR accordingly.

Thank you.

@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #139 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #139   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          24     23    -1     
  Lines         197    196    -1     
  Branches       21     21           
=====================================
- Hits          197    196    -1
Impacted Files Coverage Δ
src/questions/project-demo-url.js

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d67b012...3dbf75c. Read the comment docs.

Copy link
Owner

@kefranabg kefranabg left a comment

Choose a reason for hiding this comment

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

I think some refacto could be done with the license badges. For example for the no-html template, we could have something like:

<% if (licenseName) { -%>
[![License: <%= licenseName %>](https://img.shields.io/<% if (isGithubRepos) { -%>
github/license/<%= authorGithubUsername %>/<%= projectName %><% } else { -%>
badge/License-<%= licenseName %>-yellow.svg
<% } -%>
)](<% if (licenseUrl) { -%>
<%= licenseUrl %><% } else { -%>
#<% } -%>
)
<% } -%> 

Not that easy to understand but it remove duplicated code

@anku255 anku255 requested a review from kefranabg October 3, 2019 06:00
@anku255
Copy link
Contributor Author

anku255 commented Oct 3, 2019

Hi @kefranabg! Thanks for reviewing my code.

I have used the ternary operator to remove the duplicated code. It looked more readable to me than using if statements. If you don't feel the same way then I will use if statements instead.

@kefranabg
Copy link
Owner

@anku255 Way better you're right

Copy link
Owner

@kefranabg kefranabg left a comment

Choose a reason for hiding this comment

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

Thanks for you work!

@kefranabg
Copy link
Owner

@all-contributors please add anku255 for code

@allcontributors
Copy link
Contributor

@kefranabg

I've put up a pull request to add @anku255! 🎉

@kefranabg kefranabg merged commit 536f37f into kefranabg:master Oct 3, 2019
kefranabg added a commit that referenced this pull request Oct 3, 2019
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.

None yet

2 participants