-
Notifications
You must be signed in to change notification settings - Fork 15
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
Development2 #13
Merged
Merged
Development2 #13
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8029bc9
Keep API key in settings
ghoshbishakh a1039ab
Add google analytics snippet to all views
ghoshbishakh 463d83f
Add news post view to share news posts
ghoshbishakh 4d83009
Add social share button to news feeds
ghoshbishakh fe27fc0
Clear cache on model edits
ghoshbishakh 520e18c
Use thicker fonts for better readibility
ghoshbishakh 2dc960a
Fix navbar collapse css issue
ghoshbishakh e7f764c
Fix css error
ghoshbishakh fc9b244
Shrink navbar properly on smaller screens
ghoshbishakh 616b200
Add custom 404 and 500 error pages
ghoshbishakh 553e623
Fix error pages markup
ghoshbishakh ab6a8e3
Add meta tags to error pages
ghoshbishakh 53a0a5d
Add youtube gallery
ghoshbishakh a9741f0
Add simple visualization using D3
ghoshbishakh 263bd85
Fix navbar overflow in mobile devices
ghoshbishakh a45ae28
Raise 404 when section is not found
ghoshbishakh 9607ce9
Make a separate follow us page for all social feeds.
ghoshbishakh 2ce32b4
Use first paragraph for meta description
ghoshbishakh a26c2be
Generate gallery from examples
ghoshbishakh f4e14f4
Use example images in honeycomb
ghoshbishakh 5e5a33e
Add tutorials page
ghoshbishakh f060a1c
Add Sections in the tutorials page
ghoshbishakh ca2eb45
Fix duplicate tutorials bug
ghoshbishakh 3c286e8
Toggle turotials page sections
ghoshbishakh eb89a2c
Change toggle speed for tutorial page sections
ghoshbishakh a0ab514
Update docstrings in methods for parsing tutorials
ghoshbishakh c5f563a
Fix docstrings in tools.py
ghoshbishakh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class GithubVisualizationConfig(AppConfig): | ||
name = 'github_visualization' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
Large diffs are not rendered by default.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
github_visualization/templates/github_visualization/contributors_bubble.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{% load staticfiles %} | ||
|
||
<!doctype html> | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="{% static "js/d3.min.js" %}"></script> | ||
</head> | ||
<body> | ||
<div id="vizcontainer"> | ||
<svg style="width:100%;height:500px;border:1px lightgray solid;" /> | ||
</div> | ||
</body> | ||
|
||
<script type="text/javascript"> | ||
var contributors = {{ contributors|safe }}; | ||
|
||
var yScale = d3.scaleLinear().domain([0,contributors[0].contributions]).range([4,40]); | ||
|
||
function contributors_viz(contributorData) { | ||
d3.select("svg") | ||
.append("g") | ||
.attr("id", "contributorsG") | ||
.attr("transform", "translate(50,300)") | ||
.selectAll("g") | ||
.data(contributorData) | ||
.enter() | ||
.append("g") | ||
.attr("class", "contributorG") | ||
.attr("transform", function (d,i) {return "translate(" + (i * 40) + ", " + -yScale(d.contributions) * 6 + ")"}); | ||
|
||
var contributorG = d3.selectAll("g.contributorG"); | ||
|
||
contributorG.append("circle") | ||
.attr("r", function(d,i){ return yScale(d.contributions);}) | ||
.style("fill", "pink") | ||
.style("stroke", "black") | ||
.style("stroke-width", "1px"); | ||
|
||
contributorG.append("text") | ||
.style("text-anchor", "middle") | ||
.attr("y", 30) | ||
.style("font-size", "10px") | ||
.text(function(d) {return d.login;}); | ||
|
||
contributorG.insert("image", "text") | ||
.attr("xlink:href", function(d) { | ||
return d.avatar_url; | ||
}) | ||
.attr("width", "45px").attr("height", "20px").attr("x", "-22") | ||
.attr("y", "-10"); | ||
} | ||
|
||
contributors_viz(contributors); | ||
|
||
</script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import requests | ||
|
||
|
||
def fetch_all_contributors(user, repo): | ||
try: | ||
response = requests.get( | ||
"https://api.github.com/repos/%s/%s/contributors" % | ||
(user, repo)) | ||
if response.status_code != 200: | ||
return None | ||
response = response.text | ||
return response | ||
except: | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.conf.urls import include, url | ||
from . import views | ||
|
||
urlpatterns = [ | ||
# Home Page | ||
url(r'^contributors$', views.contributors_bubble, | ||
name='contributors_bubble'), | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.shortcuts import render | ||
from .tools import * | ||
|
||
|
||
# Create your views here. | ||
|
||
def contributors_bubble(request): | ||
context = {} | ||
context['contributors'] = fetch_all_contributors('nipy', 'dipy') | ||
return render(request, | ||
'github_visualization/contributors_bubble.html', | ||
context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.6 on 2016-07-16 06:02 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('website', '0013_carouselimage_display_description'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='newspost', | ||
name='description', | ||
field=models.CharField(default='sample description', max_length=140), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my info, those do not seem to be added to url_patterns. Are those names (handler404 and 500) reserved words?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes handler404 and handler500 are reserved words. Django performs some kind of magic with them and renders the views assigned to them in case of 404 or 500.