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

Restructure site #45

Closed
wants to merge 1 commit into from
Closed

Conversation

ashwini0529
Copy link
Member

Fixes #44

screencapture-localhost-8000-1513244690996

Copy link
Member

@Monal5031 Monal5031 left a comment

Choose a reason for hiding this comment

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

Don't push .DS_Store and .idea files 😛

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
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 all this .idea/ stuff?

Copy link
Member

Choose a reason for hiding this comment

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

Creating an issue for it (gitignore)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so. Editor added files I guess. :/

@@ -1,41 +0,0 @@
<!doctype html>
Copy link
Member

Choose a reason for hiding this comment

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

please leave the activity/ area in place. it will grow. you can include the one activity widget on the front page to fill the white space, but it also needs to be on activity/

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay.

Copy link
Member

@jayvdb jayvdb left a comment

Choose a reason for hiding this comment

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

remove .DS_Store and can you load materialize from a CDN instead of putting it in the repo

Copy link
Member

@Monal5031 Monal5031 left a comment

Choose a reason for hiding this comment

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

Keep CSS separate from templates

<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="../static/css/materialize.min.css" media="screen,projection"/>
<style>
nav {
Copy link
Member

Choose a reason for hiding this comment

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

Please create a new style.css for this don't include CSS in here, we may need to add new things in future.

@ashwini0529
Copy link
Member Author

@Monal5031 done!
@jayvdb Done! 😄

@jayvdb
Copy link
Member

jayvdb commented Dec 14, 2017

Isn't coala allowed?

No. it is a generic community website which other orgs can fork and use without customisation. (see GCI task ).
We derive the org name from the repo name. This is already done for you by the build, and org_name.txt is created, and can be used.

.gitignore Outdated
@@ -103,3 +103,4 @@ ENV/
_site/
/public/
org_name.txt
.idea
Copy link
Member

Choose a reason for hiding this comment

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

Separate issue for it is there #46 revert this change

-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
Copy link
Member

Choose a reason for hiding this comment

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

newline please 😛

@@ -0,0 +1,13 @@
nav {
Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry, just realised we already have a main.css we should keep this there. Sorry 😓

@Monal5031
Copy link
Member

@ashwini0529 .DS_Store is still there 😓 .

@ashwini0529
Copy link
Member Author

@jayvdb it would be a tough job to eliminate things like this. We can minimize the work by using a config file. That could contain several parameters like org_name, org_url, etc.
It would be then easy to access those parameters and use them. I'm struggling to access the org_name in footer.html :/


<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo">&nbsp;<img src="https://api.coala.io/en/latest/_static/images/coala_logo.svg"></a>
Copy link
Member

Choose a reason for hiding this comment

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

no. The objective was to solve #42 , fixing #1 .

Copy link
Member Author

Choose a reason for hiding this comment

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

So should i remove the logo? 😟

Copy link
Member Author

Choose a reason for hiding this comment

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

I've referred this issue in the commit message. Will that work?

<li><a href="/activity/">GitHub activity</a>
</ul>
</body>
{% include 'activity.html' %}
Copy link
Member

Choose a reason for hiding this comment

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

EOL

<a class="grey-text text-lighten-4 right" href="#!">GNU AGPL v3.0</a>
</div>
</div>
</footer>
Copy link
Member

Choose a reason for hiding this comment

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

EOL

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<link rel="stylesheet" href="../static/css/style.css">
Copy link
Member

Choose a reason for hiding this comment

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

../static does appear in the deployed website. use django-distill

@jayvdb
Copy link
Member

jayvdb commented Dec 14, 2017

We can minimize the work by using a config file. That could contain several parameters like org_name, org_url, etc.

No. This is an architecture choice. See the GCI task. This is supposed to be challenging.
org_name.txt is already a 'config file', generated so it can be easily accessed.

I'm struggling to access the org_name in footer.html :/

Please push your current code so we can take a look at how you've solved the other problems, and investigate how to solve this one.

@ashwini0529
Copy link
Member Author

@jayvdb the way to access org_name in this PR will be much easier. I think we should go ahead with this PR. What do you think? 😕

@jayvdb
Copy link
Member

jayvdb commented Dec 16, 2017

it may be easier, but it is wrong. You will understand why if you review my PR, and read the issues that it solves.

@ashwini0529
Copy link
Member Author

As now #48 is merged, I'd have to change few things up.
How do I proceed with it? @jayvdb

@@ -0,0 +1,3 @@
def get_org_name(request):
org_name = open('org_name.txt').readline()
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be updated now that 'org_name.txt' is no longer generated.


def get_org_name(request):
org_name = get_owner()
print (org_name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The code does not comply to PEP8.

Origin: PEP8Bear, Section: all.autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmpkpr3iyck/community/context_processors.py
+++ b/tmp/tmpkpr3iyck/community/context_processors.py
@@ -3,5 +3,5 @@
 
 def get_org_name(request):
     org_name = get_owner()
-    print (org_name)
+    print(org_name)
     return {'org_name': org_name}


def get_org_name(request):
org_name = get_owner()
print (org_name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

E211 whitespace before '('

Origin: PycodestyleBear (E211), Section: all.autopep8.

</div>
<div class="col m6 s12 center">
<div class="gitter-btn center">
<a href="https://gitter.im/coala" class="waves-effect waves-light btn-large"><i class="fa fa-commenting-o" aria-hidden="true"></i><span class="footer-btn-text">Join Chat On Gitter</span></a>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The line contains the keyword 'coala'.

Origin: KeywordBear, Section: generalization.

@ashwini0529
Copy link
Member Author

@jayvdb changes done! 😄

Copy link
Member

@andrewda andrewda left a comment

Choose a reason for hiding this comment

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

Let's add an HTML linter bear too.

<div class="section no-pad-bot" id="index-banner">

{% include 'issues_graph.html' %}
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Indentation seems weird here

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

<div class="container">
<a class="twitter-timeline" href="https://twitter.com/{{ org_twitter_handle }}">Tweets by {{ org_twitter_handle }}
</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></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.

All this indentation is really off. Closing divs should go on their own lines.

Copy link
Member Author

@ashwini0529 ashwini0529 Dec 17, 2017

Choose a reason for hiding this comment

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

Done

twitter_handle=org_twitter_handle))
return render(request, 'twitter_feed.html', context=org_data)
else:
return HttpResponse("Sorry, Organisation's twitter handle not found!")

Copy link
Member

Choose a reason for hiding this comment

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

Remove extra newline.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

<div class="row footer-btn-row">
<div class="col m6 s12 center">
<div class="twitter-btn center">
<a href="https://twitter.com/{{ org_name }}_io" class="waves-effect waves-light btn-large"><i class="fa fa-twitter" aria-hidden="true"></i><span class="footer-btn-text">Follow Us On Twitter</span></a>
Copy link
Member

Choose a reason for hiding this comment

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

IMO doing stuff like this is completely against the point of not using the word coala as this will only work for us, not any other org. This might have already been discussed and will be fixed later, just wanted to provide my input on this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly. We’ll have to create a config file. But as discussed, we’ll come up with config file in next PR

{% extends 'includes.html' %}
{% block content %}
<div class="section no-pad-bot" id="index-banner">
<div class="container">
Copy link
Member

Choose a reason for hiding this comment

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

This div is all a repeat of what is on index.html ?

Copy link
Member Author

Choose a reason for hiding this comment

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

no. it generates code something like http://paste.ubuntu.com/26200076/

Copy link
Member

Choose a reason for hiding this comment

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

But why?
This page should have the standard header and footer and no extra stuff. It is just a page, like any other. The activity page is not the main page.

<div class="card" style="overflow: visible;">
<div class="card-image waves-effect waves-block waves-light">
<img class="activator"
src="https://api.{{ org_name }}.io/en/latest/_static/images/{{ org_name }}_logo.svg">
Copy link
Member

Choose a reason for hiding this comment

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

No, no, no. This is coala specific URLs.

What is more, we have actually already built a solution for generic logos. You only need to use it.

Copy link
Member Author

Choose a reason for hiding this comment

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

can you please tell me the usage? I was coming up with a proposal of introducing a config file to have all the org related information in my next PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jayvdb should I use the header.png file?

Copy link
Member

Choose a reason for hiding this comment

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

No it shouldnt use header.png . I've created #55 to remove that.

Copy link
Member

Choose a reason for hiding this comment

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

Please stop consuming so much of other mentors time. It is counter productive. search this repo for "logo".

Copy link
Member

Choose a reason for hiding this comment

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

If your next iteration of this PR does not comply with the goals of this project, I am closing the PR and unassigning.

@ashwini0529
Copy link
Member Author

@jayvdb this would be the last major update that I would like to propose for this PR. Please have a look at the website.
If there's anything else that could be added or fixed, please let me know, or else you can close this PR. :)

{% block content %}
<div class="section no-pad-bot" id="index-banner">
<div class="container">
<h1 class="header center col-test">Welcome</h1>
Copy link
Member

Choose a reason for hiding this comment

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

Double space

<br>

{% include 'footer.html' %}
<!--Import jQuery before materialize.js-->
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed,
and the comment is in wrong location.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../static/css/main.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
Copy link
Member

@blazeu blazeu Dec 26, 2017

Choose a reason for hiding this comment

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

jquery can stay in the bottom of the body.

$('#chartType').on('change', function () {
updateChart($('#chartType').val())
});
updateChart($('#chartType').val());
Copy link
Member

Choose a reason for hiding this comment

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

This can be moved to charts.js so it's not duplicated in issues_graph page.

@ashwini0529
Copy link
Member Author

@jayvdb are we going to merge this PR? If we are, I'd be fixing the review that @blazeu gave.

@jayvdb
Copy link
Member

jayvdb commented Jan 2, 2018

This PR has conflicts :/

@jayvdb
Copy link
Member

jayvdb commented Jan 2, 2018

And there are review comments by @blazeu which havent been done.

<li class="collection-item">{{ log }}<a href="#!" class="secondary-content">
{% if '[ERROR]' in log %}
<i class="fa fa-times-circle fa-2x"></i></a>
{% elif '[WARNING]' in log %}
Copy link
Member

Choose a reason for hiding this comment

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

wrong indentation

{% elif '[WARNING]' in log %}
<i class="fa fa-exclamation-triangle fa-2x"></i></a>
{% else %}
<i class="fa fa-info-circle fa-2x"></i></a>
Copy link
Member

Choose a reason for hiding this comment

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

wrong indentation

<div class="footer-copyright">
<div class="container">
<span class="left">© 2017 {{ org_name }}</span>
<a class="grey-text text-lighten-4 right" href="https://github.com/{{ org_name }}"><i
Copy link
Member

Choose a reason for hiding this comment

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

hmm, how does "github.com{{ org_name }}" end up as github.com/coala ? django automatically adds the /? o_O

<span class="left">© 2017 {{ org_name }}</span>
<a class="grey-text text-lighten-4 right" href="https://github.com/{{ org_name }}"><i
class="fa fa-github fa-2x"></i></a>&nbsp;&nbsp;
<a class="grey-text text-lighten-4 right" href="https://twitter.com/{{ org_name }}"><i
Copy link
Member

Choose a reason for hiding this comment

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

strange alignment of the <i...

<footer class="page-footer">
<div class="footer-copyright">
<div class="container">
<span class="left">© 2017 {{ org_name }}</span>
Copy link
Member

Choose a reason for hiding this comment

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

2017 should be a generated value.

but more importantly, this implies something different than https://github.com/coala/community/blob/master/LICENSE says

<h1 class="header center col-test">Welcome</h1>
<div class="row center">
<h5 class="header col s12 light">Hello, world. You are at the {{ org_name }} community website.</h5>
<h4 class="header col s12 light">Meet awesome mentors</h4>
Copy link
Member

Choose a reason for hiding this comment

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

this is not how we would do a mentors app. please remove, and let that be achieved in the relevant issue.

<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo">&nbsp;<img
src="{{ org_logo }}"></a>
Copy link
Member

Choose a reason for hiding this comment

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

org_logo isnt declared, and thus it does not appear on https://deploy-preview-45--coala-community.netlify.com/

It is currently working on http://coala-community.netlify.com/

<a href="#" class="brand-logo">&nbsp;<img
src="{{ org_logo }}"></a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/gci">GCI</a></li>
Copy link
Member

Choose a reason for hiding this comment

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

perhaps this list can be generated?

from django.shortcuts import render


def index(request):
Copy link
Member

Choose a reason for hiding this comment

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

this duplicates information in community/urls.py . why do we need it here? (what are the benefits of this duplication?)

If we have it here, can we somehow avoid having it also in community/urls.py ? Maybe a feature request in django-distill?

@@ -121,3 +121,5 @@
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
STATICFILES_DIRS = ['static/']
TEMPLATES[0]['OPTIONS']['context_processors'].append(
'community.context_processors.get_org_name')
Copy link
Member

Choose a reason for hiding this comment

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

Move this into the TEMPLATES declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

8 participants