Skip to content

Commit

Permalink
Merge pull request #1 from TeamSuman/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dmighty007 authored Sep 13, 2024
2 parents 0a5fbe6 + 3785db9 commit 71033c3
Show file tree
Hide file tree
Showing 8 changed files with 930 additions and 101 deletions.
116 changes: 116 additions & 0 deletions Test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import json"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"infos = json.load(open('./info/colab.json'))\n",
"template = open('./templates/index_template.html').readlines()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"def add_collab(name, desig, univ, img):\n",
"\n",
" return f\"\"\" <div class=\"testimonial-item text-center rounded pb-4\">\n",
" <div class=\"testimonial-comment rounded p-5\">\n",
" </div>\n",
" <div class=\"testimonial-img p-1\">\n",
" <img src=\"{img}\" class=\"img-fluid rounded-circle\" alt=\"{name}\">\n",
" </div>\n",
" <div style=\"margin-top: -35px;\">\n",
" <h5 class=\"mb-0\">{name}</h5>\n",
" <p class=\"mb-0\">{desig}\n",
" <br> {univ}\n",
" </p>\n",
" </div>\n",
" </div>\"\"\"\n",
" \n",
"\n",
"def return_head_tail(mem_type, style = 1):\n",
"\n",
" section_head = \"\"\"<div class=\"container-fluid testimonial py-5\">\n",
" <div class=\"container py-5\">\n",
" <div class=\"mx-auto text-center mb-5\" style=\"max-width: 900px;\">\n",
" <h5 class=\"section-title px-3\">Colaborators</h5>\n",
" <h1 class=\"mb-0\">National/international colaborators</h1>\n",
" </div>\n",
" <div class=\"testimonial-carousel owl-carousel\">\"\"\"\n",
"\n",
" section_tail = \"\"\"</div></div></div>\"\"\"\n",
" return section_head, section_tail"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"for i, line in enumerate(template):\n",
" if \"<!-- Collaborator Start -->\" in line:\n",
" header = template[:i+1]\n",
" tail = template[i+2:]\n",
"full_html = \"\" + ''.join(header)\n",
"for item in infos:\n",
" head = \"\"\n",
"\n",
" section_head, section_tail = return_head_tail('Alumni')\n",
" head += section_head\n",
" for mem in infos[item]:\n",
" head += add_collab(mem['name'], mem['desig'], mem['univ'], mem['img'])\n",
" head += section_tail\n",
"\n",
"full_html += head\n",
"full_html += ''.join(tail)\n",
"\n",
"with open('test.html', 'w') as f:\n",
" f.write(full_html)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "sarkar",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Binary file added img/ddas.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 35 additions & 34 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -471,73 +471,74 @@ <h1 class="text-white mb-2">Project Students</h1>
</div>
<!-- Positions End -->

<!-- Testimonial Start -->
<!-- Collaborator Start -->
<div class="container-fluid testimonial py-5">
<div class="container py-5">
<div class="mx-auto text-center mb-5" style="max-width: 900px;">
<h5 class="section-title px-3">Colaborators</h5>
<h1 class="mb-0">National/international colaborators</h1>
</div>
<div class="testimonial-carousel owl-carousel">
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-carousel owl-carousel"> <div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="./img/ruth.jpeg" class="img-fluid rounded-circle" alt="Image">
<img src="./img/ruth.jpeg" class="img-fluid rounded-circle" alt="Ruth Nussinov">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Ruth Nussinov</h5>
<p class="mb-0">Professor and Senior Principal Investigator
<br> National Cancer Institute and Tel
Aviv University
<br> National Cancer Institute and Tel Aviv University
</p>

</div>
</div>
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment bg-light rounded p-5">
</div> <div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="./img/gbasu.jpg" class="img-fluid rounded-circle" alt="Image">
<img src="./img/gbasu.jpg" class="img-fluid rounded-circle" alt="Gautam Basu">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Gautam Basu</h5>
<p class="mb-0">Professor (retired)<br>
Biophysics, Bose Institute</p>

<p class="mb-0">Professor (retired)
<br> Biophysics, Bose Institute
</p>
</div>
</div>
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment bg-light rounded p-5">

</div> <div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="./img/supra.png" class="img-fluid rounded-circle" alt="Image">
<img src="./img/supra.png" class="img-fluid rounded-circle" alt="Supratim Banerjee">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Supratim Banerjee</h5>
<p class="mb-0">Associate Professor<br>
DCS, IISERK </p>
<p class="mb-0">Associate Professor
<br> DCS, IISERK
</p>
</div>
</div>
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment bg-light rounded p-5">

</div> <div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="./img/rajnish.jpg" class="img-fluid rounded-circle" alt="Image">
<img src="./img/rajnish.jpg" class="img-fluid rounded-circle" alt="Rajnish Kumar">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Rajnish Kumar</h5>
<p class="mb-0">Proffesor<br>
Chemical Engineering, IITM</p>
<p class="mb-0">Professor
<br> Chemical Engineering, IITM
</p>
</div>
</div>
</div>
</div>
</div>
<!-- Testimonial End -->

</div> <div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="./img/ddas.jpeg" class="img-fluid rounded-circle" alt="Dibyendu Das">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Dibyendu Das</h5>
<p class="mb-0">Associate Professor
<br> Chemistry, IISERK
</p>
</div>
</div></div></div></div>
<div class="container-fluid booking py-5">
<div class="container py-5">
<div class="row g-5 align-items-center">
Expand Down
34 changes: 34 additions & 0 deletions info/colab.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"colab": [
{
"name": "Ruth Nussinov",
"desig": "Professor and Senior Principal Investigator",
"univ": "National Cancer Institute and Tel Aviv University",
"img": "./img/ruth.jpeg"
},
{
"name": "Gautam Basu",
"desig": "Professor (retired)",
"univ": "Biophysics, Bose Institute",
"img": "./img/gbasu.jpg"
},
{
"name": "Supratim Banerjee",
"desig": "Associate Professor",
"univ": "DCS, IISERK",
"img": "./img/supra.png"
},
{
"name": "Rajnish Kumar",
"desig": "Professor",
"univ": "Chemical Engineering, IITM",
"img": "./img/rajnish.jpg"
},
{
"name": "Dibyendu Das",
"desig": "Associate Professor",
"univ": "Chemistry, IISERK",
"img": "./img/ddas.jpeg"
}
]
}
54 changes: 54 additions & 0 deletions scripts/collab_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import json

def add_collab(name, desig, univ, img):

return f""" <div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="{img}" class="img-fluid rounded-circle" alt="{name}">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">{name}</h5>
<p class="mb-0">{desig}
<br> {univ}
</p>
</div>
</div>"""


def return_head_tail():

section_head = """<div class="container-fluid testimonial py-5">
<div class="container py-5">
<div class="mx-auto text-center mb-5" style="max-width: 900px;">
<h5 class="section-title px-3">Colaborators</h5>
<h1 class="mb-0">National/international colaborators</h1>
</div>
<div class="testimonial-carousel owl-carousel">"""

section_tail = """</div></div></div>"""
return section_head, section_tail

infos = json.load(open('./info/colab.json'))
template = open('./index.html').readlines()

for i, line in enumerate(template):
if "<!-- Collaborator Start -->" in line:
header = template[:i+1]
tail = template[i+2:]
full_html = "" + ''.join(header)
for item in infos:
head = ""

section_head, section_tail = return_head_tail()
head += section_head
for mem in infos[item]:
head += add_collab(mem['name'], mem['desig'], mem['univ'], mem['img'])
head += section_tail

full_html += head
full_html += ''.join(tail)

with open('index.html', 'w') as f:
f.write(full_html)
68 changes: 2 additions & 66 deletions templates/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,72 +438,8 @@ <h1 class="text-white mb-2">Project Students</h1>
</div>
<!-- Positions End -->

<!-- Testimonial Start -->
<div class="container-fluid testimonial py-5">
<div class="container py-5">
<div class="mx-auto text-center mb-5" style="max-width: 900px;">
<h5 class="section-title px-3">Colaborators</h5>
<h1 class="mb-0">National/international colaborators</h1>
</div>
<div class="testimonial-carousel owl-carousel">
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="./img/ruth.jpeg" class="img-fluid rounded-circle" alt="Image">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Ruth Nussinov</h5>
<p class="mb-0">Professor and Senior Principal Investigator
<br> National Cancer Institute and Tel
Aviv University
</p>

</div>
</div>
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment bg-light rounded p-5">
</div>
<div class="testimonial-img p-1">
<img src="./img/gbasu.jpg" class="img-fluid rounded-circle" alt="Image">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Gautam Basu</h5>
<p class="mb-0">Professor (retired)<br>
Biophysics, Bose Institute</p>

</div>
</div>
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment bg-light rounded p-5">

</div>
<div class="testimonial-img p-1">
<img src="./img/supra.png" class="img-fluid rounded-circle" alt="Image">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Supratim Banerjee</h5>
<p class="mb-0">Associate Professor<br>
DCS, IISERK </p>
</div>
</div>
<div class="testimonial-item text-center rounded pb-4">
<div class="testimonial-comment bg-light rounded p-5">

</div>
<div class="testimonial-img p-1">
<img src="./img/rajnish.jpg" class="img-fluid rounded-circle" alt="Image">
</div>
<div style="margin-top: -35px;">
<h5 class="mb-0">Rajnish Kumar</h5>
<p class="mb-0">Proffesor<br>
Chemical Engineering, IITM</p>
</div>
</div>
</div>
</div>
</div>
<!-- Testimonial End -->
<!-- Collaborator Start -->
<!-- Collaborator End -->

<div class="container-fluid booking py-5">
<div class="container py-5">
Expand Down
Loading

0 comments on commit 71033c3

Please sign in to comment.