-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #87
- Loading branch information
shrikrishna
committed
Apr 19, 2018
1 parent
9261c9f
commit b4505bb
Showing
23 changed files
with
474 additions
and
23 deletions.
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,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ModelConfig(AppConfig): | ||
name = 'model' |
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,7 @@ | ||
from django.conf.urls import url | ||
|
||
from . import views | ||
|
||
urlpatterns = [ | ||
url(r'^$', views.index, name='index'), | ||
] |
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,76 @@ | ||
from django.shortcuts import render | ||
from django.views import generic | ||
|
||
from openhub.models import ( | ||
PortfolioProject, | ||
OutsideProject, | ||
OutsideCommitter, | ||
AffiliatedCommitter, | ||
Organization, | ||
) | ||
|
||
|
||
def index(request): | ||
args = { | ||
'portfolioprojects': 'portfolio_projects', | ||
'outsidecommitters': 'outside_committers', | ||
'affiliatedcommitters': 'affiliated_committers', | ||
'outsideprojects': 'outside_projects', | ||
'organization': 'organization', | ||
} | ||
return render(request, 'model.html', args) | ||
|
||
|
||
class PortfolioProjectListView(generic.ListView): | ||
model = PortfolioProject | ||
context_object_name = 'portfolio_project_list' | ||
template_name = 'model/templates/portfolio_project_list.html' | ||
|
||
|
||
class PortfolioProjectDetailView(generic.DetailView): | ||
model = PortfolioProject | ||
template_name = 'model/templates/portfolio_project_detail.html' | ||
|
||
|
||
class OutsideProjectListView(generic.ListView): | ||
model = OutsideProject | ||
context_object_name = 'outside_project_list' | ||
template_name = 'model/templates/outside_project_list.html' | ||
|
||
|
||
class OutsideProjectDetailView(generic.DetailView): | ||
model = OutsideProject | ||
template_name = 'model/templates/outside_project_detail.html' | ||
|
||
|
||
class OutsideCommitterListView(generic.ListView): | ||
model = OutsideCommitter | ||
context_object_name = 'outside_committer_list' | ||
template_name = 'model/templates/outside_committer_list.html' | ||
|
||
|
||
class OutsideCommitterDetailView(generic.DetailView): | ||
model = OutsideCommitter | ||
template_name = 'model/templates/outside_committer_detail.html' | ||
|
||
|
||
class AffiliatedCommitterListView(generic.ListView): | ||
model = AffiliatedCommitter | ||
context_object_name = 'affiliated_committer_list' | ||
template_name = 'model/templates/affiliated_committer_list.html' | ||
|
||
|
||
class AffiliatedCommitterDetailView(generic.DetailView): | ||
model = AffiliatedCommitter | ||
template_name = 'model/templates/affiliated_committer_detail.html' | ||
|
||
|
||
class OrganizationListView(generic.ListView): | ||
model = Organization | ||
context_object_name = 'organization_list' | ||
template_name = 'model/templates/organization_list.html' | ||
|
||
|
||
class OrganizationDetailView(generic.DetailView): | ||
model = Organization | ||
template_name = 'model/templates/organization_detail.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
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,34 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<!-- Required meta tags --> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<!-- Bootstrap CSS --> | ||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | ||
<title>Visit your models</title> | ||
</head> | ||
<body> | ||
<h1>Visit Your Models and its Imported data</h1> | ||
<hr> | ||
<div class="container"> | ||
<h2>openhub app models</h2> | ||
<li> | ||
<a href="{% url 'portfolioprojects' %}">Portfolio Projects</a><br> | ||
</li> | ||
<li> | ||
<a href="{% url 'outsideprojects' %}">Outside Projects</a><br> | ||
</li> | ||
<li> | ||
<a href="{% url 'affiliatedcommitters' %}">Affiliated Committers</a><br> | ||
</li> | ||
<li> | ||
<a href="{% url 'outsidecommitters' %}">Outside Committers</a><br> | ||
</li> | ||
<li> | ||
<a href="{% url 'organization' %}">Organizations</a><br> | ||
</li> | ||
</div> | ||
<hr> | ||
</body> | ||
</html> |
15 changes: 15 additions & 0 deletions
15
templates/model/templates/affiliated_committer_detail.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,15 @@ | ||
{% extends "model/templates/base.html" %} | ||
{% block title %} | ||
<title>{{ affiliatedcommitter.name }}</title> | ||
{% endblock %} | ||
{% block content %} | ||
<h1>Details of: {{ affiliatedcommitter.name }}</h1> | ||
<p><strong>name:</strong>{{ affiliatedcommitter.name }}</p> | ||
<p><strong>org:</strong> {{ affiliatedcommitter.org }}</p> | ||
<p><strong>kudos:</strong> {{ affiliatedcommitter.kudos }}</p> | ||
<p><strong>level:</strong> {{ affiliatedcommitter.level }}</p> | ||
<p><strong>most commits project:</strong>{{ affiliatedcommitter.most_commits.project }}</p> | ||
<p><strong>most commits date:</strong>{{ affiliatedcommitter.most_commits.date }}</p> | ||
<p><strong>most recent commits project:</strong>{{ affiliatedcommitter.most_recent_commit.project }}</p> | ||
<p><strong>most recent commits data:</strong>{{ affiliatedcommitter.most_recent_commit.date }}</p> | ||
{% endblock %} |
Oops, something went wrong.