Skip to content

Commit

Permalink
new revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
SubhrajitPrusty committed Aug 27, 2018
1 parent 614d64f commit 29a07c9
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 324 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ venv
*.pyc
staticfiles
.env
__pycache__
__pycache__
24 changes: 13 additions & 11 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
import json
import os
from gevent.pywsgi import WSGIServer

import os
from pymongo import MongoClient

def getContent():
json_file_path = os.path.join('static', "users.json")
dburl = os.environ['MONGODB_URI']

jtext = open(json_file_path,"r")
j = json.load(jtext)
members = j['members']
localtime = j['time']
context = {"members":members,"localtime":localtime}

jtext.close()
client = MongoClient(dburl)

# print(context)
return context
db = client.get_default_database()

members = db.members

data = []

for mem in members.find():
data.append(mem)

return data

app = Flask(__name__, static_url_path='/static')

Expand Down
146 changes: 22 additions & 124 deletions static/users.json
Original file line number Diff line number Diff line change
@@ -1,124 +1,22 @@
{
"members": [
{
"username": "swagat5147",
"contrib": "Created 6 commits in 2 repositories\nCreated 1 repository",
"name": "Swagat Parija",
"bigtext": "20 contributions in the last year",
"photo": "https://avatars0.githubusercontent.com/u/31531209"
},
{
"username": "mojito9542",
"contrib": "Created 1 repository",
"name": "Mohit Agarwal",
"bigtext": "73 contributions in the last year",
"photo": "https://avatars3.githubusercontent.com/u/35900091"
},
{
"username": "MD-AZMAL",
"contrib": "Created 21 commits in 2 repositories\nCreated 2 repositories\nOpened 6 pull requests in 1 repository\nOpened 1 issue in 1 repository",
"name": "MD Azmal",
"bigtext": "408 contributions in the last year",
"photo": "https://avatars2.githubusercontent.com/u/33421347"
},
{
"username": "aruba246",
"contrib": "Created 2 commits in 1 repository",
"name": "Aruba Shireen",
"bigtext": "50 contributions in the last year",
"photo": "https://avatars1.githubusercontent.com/u/30324086"
},
{
"username": "AshisPadhi",
"contrib": "Created 3 commits in 1 repository\nCreated 1 repository",
"name": "Ashish Kumar Padhi",
"bigtext": "51 contributions in the last year",
"photo": "https://avatars3.githubusercontent.com/u/29506148"
},
{
"username": "kmradi",
"contrib": "Created 2 repositories",
"name": "Kumar Aditya",
"bigtext": "15 contributions in the last year",
"photo": "https://avatars1.githubusercontent.com/u/32020813"
},
{
"username": "Pawan0411",
"contrib": "Created 8 commits in 2 repositories\nCreated 2 repositories\n+50 \u22123 \u2022",
"name": "Pawan Kumar",
"bigtext": "116 contributions in the last year",
"photo": "https://avatars0.githubusercontent.com/u/32352500"
},
{
"username": "JiviteshDebata",
"contrib": "Created 6 commits in 2 repositories\nCreated 3 repositories\n+94 \u22120 \u2022\nOpened 1 issue in 1 repository",
"name": "Jivitesh Debata",
"bigtext": "37 contributions in the last year",
"photo": "https://avatars2.githubusercontent.com/u/10712698"
},
{
"username": "Zanark",
"contrib": "Created 19 commits in 3 repositories\nCreated 1 repository",
"name": "Zanark",
"bigtext": "249 contributions in the last year",
"photo": "https://avatars2.githubusercontent.com/u/32354314"
},
{
"username": "rupesh1310",
"contrib": "Created 6 commits in 1 repository\nCreated 1 repository",
"name": "A. Rupesh",
"bigtext": "155 contributions in the last year",
"photo": "https://avatars1.githubusercontent.com/u/30566706"
},
{
"username": "Nirmal-Kr",
"contrib": "Created 1 commit in 1 repository",
"name": "Nirmal Kumar Bhakat",
"bigtext": "22 contributions in the last year",
"photo": "https://avatars0.githubusercontent.com/u/32362904"
},
{
"username": "SubhrajitPrusty",
"contrib": "Created 9 commits in 4 repositories",
"name": "Subhrajit Prusty",
"bigtext": "305 contributions in the last year",
"photo": "https://avatars0.githubusercontent.com/u/4463839"
},
{
"username": "dibyasonu",
"contrib": "",
"name": "Dibya Ranjan Jena",
"bigtext": "87 contributions in the last year",
"photo": "https://avatars1.githubusercontent.com/u/24965806"
},
{
"username": "alphacrash",
"contrib": "Created 10 commits in 1 repository",
"name": "Sudhanshu",
"bigtext": "109 contributions in the last year",
"photo": "https://avatars1.githubusercontent.com/u/12628889"
},
{
"username": "swarajlaha",
"contrib": "Created 3 repositories",
"name": "Swaraj Laha",
"bigtext": "33 contributions in the last year",
"photo": "https://avatars0.githubusercontent.com/u/26769575"
},
{
"username": "srinibasbiswal",
"contrib": "",
"name": "Srinibas Biswal",
"bigtext": "475 contributions in the last year",
"photo": "https://avatars1.githubusercontent.com/u/18086651"
},
{
"username": "xlreon",
"contrib": "Created 3 commits in 1 repository\nCreated 1 repository",
"name": "Sidharth Satapathy",
"bigtext": "417 contributions in the last year",
"photo": "https://avatars3.githubusercontent.com/u/26788670"
}
],
"time": "03:02:06 08/11/18"
}
[
"dipu-m18",
"SHIKHASINGH1506",
"anish-yadav",
"swagat5147",
"mojito9542",
"MD-AZMAL",
"aruba246",
"AshisPadhi",
"kmradi",
"Pawan0411",
"JiviteshDebata",
"Zanark",
"rupesh1310",
"Nirmal-Kr",
"SubhrajitPrusty",
"dibyasonu",
"alphacrash",
"swarajlaha",
"srinibasbiswal",
"xlreon"
]
124 changes: 0 additions & 124 deletions static/users.json.copy

This file was deleted.

6 changes: 3 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ <h1>Codex</h1>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="buyTicket">
<div class="row">
{% for member in context['members'] %}
{% for member in context %}

<div class="col-md-6">
<div class="profile">
<div class="card" style="width: 18rem;">
<img class="card-img-top" src="{{ member.photo }}" alt="Profile Picture">
<img class="card-img-top" src="{{ member.avatar }}" alt="Profile Picture">
<div class="card-body">
<h5 class="card-title">{{ member.name }}</h5>
<p class="card-text">{{ member.bigtext }}</p>
<p class="card-text">{{ member.totalCommits }}</p>
<a href="https://github.com/{{ member.username }}" class="btn btn-primary">{{ member.username }}</a>
</div>
</div>
Expand Down
Loading

0 comments on commit 29a07c9

Please sign in to comment.