Browse Source

final from the course

Inyoung 8 years ago
parent
commit
ca2c2ecbff
13 changed files with 513 additions and 153 deletions
  1. 79 85
      app.py
  2. 30 0
      appunittest1.py
  3. 31 0
      appunittest2.py
  4. 31 0
      appunittest3.py
  5. 43 0
      impl_interface.py
  6. 279 0
      implementation.py
  7. 1 0
      itemlist.txt
  8. 1 0
      pytest.txt
  9. 4 0
      static/css/inyoung.css
  10. 4 0
      static/css/styles.css
  11. 1 1
      static/js/scripts.js
  12. 9 11
      templates/index.html
  13. 0 56
      templates/success.html

+ 79 - 85
app.py

@@ -1,14 +1,15 @@
 # File Name: app.py
-# Author Name: In-young Choung
-# Date: March 1, 2017
+# Modified Date: April 15, 2017
 # Description: This python file contains database configuration and creates database tables and fields using flask_sqlalchemy.
 #              Users' values passed from Javascript are inserted into the database table.
-#              It also has mapping request to interact with specific html files and
-#              it reads a file of itemlist.text and prints out to the console.
+#              It also has mapping request to interact with specific html files.
+# Method Level Comment: Python Convention (inside function)
+__author__ = "Inyoung Choung"
 
 from flask_sqlalchemy import SQLAlchemy
 from flask import Flask, render_template, request
-
+from implementation import Impl
+import datetime
 
 # passing the whole app code to Flask
 app = Flask(__name__)
@@ -26,13 +27,12 @@ class Calc(db.Model):
 
     # database fields
     id = db.Column(db.Integer, primary_key=True)
-    result = db.Column(db.String(64))
-    timestampe = db.Column(db.TIMESTAMP)
+    result = db.Column(db.String(255))
+    timestamp = db.Column(db.TIMESTAMP)
 
     # adding constraints to delete all data in Item when calc is deleted.
     item = db.relationship('Item', backref='calc', cascade='all, delete-orphan', lazy='dynamic')
 
-
 # database ORM item table - 9 columns
 class Item(db.Model):
     __tablename__ = "items"
@@ -41,74 +41,65 @@ class Item(db.Model):
     id = db.Column(db.Integer, primary_key=True)
     item_type = db.Column(db.String(64))
     brand_name = db.Column(db.String(64))
-    price = db.Column(db.Integer)
-    weight = db.Column(db.Integer)
+    price = db.Column(db.DECIMAL)
+    weight = db.Column(db.DECIMAL)
     weight_type = db.Column(db.String(5))
-    discount = db.Column(db.Integer)
+    discount = db.Column(db.DECIMAL)
     discount_type = db.Column(db.String(20))
     calc_id = db.Column(db.Integer, db.ForeignKey(Calc.id))
 
-
 # create all the tables defined as classes
-db.create_all()
+# db.create_all()
 
 
-# mapping request to URLs
 @app.route('/', methods = ['GET', 'POST'])
 def index():
+    """
+    mapping request to URLs
+    :return: render_template('index.html')
+    """
     if request.method == 'GET':
         # renders to html file
         return render_template('index.html')
 
 
-# end point where python gets user data from javascript
-@app.route('/calculate', methods = ['GET'])
+# These variables are declared as global.
+global newWeightForSecondItem
+global list
+
+
+@app.route('/calculate', methods=['GET'])
 def calculate():
-    # get value from html
-    itemtype = (request.args.get('param1'))
-    brandN1 = (request.args.get('param2'))
-    brandN2 = (request.args.get('param3'))
-    price1 = (request.args.get('param4'))
-    price2 = (request.args.get('param5'))
-    weight1 = (request.args.get('param6'))
-    weightT1 = (request.args.get('param7'))
-    weight2 = (request.args.get('param8'))
-    weightT2 = (request.args.get('param9'))
-    discount1 = (request.args.get('param10'))
-    discountT1 = (request.args.get('param11'))
-    discount2 = (request.args.get('param12'))
-    discountT2 = (request.args.get('param13'))
-
-
-    #TODO: calculate function
-    # total2 = float(total)
-    # new_total = 1.0 + total2
-    # print(new_total)
-    #
-    # weight_types = ['lb', 'kg', 'g']
-    #
-    # item1_byWeight = float(price1) / float(weight1);
-    # item2_byWeight = float(price2) / float(weight2);
-    #
-    # if (item1_byWeight < item2_byWeight) :
-    #     difference = float(item2_byWeight) - float(item1_byWeight)
-    #     result = (item1 + "is cheapter by " + difference)
-    # else :
-    #     difference = float(item1_byWeight) - float(item2_byWeight)
-    #     result = (item2 + "is cheapter by " + difference)
-    #
-    # print(param1 + param2)
-    # result = param1 + param2
-
-    # returns a row from db
-    # item_from_db = Item.query.filter_by(item_type=itemtype).first();
-
-    # if item_from_db is not None:
-    #     print("already exists in the database.")
-    # else:
+    """
+    end point where python gets user data from javascript.
+    :return: 'Successful'
+    """
+    # get value from javascript.
+    itemtype = str((request.args.get('param1')))
+    brandN1 = str((request.args.get('param2')))
+    brandN2 = str((request.args.get('param3')))
+    price1 = str((request.args.get('param4')))
+    price2 = str((request.args.get('param5')))
+    weight1 = str((request.args.get('param6')))
+    weightT1 = str((request.args.get('param7')))
+    weight2 = str((request.args.get('param8')))
+    weightT2 = str((request.args.get('param9')))
+    discount1 = str((request.args.get('param10')))
+    discountT1 = str((request.args.get('param11')))
+    discount2 = str((request.args.get('param12')))
+    discountT2 = str((request.args.get('param13')))
+
+    # instantiate an object of Impl and pass arguments.
+    implObj = Impl(itemtype, brandN1, brandN2, price1, price2, weight1, weightT1, weight2,
+            weightT2, discount1,discountT1, discount2, discountT2)
 
     try:
-        # define array variables to be ready to match with db columns
+        # save data into calc table of the database.
+        calc = Calc(result = implObj.get_result(), timestamp = '{:%Y-%b-%d %H:%M:%S}'.format(datetime.datetime.now()))
+        # insert a new row into the database.
+        db.session.add(calc)
+
+        # define array variables to be ready to match with db columns.
         brand_names = [brandN1, brandN2]
         prices = [price1, price2]
         weights = [weight1, weight2]
@@ -116,43 +107,46 @@ def calculate():
         discounts = [discount1, discount2]
         discount_types = [discountT1, discountT2]
 
-        # iteration variable for loop
+        # iteration variable for loop.
         i = 0
-
-        # loop twice to save two compared items into database
+        # loop twice to save two compared items into item table of the database.
         for i in range(0, 2):
-            item = Item(item_type = itemtype, brand_name = brand_names[i], price =prices[i],
-                           weight=weights[i] , weight_type = weight_types[i], discount = discounts[i] ,
-                           discount_type = discount_types[i])
+            item = Item(item_type=itemtype, brand_name=brand_names[i], price=prices[i],
+                        weight=weights[i], weight_type=weight_types[i], discount=discounts[i],
+                        discount_type=discount_types[i])
 
-            # insert a new row into the database
+            # insert a new row into the database.
             db.session.add(item)
 
-        # write it to db disk once the loop is done
+        # write it to db disk once the loop is done.
         db.session.commit()
-
-    # catch the exception and print it
+        # initialize empty list to collect item objects.
+        list = []
+        # loop for the result of the query to display brand_name column rows of Item table.
+        for row in db.session.query(Item, Item.brand_name).all():
+            # add brand name into the list
+            list.append(row.brand_name)
+
+        # sorts the item list by the alphabetical order.
+        implObj.sort(list)
+
+        # calls writefile function and pass the sorted list.
+        implObj.writefile(None, list)
+        implObj.readfile()
+
+        return 'Successful'
+    # catch the exception and print it.
     except ValueError:
         print(ValueError)
         print("failed to create new row")
+        return -1
 
 
-# File I/O - prints a list of grocery items
-path = "C:\In-young Choung\Computer Programming\Self Programming Files\grocerycalc\itemlist.txt"
-# open a file for writing and create it if it doesn't exist.
-f = open(path,"w+")
-
-# open the file in the defined path and "r" read it
-f = open(path, "r")
-if f.mode == 'r':
-    # use read function to read the entire file.
-    contents = f.read()
-    #print the file content in the console
-    print(contents)
-
-
-# main method
 if __name__ == '__main__':
+    # main method that starts the application.
+
+    # debugging purpose.
     app.debug = True
-    # app.debug = False
     app.run()
+
+

+ 30 - 0
appunittest1.py

@@ -0,0 +1,30 @@
+# File Name: appunittest1.py
+# Date: April 15, 2017
+# Description: This class is for testing write file and read file in app.py
+# Method Level Comment: Python Convention (inside function)
+__author__ = "Inyoung Choung"
+
+from os import path
+import unittest
+from implementation import Impl
+
+# testing file IO.
+class writefiletest(unittest.TestCase):
+    def runTest(self):
+        """
+        run Test to check if the file exists.
+        :return:
+        """
+        # set a specific path to filepath variable
+        filepath = "C:\In-young Choung\Computer Programming\Self Programming Files\grocerycalc\pytest.txt"
+
+        # create a file and write "pythontest"
+        Impl.writefile(self, filepath, "pythontest")
+
+        # check if the file is correctly created in the path
+        self.assertTrue(path.exists("pytest.txt"))
+
+# class starter
+if __name__ == '__main__':
+    unittest.main()
+

+ 31 - 0
appunittest2.py

@@ -0,0 +1,31 @@
+# File Name: appunittest2.py
+# Modified Date: March 24, 2017
+# Description: This class is for testing message of show error function.
+# Method Level Comment: Python Convention (inside function)
+__author__ = "Inyoung Choung"
+
+import os
+from os import path
+import unittest
+from implementation import Impl
+
+# testing Show Error function.
+class testShowError(unittest.TestCase):
+    def runTest(self):
+        """
+        run Test to check if result is equal to initialized string.
+        :return:
+        """
+        # initialize value to message variable.
+        message = str("Here is a test warning message.")
+
+        # pass the predefined message into alert_message function.
+        result = Impl.display_message(self, message)
+
+        # check if the two values in the parameter are matched.
+        self.assertEqual(result, message)
+
+# class starter.
+if __name__ == '__main__':
+    unittest.main()
+

+ 31 - 0
appunittest3.py

@@ -0,0 +1,31 @@
+# File Name: appunittest3.py
+# Modified Date: March 26, 2017
+# Description: This class is to test sorting function.
+# Method Level Comment: Python Convention (inside function)
+__author__ = "Inyoung Choung"
+
+import unittest
+from implementation import Impl
+
+# testing sorting function.
+class testSort(unittest.TestCase):
+    def runTest(self):
+        """
+        run Test to see if the expected array is equal to the sorted list.
+        :return:
+        """
+        # list of Strings
+        list = ['inyoung', 'banana', 'camera']
+        # calls sort function and pass the list in the parameter.
+        result = Impl.sort(self, list)
+
+        # expected result after sorting.
+        expected = ['banana', 'camera', 'inyoung']
+
+        # check if the two values in the parameter are matched.
+        self.assertEqual(result, expected)
+
+# class starter
+if __name__ == '__main__':
+    unittest.main()
+

+ 43 - 0
impl_interface.py

@@ -0,0 +1,43 @@
+# File Name: impl_interface.py
+# Modified Date: April 15, 2017
+# Description: This class contains abstract behaviours.
+# Method Level Comment: Java Convention (I am not certain of Python convention because there is no body for functions.)
+__author__ = "Inyoung Choung"
+
+from abc import ABCMeta, abstractclassmethod
+
+# this class is an abstract interface
+class ImplInterface(object):
+    ___metaclass__= ABCMeta
+
+    # this is abstract method to validate empty fields.
+    @abstractclassmethod
+    def validate_emptyfields(self): pass
+
+
+    # this is abstract method to convert weight types.
+    @abstractclassmethod
+    def convert(self, weightT1, weightT2, weight2): pass
+
+    # this is abstract method to calculate price.
+    @abstractclassmethod
+    def calculate(self): pass
+
+    # this is abstract method to display message to user.
+    @abstractclassmethod
+    def display_message(self): pass
+
+    # this is abstract method to returns result.
+    @abstractclassmethod
+    def get_result(self): pass
+
+    # this is abstract method to sort a list.
+    @abstractclassmethod
+    def sort(self, list): pass
+
+    # this is abstract method to write a list to a file.
+    @abstractclassmethod
+    def writefile(self, path, stuff_to_print): pass
+
+
+

+ 279 - 0
implementation.py

@@ -0,0 +1,279 @@
+# File Name: implementation.py
+# Modified Date: April 16, 2017
+# Description: This class does functionalities such as validation check, calculation and
+#              it also interacts with users by displaying a result message as a popup window.
+# Method Level Comment: Python Convention (inside function)
+__author__ = "Inyoung Choung"
+
+import tkinter
+from tkinter import messagebox
+from impl_interface import ImplInterface
+
+# Impl class implements ImplInterface.
+class Impl(ImplInterface):
+    # Here are the global variables that can be accessed throughout the class.
+    global itemtype, brandN1, brandN2
+    global price1, price2
+    global weight1, weightT1, weight2, weightT2
+    global discount1, discountT1, discount2, discountT2
+    global newWeightForSecondItem
+    global isEmpty
+    global isFinalized
+    global result
+    global list
+    global path
+
+    def __init__(self, itemtype, brandN1, brandN2, price1, price2, weight1, weightT1,
+                 weight2, weightT2, discount1, discountT1, discount2, discountT2):
+        """
+        This method is a constructor that initializes parameters.
+        :param itemtype:
+        :param brandN1:
+        :param brandN2:
+        :param price1:
+        :param price2:
+        :param weight1:
+        :param weightT1:
+        :param weight2:
+        :param weightT2:
+        :param discount1:
+        :param discountT1:
+        :param discount2:
+        :param discountT2:
+        """
+        # initialize values to the class variables.
+        self.itemtype = itemtype
+        self.brandN1 = brandN1
+        self.brandN2 = brandN2
+        self.price1 = price1
+        self.price2 = price2
+        self.weight1 = weight1
+        self.weightT1 = weightT1
+        self.weight2 = weight2
+        self.weightT2 = weightT2
+        self.discount1 = discount1
+        self.discountT1 = discountT1
+        self.discount2 = discount2
+        self.discountT2 = discountT2
+
+        # calls this function to validate any empty fields from users.
+        self.validate_emptyfields()
+
+        # after users values are accepted, do calculation based on the weight types of the two items.
+        if self.weightT1 != self.weightT2:
+            # if the weight types are different,
+            # the second items should convert to the first item weight type.
+            self.newWeightForSecondItem = self.convert(self.weightT1, self.weightT2, self.weight2)
+
+        else:
+            # both items have the same weight type.
+            self.newWeightForSecondItem = self.weight2
+
+        # do calculation on which item is cheaper.
+        self.calculate()
+
+
+    def validate_emptyfields(self):
+        """
+        This function checks any null values.
+        :return:
+        """
+        # if there is any empty field
+        if (self.itemtype is None or self.itemtype == "" or
+            self.brandN1 is None or self.brandN1 == "" or
+            self.brandN2 is None or self.brandN2 == "" or
+            self.price1 is None or self.price1 == "" or
+            self. price2 is None or self.price2 == "" or
+            self.weight1 is None or self.weight1 == "" or
+            self.weightT1 is None or self.weightT1 == "" or
+            self. weight2 is None or self.weight2 == "" or
+            self.weightT2 is None or self.weightT2 == "" or
+            self.discount1 is None or self.discount1 == "" or
+            self.discountT1 is None or self.discountT1 == "" or
+            self.discount2 is None or self.discount2 == "" or
+            self.discountT2 is None or self.discountT2 == ""):
+                # if there is any empty field, initialize value; true to the variable.
+                self.isEmpty = True
+
+                # if there is any empty field, prompt a message to user.
+                self.display_message(None)
+        else:
+            # if there is no any empty field, initialize value; false to the variable.
+            self.isEmpty = False
+
+
+    def convert(self, weightT1, weightT2, weight2):
+        """
+        This function converts the second item weight type to the first weight item type.
+        :param weightT1:
+        :param weightT2:
+        :param weight2:
+        :return: self.weight2
+        """
+        if weightT1 == "lb":
+            if weightT2 == "kg":
+                self.weight2 = float(weight2) * 2.20462
+            elif weightT2 == "g":
+                self.weight2 = float(weight2) * 0.002205
+        elif weightT1 == "kg":
+            if weightT2 == "lb":
+                self.weight2 = float(weight2) * 0.453592
+            elif weightT2 == "g":
+                self.weight2 = float(weight2) * 0.001
+        elif weightT1 == "g":
+            if weightT2 == "kg":
+                self.weight2 = float(weight2) * 1000
+            elif weightT2 == "lb":
+                self.weight2 = float(weight2) * 453.592
+
+        # returns the converted second weight based on the first item weight type.
+        return self.weight2
+
+
+    def calculate(self):
+        """
+        This function calculates to see which item is cheaper by the unit weight.
+        :return: self.result
+        """
+        # checks which discount type each first item has and calculates the price to the final price.
+        if self.discountT1 == "percentage":
+            finalPrice1 = float(float(self.price1) - (float(self.price1) * (float(self.discount1) * float(0.01))) / float(self.weight1))
+        elif self.discountT1 == "dollar":
+            finalPrice1 = float((float(self.price1) - float(self.discount1)) / float(self.weight1))
+
+        # checks which discount type each second item has and calculates the price to the final price.
+        if self.discountT2 == "percentage":
+            finalPrice2 = float((float(self.price2) - (float(self.price2) * (float(self.discount2) * float(0.01)))) / float(self.newWeightForSecondItem))
+        elif self.discountT2 == "dollar":
+            finalPrice2 = float((float(self.price2) - (float(self.discount2))) / float(self.newWeightForSecondItem))
+
+        # compare the final price of the two items.
+        if finalPrice1 > finalPrice2:
+            priceDiff = float(round(finalPrice1 - finalPrice2, 3))
+            print(self.brandN1 + str(" is cheaper by "), priceDiff, str(" cents per unit weight "))
+            self.result = str(self.brandN1 + str(" is cheaper by ") + str(priceDiff) + str(" cents per unit weight "))
+        elif finalPrice1 < finalPrice2:
+            priceDiff = float(round(finalPrice2 - finalPrice1, 3))
+            print(self.brandN2 + str(" is cheaper by "), priceDiff, str(" cents per unit weight "))
+            self.result = str(self.brandN2 + str(" is cheaper by ") + str(priceDiff) + str(" cents per unit weight "))
+        else:
+            self.result = str("The price is equal so get anything!")
+
+        # once the calculation is done, initialize value; True to the variable.
+        self.isFinalized = True
+
+        # calls this function to display the popup message to the user.
+        self.display_message(None)
+        return self.result
+
+
+    def get_result(self):
+        """
+        This function returns String; result.
+        :return: self.result
+        """
+        return self.result
+
+
+    def display_message(self, message):
+        """
+        This function is to check which message is to display to user based on boolean variables.
+        :param message:
+        :return: message
+        """
+        if (message is None):
+            if self.isEmpty is True:
+                # hide main window
+                root = tkinter.Tk()
+                root.withdraw()
+
+                # show the error message to the user after validation.
+                messagebox.showerror("Alert - Empty fields", "Please fill out all the forms.")
+
+                # set False to isEmpty variable.
+                self.isEmpty = False
+
+            elif self.isFinalized is True:
+                # hide main window.
+                root = tkinter.Tk()
+                root.withdraw()
+
+                # show the result message to the user.
+                messagebox.showinfo("Calculation Result", self.result)
+        else:
+            # hide main window.
+            root = tkinter.Tk()
+            root.withdraw()
+
+            # This is for the pytest purpose and display the message that is passed from the parameter.
+            messagebox.showinfo("Calculation Result", message)
+            return message
+
+
+
+    def sort(self, list):
+        """
+        This function gets list, sort it and returns that list.
+        :param list:
+        :return: list
+        """
+        # sort the list in the alphabetical order.
+        list.sort()
+
+        # print out the string and the list to console.
+        print("This is a sorted brand_name list by the alphabetical order.")
+        print(list)
+
+        return list
+
+
+    def writefile(self, path, stuff_to_print):
+        """
+        TFile I/O - prints a sorted list of grocery items.
+        :param path:
+        :param stuff_to_print:
+        :return:
+        """
+        if path is None :
+            # set a specific path
+            self.path = "C:\In-young Choung\Computer Programming\Self Programming Files\grocerycalc\itemlist.txt"
+
+            # write a file if it doesn't exist
+            f = open(self.path, "w+")
+
+            # write each item of the grocery list inside the opened file
+            for i in stuff_to_print :
+                f.write(i)
+        else :
+            self.path = path
+
+            # write a file if it doesn't exist
+            f = open(self.path, "w+")
+
+            # write some texts inside the opened file
+            f.write(stuff_to_print)
+
+
+    def readfile(self):
+        """
+        read file that is created and pass filepath as a parameter.
+        :return:
+        """
+        # open the file in the defined path and "r" read it
+        f = open(self.path, "r")
+
+        # mode is matched with 'r' (read)
+        if f.mode == 'r':
+            # use read function to read the entire file.
+            contents = f.read()
+
+            # print the file content in the console
+            print("This is a list from reading a file.")
+
+            # print the file content by one letter at a time
+            for i in contents:
+                print(i)
+        else :
+            print("wrong mode in readfile function.")
+
+

+ 1 - 0
itemlist.txt

@@ -0,0 +1 @@
+Aurora Salad FixinsBoulder CanyonClover Leaf Pink Dream Almond UnsweetenedGloryBee, Organic Raw HoneyGreat Value Light MayonnaiseGreat Value Sockeye Hellmanns Real MayonnaiseHershey's Chipits (milk)Hershey's Chipits (semi sweet)Inari Organic Long Brown RiceInari Organic Whole AlmondsKettle Sea Salt Potato ChipsKool-Aid WatermelonKoreanLangnese Forest HoneyMaple Leaf Boneless BreastsMaple Leaf Boneless ThighsMaxwell House Original RoastMiO WatermelonNatrel Nestea Lemon Iced TeaOasis Exotic Mango JuiceOrganic Raw AlmondsRaminSmart Life Salad TopperTilda Pure Steamed Basmati RiceTim Hortons Fine Grind CoffeemyEggsyourEggs

+ 1 - 0
pytest.txt

@@ -0,0 +1 @@
+pythontest

+ 4 - 0
static/css/inyoung.css

@@ -1,3 +1,7 @@
+/*File Name: inyoung.css
+Modified Date: April 15, 2017
+Description: it's to modify look and feel.*/
+
 .container-full {
     background-image:
             url(' /static/image/pexels-photo-26799.jpg');

+ 4 - 0
static/css/styles.css

@@ -1,3 +1,7 @@
+/*File Name: style.css
+Modified Date: April 15, 2017
+Description: it's to modify look and feel.*/
+
 html,body {
   height:100%;
 

+ 1 - 1
static/js/scripts.js

@@ -33,7 +33,7 @@ function calc_handle(itemtype, brandN1, brandN2, price1, price2,
     x.open("GET", '/calculate?param1=' + itemtype + '&param2=' + brandN1 + '&param3=' + brandN2 +
                     '&param4=' + price1 + '&param5=' + price2 + '&param6=' + weight1 + '&param7=' + weightT1 +
                     '&param8=' + weight2 + '&param9=' + weightT2 + '&param10=' + discount1 + '&param11=' + discountT1 +
-                    '&param12=' + discount2 + '&param13=' + discountT2 + true);
+                    '&param12=' + discount2 + '&param13=' + discountT2);
 
     // fire the request
     x.send();

+ 9 - 11
templates/index.html

@@ -2,7 +2,7 @@
 <!--
 File Name: index.html
 Author Name: In-young Choung
-Date: March 1, 2017
+Date: April 15, 2017
 Description: This html serves content locally to interact with users
              and sends users' input values to Javascript.
 >
@@ -15,14 +15,15 @@ Description: This html serves content locally to interact with users
     <title>Calculate Grocery</title>
     <meta name="generator" content="Bootply" />
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-    <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
 {#    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">#}
     <!--[if lt IE 9]>
-{#      <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>#}
+      <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
     <![endif]-->
+    <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
     <link href="{{ url_for('static', filename='css/styles.css') }}" rel="stylesheet">
     <link href="{{ url_for('static', filename='css/inyoung.css') }}" rel="stylesheet">
 
+
 </head>
 
 <body>
@@ -36,10 +37,10 @@ Description: This html serves content locally to interact with users
                 <br>
                 <form class="col-lg-12" action="{{url_for('index')}}" method="POST">
                     <div class="input-group" style="width:340px;text-align:center;margin:0 auto;, ">
-                        <input class="form-control input-lg" title="Don't worry. We hate spam, and will not share your email with anyone." placeholder="Enter your email address" type="email" name="email">
+                       {# <input class="form-control input-lg" title="Don't worry. We hate spam, and will not share your email with anyone." placeholder="Enter your email address" type="email" name="email">
                         <input class="form-control input-lg" title="Use the password you use for everything. Trust us." placeholder="Enter your password" type="password" name="password">
 
-                        <span class="input-group-btn"><button class="btn btn-lg btn-primary" type="submit">GO</button></span>
+                        <span class="input-group-btn"><button class="btn btn-lg btn-primary" type="submit">GO</button></span>#}
                     </div>
                 </form>
             </div>
@@ -47,7 +48,7 @@ Description: This html serves content locally to interact with users
 {#                action="action_page.php"#}
 
 
-            <br>
+            <br><br>
             <form id = "calcform" style = "margin-left: 20%">
             <table id="comparison-table" style="width: auto;">
                 <tr>
@@ -115,7 +116,7 @@ Description: This html serves content locally to interact with users
                     <td>
                         <select>
                             <option>percentage</option>
-                            <option>buy and get free</option>
+                            <option>dollar</option>
                         </select>
                     </td>
                     <td>
@@ -124,13 +125,12 @@ Description: This html serves content locally to interact with users
                     <td>
                         <select>
                             <option>percentage</option>
-                            <option>buy and get free</option>
+                            <option>dollar</option>
                         </select>
                     </td>
                  </tr>
                 </table>
             <br><br>
-            <input type="text" value="{{ my_total }}" class="calculate_result" readonly>
             <button type="button"
                     onclick="calc_handle(this.form[0].value, this.form[1].value,
                                          this.form[2].value, this.form[3].value,
@@ -142,8 +142,6 @@ Description: This html serves content locally to interact with users
                     value="calculate_btn">Calculate</button>
             <br><br>
         </form>
-
-<p>If you click the "Submit" button, the form-data will be sent to a page called "action_page.php".</p>
         <!-- /row -->
 
         <div class="row">

+ 0 - 56
templates/success.html

@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-    <meta charset="utf-8">
-    <title>Landing Page template</title>
-    <meta name="generator" content="Bootply" />
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-    <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
-    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
-    <!--[if lt IE 9]>
-      <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
-    <![endif]-->
-    <link href="{{ url_for('static', filename='css/styles.css') }}" rel="stylesheet">
-</head>
-
-<body>
-    <div class="container-full">
-        <div class="row">
-            <div class="col-lg-12 text-center v-center">
-                <h1>Authenticated. Do your thing.</h1>
-                <p class="lead">Ruviate.</p>
-                <br>
-                <br>
-                <br>
-                <form class="col-lg-12">
-                    <div class="input-group" style="width:340px;text-align:center;margin:0 auto;">
-                        <h3>Thank you!</h3>
-                        <p>Hopefully you know the secrets.</p>
-                    </div>
-                </form>
-            </div>
-
-        </div>
-        <!-- /row -->
-
-        <div class="row">
-            <div class="col-lg-12 text-center v-center" style="font-size:39pt;">
-                <a href="#"><i class="icon-google-plus"></i></a>  <a href="#"><i class="icon-facebook"></i></a>  <a href="#"><i class="icon-twitter"></i></a>  <a href="#"><i class="icon-github"></i></a>  <a href="#"><i class="icon-pinterest"></i></a>
-            </div>
-        </div>
-        <br>
-        <br>
-        <br>
-        <br>
-        <br>
-    </div>
-
-    <!-- script references -->
-    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
-    <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
-    <script src="{{ url_for('static', filename='js/scripts.js') }}"></script>
-</body>
-
-</html>