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

Issue #2508 Build - Front End of 'No Bounties' Placeholder on Gitcoin… #2530

Merged
merged 9 commits into from
Nov 5, 2018
Merged

Conversation

kuhnchris
Copy link
Contributor

… Profile Page

Description

Implements source tree and link incase profile page is empty.
Fixes: #2508

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

web

Testing

See issue thread above for in-progress and final screenshot(s)!

Refers/Fixes

Fixes: #2508

@@ -2237,7 +2237,8 @@ def to_dict(self, activities=True, leaderboards=True, network=None, tips=True):
'works_with_collected': works_with_collected,
'works_with_funded': works_with_funded,
'funded_bounties_count': funded_bounties.count(),
'activities': [{'title': _('No data available.')}],
#'activities': [{'title': _('No data available.')}],

Choose a reason for hiding this comment

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

E265 block comment should start with '# '

@codecov
Copy link

codecov bot commented Oct 25, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2530   +/-   ##
=======================================
  Coverage   29.87%   29.87%           
=======================================
  Files         162      162           
  Lines       12969    12969           
  Branches     1738     1738           
=======================================
  Hits         3874     3874           
  Misses       8971     8971           
  Partials      124      124
Impacted Files Coverage Δ
app/dashboard/models.py 52.37% <ø> (ø) ⬆️

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 5778eb8...fbdf58c. Read the comment docs.

@willsputra
Copy link
Contributor

@thelostone-mc Could you help check? Thanks! 🙂

Copy link
Contributor

@pinkiebell pinkiebell left a comment

Choose a reason for hiding this comment

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

I left some comments 👍

</div>
{% endfor %}
{% else %}
<BR>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change all occurrences into lowercase <br> ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

</div>
{% endfor %}
{% else %}
<BR>
<div class="row" style="justify-content: center"><img width="240px" height="225px" src="http://kuhnchris.eu:8000/static/v2/images/tree.png" /></div><BR>
Copy link
Contributor

Choose a reason for hiding this comment

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

kuhnchris.eu advertising? 😄
Please use {% static "v2/images... like below 👍 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hahaha weird, guess that slipped by me, sorry. ;-) Will change

<div class="description" style="color: #666666; text-align: center">Start working on exciting bounties with the Issue Explorer</div>
<a class="btn btn-xs btn-success pulseClick" href="{% url "explorer" %}" style="background-color: #3E00FF; color: #FFFFFF; margin: 1em 0em 1em 0em; font-size: 1em ">Go to Issue Explorer</a>
</div>
<div style="width: 25%;justify-content: center;margin-right: 1em; padding: 1em; margin-top: 1em;" class="card col-6 col-lg-3">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you try to use our existing CSS rules where possible? (app/assets/v2/css)
We also include bootstrap.css, which means we have something like m-{1,2..} for margin and 'p-{1,2,3..}` for padding etc.
👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we have several predefined classes for margin or padding then, sure, I'll change that. Want me to add the other stuff in custom classes in assets/v2/css or just trying to reduce the amount of style use as much as possible?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just trying to reduce the use of the style attribute ;).
If the existing CSS rules doesn't fit your needs, you can of course use the style attribute or add it to the existing profile.css 👍

</div>
<div style="width: 25%;justify-content: center;margin-right: 1em; padding: 1em; margin-top: 1em;" class="card col-6 col-lg-3">
<img style="margin: 1em;" src="{% static "v2/images/Leaderboard.svg" %}"/>
<div class="description" style="color: #666666; text-align: center">Looking for awesome contributors to work on your project?</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

And for INTL reasons we wrap text nodes with {% trans 'Looking for awesome contributors...' %} .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, can do

@kuhnchris
Copy link
Contributor Author

Thanks @pinkiebell for your review - please, if you got some more spare minutes, check my changes again if those changes work better, I did leave in the width: 25%, but everything else I think I solved via the bootstrap classes.

Copy link
Contributor

@pinkiebell pinkiebell left a comment

Choose a reason for hiding this comment

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

Looks good so far. I left a few comments.
One thing I note is that the buttons inside the cards should be aligned.
Maybe with vertical-align
localhost_8000_profile_root

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

We tend to svgo'ing ( https://github.com/svg/svgo ) these files.
👍

@@ -8,6 +8,7 @@
<link rel="stylesheet" href={% static "v2/css/profile.css" %}>
<link rel="stylesheet" href={% static "v2/css/tag.css" %}>
<link rel="stylesheet" href={% static "v2/css/tabs.css" %}>
<link rel="stylesheet" href={% static "v2/css/noprofile.css" %}>
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔

<div class="row justify-content-center"><img width="240px" height="225px" src="{% static "v2/images/tree.png" %}"/></div><br>
<div class="text-center" style="color: #666666; font-size: 16px">{% trans 'Oops! Looks like this user has not participated in any bounty yet.<br>In the meantime, here are some things you can do:' %}</div><br>
<div class="justify-content-center row">
<div style="width: 25%" class="card col-6 col-lg-3 mt-1 mr-1 p-1 justify-content-center">
Copy link
Contributor

Choose a reason for hiding this comment

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

Almost done 😄

The indentation needs to be fixed,
we have a guide for reference: https://docs.gitcoin.co/mk_contributors/ .

I tested that locally and the footer is broken on views with activities :
localhost_8000_profile_root 1

<div style="width: 25%" class="card col-6 col-lg-3 mt-1 mr-1 p-1 justify-content-center">

<img class="m-1" src="{% static "v2/images/IssueExplorer.svg" %}"/>
<div class="description text-center" style="color: #666666">{% trans 'Start working on exciting bounties with the Issue Explorer' %}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you push the {% trans.. on its own line like

<div .....>
  {% trans '.....' %}
</div>

{% else %}
<br>
<div class="row justify-content-center"><img width="240px" height="225px" src="{% static "v2/images/tree.png" %}"/></div><br>
<div class="text-center" style="color: #666666; font-size: 16px">{% trans 'Oops! Looks like this user has not participated in any bounty yet.<br>In the meantime, here are some things you can do:' %}</div><br>
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably should avoid having html tags inside trans blocks.

<div ....>
  {% trans '.....'  %}
  <br>
  {% trans '.......' %}
</div>

@kuhnchris
Copy link
Contributor Author

Once again - thanks for checking. I cleaned up the HTML a bit more, and tried to use the margin-top: auto to push the buttons to the bottoms. SVGO'd the assets aswell. Also fixed the issue for the activity pages being displayed wrong.
Just a note: the DIVs are all over the place, I tried to use either a XML prettifier or a HTML/ERB Prettifier, but I cannot get the gist of it and it won't handle this file properly...
Please check it carefully, and thanks for your support (sorry for being such a hassle).

Thanks,
Chris

@thelostone-mc thelostone-mc added enhancement This is a feature to be enhanced or improved. frontend This needs frontend expertise. labels Oct 28, 2018
Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

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

left a few comments ^_^ + rebase needed

</div>
</div>
{% else %}
<br>
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a break ? Can we use mt-2 to the below div ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could use a mt-2. I just saw a BR somewhere further above, hence I tried it that way, but, sure, we can go with margins if you prefer them generally.

</div>
</div>
</div>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Could we fix up the indentation ?

</a>
</div>
</div>
<div style="width: 25%" class="card col-6 col-lg-3 mt-1 mr-1 p-1 justify-content-center">
Copy link
Member

Choose a reason for hiding this comment

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

Can we do it without width : 25% ? The col should suffice right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the col would actually cause a 1/3 breakup instead of (empty) card card card (empty). But I could try to create 2 "empty" cols to have a 12.5/25/25/25/12.5 split.

{% trans 'In the meantime, here are some things you can do:' %}
</div><br>
<div class="justify-content-center row">
<div style="width: 25%" class="card col-6 col-lg-3 mt-1 mr-1 p-1 justify-content-center">
Copy link
Member

Choose a reason for hiding this comment

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

Can we do it without width : 25% ? The col should suffice right ?

@pinkiebell
Copy link
Contributor

Once again - thanks for checking. I cleaned up the HTML a bit more, and tried to use the margin-top: auto to push the buttons to the bottoms. SVGO'd the assets aswell. Also fixed the issue for the activity pages being displayed wrong.
Just a note: the DIVs are all over the place, I tried to use either a XML prettifier or a HTML/ERB Prettifier, but I cannot get the gist of it and it won't handle this file properly...
Please check it carefully, and thanks for your support (sorry for being such a hassle).

Thanks,
Chris

No problem, that's review not a hassle. 👍
I guess the prettifiers getting confused from the django template tags.
Anyway, indentation for the rescue 😄

@kuhnchris
Copy link
Contributor Author

image
image
Added your changes @thelostone-mc , if you are ok with those changes I will rebase/squash the commit.

Thanks!

@thelostone-mc
Copy link
Member

@kuhnchris left comments there! if you do that , I'll do the final refactoring needed and we can get this in

@kuhnchris
Copy link
Contributor Author

Sweet, thanks. I'll implement the changes after returning home and notify if it's ready for your part!

All the best,
Chris

@kuhnchris
Copy link
Contributor Author

OK @thelostone-mc , please check once more. If the profile.html now is completly bonkers we might aswell just revert to the original version and simply put the new template in the else-branch, if that makes things easier.

Thanks,
Chris

@thelostone-mc
Copy link
Member

profile.html it would probably take a few more days to get it stable as we are pushing in kudos stuff.
that's why another reason why I wanted the code in a separate template cause it would mean lesser chances of conflicts

just revert to the original version and simply put the new template in the else-branch,

Yes please ^_^
I'll add the final minor tweaks if needed post that and we should be good to go

@kuhnchris
Copy link
Contributor Author

@thelostone-mc reverted profile.html to recent master; cleaned up - please check

@thelostone-mc
Copy link
Member

thelostone-mc commented Nov 1, 2018

@willsputra this is what we've got at this moment
@kuhnchris I've updated the minor fixes! will merge it in after merge freeze is over :)
@PixelantDesign

untitled

@willsputra
Copy link
Contributor

Looks good to me!

@owocki
Copy link
Contributor

owocki commented Nov 4, 2018

code and screenshots LGTM... @kuhnchris i only see partial mobile screenshots tho.. does it look completely good on mobile? does it play nice with the kudos profile changes?

@thelostone-mc
Copy link
Member

@owocki the gif here shows how it looks on mobile!
And yup it would show below the kudos badges if the user has no activity 👍

@owocki owocki merged commit e5d0b3c into gitcoinco:master Nov 5, 2018
@owocki
Copy link
Contributor

owocki commented Nov 5, 2018

this is live now

@kuhnchris
Copy link
Contributor Author

F-ing sweet, but something fucked the SVGs up. :-(
image

@kuhnchris kuhnchris deleted the 2508 branch November 5, 2018 19:48
@owocki
Copy link
Contributor

owocki commented Nov 5, 2018

just redeployed and that seems to have helped

@thelostone-mc
Copy link
Member

Thanks @kuhnchris :D

@willsputra
Copy link
Contributor

Thanks a lot @kuhnchris ! :)

@@ -19,7 +19,7 @@
<div class="row">
<div class="col-12 col-lg-4 profile-header__main-infos">
<div class="clearfix">
<img class="profile-header__avatar mb-1 mr-4" src="{% if profile.avatar and profile.avatar.avatar_url %}{{ profile.avatar.avatar_url }}{% else %}{{ profile.avatar_url }}{% endif %}">
<img class="profile-header__avatar mb-1 mr-4" src="{% if profile.avatar and profile.avatar.avatar_url %}{{ profile.avatar.avatar_url }}{% else %}{{ profile.avatar_url }}{% endif %}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

@kuhnchris img tags don't require closure xD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it depends, are we "just" HTML or XHTML? ;-)
But basically - you are correct.
https://www.w3.org/TR/html5/syntax.html#void-elements

<link rel="stylesheet" href="{% static "v2/css/kudos/styles.css" %}" />
<link rel="stylesheet" href={% static "v2/css/tabs.css" %}>
<link rel="stylesheet" href={% static "v2/css/tabs.css" %} />
Copy link
Contributor

Choose a reason for hiding this comment

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

No syntactical reasoning for adding closures to link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here for "void elements". I always thought every element needs closure, but apparently, not... My bad, sorry.

@mbeacom
Copy link
Contributor

mbeacom commented Nov 6, 2018

Thanks for the fix @kuhnchris

Nit: There is no reason to modify line history for adding closures to img or link as it's not syntactically necessary for HTML moving forward.

@kuhnchris
Copy link
Contributor Author

Pardon! I will refrain from "fixing" HTML from now on. ;-) @mbeacom

@mbeacom
Copy link
Contributor

mbeacom commented Nov 6, 2018

😂 - I'm not suggesting that you don't PR fixes for bugs and syntax refinements. Please don't take it that way... I'm merely saying that we shouldn't migrate void elements to use closures, since it's not syntactically necessary outside of XHTML.

@kuhnchris
Copy link
Contributor Author

Don't worry, I can take it with a grain of salt. 👍
Will fix it with a new PR at a later point.
... except... you want to open a new issue? 👅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is a feature to be enhanced or improved. frontend This needs frontend expertise.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants