Skip to content

Commit

Permalink
Separate pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiffany-Zhu5303 committed Jan 12, 2024
1 parent 333fe76 commit 832e866
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion projectApp/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django import forms

class oneMolecule(forms.Form):
#class oneMolecule(forms.Form):
#forms stuff
9 changes: 0 additions & 9 deletions projectApp/templates/projectApp/get-molecules.html

This file was deleted.

14 changes: 14 additions & 0 deletions projectApp/templates/projectApp/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends 'shared/base.html' %}
{% block content %}
<h1>Comparing Subgraphs of Complex Structures</h1>
<label for="structures">How many structures do you want to compare?</label>

<br>
<a href="{% url 'inputOneMolecule' %}">
<button type="submit" value="1">1</button>
</a>

<a href="{% url 'inputTwoMolecules' %}">
<button type="submit" value="2">2</button>
</a>
{% endblock %}
3 changes: 1 addition & 2 deletions projectApp/templates/projectApp/twoMolecules.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ <h1>Comparing Subgraphs of Two Complex Structures</h1>

<label for="moleculeInput">Enter your first molecule</label>
<textarea id="moleculeInput"></textarea>
<button class="btn btn-primary" type="submit">Submit</button>

<br>
<label for="moleculeInput">Enter your second molecule</label>
<textarea id="moleculeInput"></textarea>
<button class="btn btn-primary" type="submit">Submit</button>
Expand Down
6 changes: 4 additions & 2 deletions projectApp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from . import views

urlpatterns = [
path("getMolecules/", views.getMolecules, name="getMolecules"),
path("inputMolecules/", views.inputMolecules, name="inputMolecules")
path("home/", views.home, name="home"),
path("inputMolecules/", views.inputMolecules, name="inputMolecules"),
path("inputOneMolecule/", views.inputOneMolecule, name="inputOneMolecule"),
path("inputTwoMolecules/", views.inputTwoMolecules, name="inputTwoMolecules")
]
15 changes: 7 additions & 8 deletions projectApp/views.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
from django.shortcuts import render
from django.http import HttpResponse
from .forms import oneMolecule
#from .forms import oneMolecule

def getMolecules(request):
return render(request, "projectApp/get-molecules.html")
def home(request):
return render(request, "projectApp/home.html")

def inputMolecules(request):
molecule = request.POST.get("molecule")
print(molecule)
return HttpResponse("Recieved molecule!")

"""
def inputOneMolecule(request):
form = oneMolecules()
return render(request, 'projectApp/oneMolecule.html', {'form': form})
"""
return render(request, "projectApp/oneMolecule.html")

def inputTwoMolecules(request):
return render(request, "projectApp/twoMolecules.html")

0 comments on commit 832e866

Please sign in to comment.