diff --git a/project/build/index.html b/project/build/index.html index fd91078..b4aaeaf 100644 --- a/project/build/index.html +++ b/project/build/index.html @@ -42,7 +42,7 @@ - +
@@ -206,7 +206,7 @@
  • Pricing 4 Cols
  • --> -
  • Gallery
  • +
  • Gallery
  • @@ -221,7 +221,7 @@ -
    + @@ -412,7 +412,7 @@ -
    + diff --git a/project/build/gallery/index.html b/project/build/portfolio/index.html similarity index 51% rename from project/build/gallery/index.html rename to project/build/portfolio/index.html index 85fd961..25416d8 100644 --- a/project/build/gallery/index.html +++ b/project/build/portfolio/index.html @@ -42,7 +42,7 @@ - +
    @@ -206,7 +206,7 @@
  • Pricing 4 Cols
  • --> -
  • Gallery
  • +
  • Gallery
  • @@ -221,13 +221,389 @@ -
    + + + +
    +
    +
    +
    +

    Gallery

    +
      +
    • Home
    • +
    • /
    • +
    • Gallery
    • +
    +
    +
    +
    +
    + + + +
    + +
    +
    + +
    + + +
    +
    + + +
    +
    + + + + +
    + +
    + + + + + + + + + +
    + + -
    diff --git a/project/portfolio/residential/residential (1).jpeg b/project/build/portfolio/residential/residential(1).jpeg similarity index 100% rename from project/portfolio/residential/residential (1).jpeg rename to project/build/portfolio/residential/residential(1).jpeg diff --git a/project/portfolio/residential/residential (10).jpeg b/project/build/portfolio/residential/residential(10).jpeg similarity index 100% rename from project/portfolio/residential/residential (10).jpeg rename to project/build/portfolio/residential/residential(10).jpeg diff --git a/project/portfolio/residential/residential (11).jpeg b/project/build/portfolio/residential/residential(11).jpeg similarity index 100% rename from project/portfolio/residential/residential (11).jpeg rename to project/build/portfolio/residential/residential(11).jpeg diff --git a/project/portfolio/residential/residential (12).jpeg b/project/build/portfolio/residential/residential(12).jpeg similarity index 100% rename from project/portfolio/residential/residential (12).jpeg rename to project/build/portfolio/residential/residential(12).jpeg diff --git a/project/portfolio/residential/residential (13).jpeg b/project/build/portfolio/residential/residential(13).jpeg similarity index 100% rename from project/portfolio/residential/residential (13).jpeg rename to project/build/portfolio/residential/residential(13).jpeg diff --git a/project/portfolio/residential/residential (14).jpeg b/project/build/portfolio/residential/residential(14).jpeg similarity index 100% rename from project/portfolio/residential/residential (14).jpeg rename to project/build/portfolio/residential/residential(14).jpeg diff --git a/project/portfolio/residential/residential (15).jpeg b/project/build/portfolio/residential/residential(15).jpeg similarity index 100% rename from project/portfolio/residential/residential (15).jpeg rename to project/build/portfolio/residential/residential(15).jpeg diff --git a/project/portfolio/residential/residential (16).jpeg b/project/build/portfolio/residential/residential(16).jpeg similarity index 100% rename from project/portfolio/residential/residential (16).jpeg rename to project/build/portfolio/residential/residential(16).jpeg diff --git a/project/portfolio/residential/residential (17).jpeg b/project/build/portfolio/residential/residential(17).jpeg similarity index 100% rename from project/portfolio/residential/residential (17).jpeg rename to project/build/portfolio/residential/residential(17).jpeg diff --git a/project/portfolio/residential/residential (18).jpeg b/project/build/portfolio/residential/residential(18).jpeg similarity index 100% rename from project/portfolio/residential/residential (18).jpeg rename to project/build/portfolio/residential/residential(18).jpeg diff --git a/project/portfolio/residential/residential (19).jpeg b/project/build/portfolio/residential/residential(19).jpeg similarity index 100% rename from project/portfolio/residential/residential (19).jpeg rename to project/build/portfolio/residential/residential(19).jpeg diff --git a/project/portfolio/residential/residential (2).jpeg b/project/build/portfolio/residential/residential(2).jpeg similarity index 100% rename from project/portfolio/residential/residential (2).jpeg rename to project/build/portfolio/residential/residential(2).jpeg diff --git a/project/portfolio/residential/residential (20).jpeg b/project/build/portfolio/residential/residential(20).jpeg similarity index 100% rename from project/portfolio/residential/residential (20).jpeg rename to project/build/portfolio/residential/residential(20).jpeg diff --git a/project/portfolio/residential/residential (21).jpeg b/project/build/portfolio/residential/residential(21).jpeg similarity index 100% rename from project/portfolio/residential/residential (21).jpeg rename to project/build/portfolio/residential/residential(21).jpeg diff --git a/project/portfolio/residential/residential (3).jpeg b/project/build/portfolio/residential/residential(3).jpeg similarity index 100% rename from project/portfolio/residential/residential (3).jpeg rename to project/build/portfolio/residential/residential(3).jpeg diff --git a/project/portfolio/residential/residential (4).jpeg b/project/build/portfolio/residential/residential(4).jpeg similarity index 100% rename from project/portfolio/residential/residential (4).jpeg rename to project/build/portfolio/residential/residential(4).jpeg diff --git a/project/portfolio/residential/residential (5).jpeg b/project/build/portfolio/residential/residential(5).jpeg similarity index 100% rename from project/portfolio/residential/residential (5).jpeg rename to project/build/portfolio/residential/residential(5).jpeg diff --git a/project/portfolio/residential/residential (6).jpeg b/project/build/portfolio/residential/residential(6).jpeg similarity index 100% rename from project/portfolio/residential/residential (6).jpeg rename to project/build/portfolio/residential/residential(6).jpeg diff --git a/project/portfolio/residential/residential (7).jpeg b/project/build/portfolio/residential/residential(7).jpeg similarity index 100% rename from project/portfolio/residential/residential (7).jpeg rename to project/build/portfolio/residential/residential(7).jpeg diff --git a/project/portfolio/residential/residential (8).jpeg b/project/build/portfolio/residential/residential(8).jpeg similarity index 100% rename from project/portfolio/residential/residential (8).jpeg rename to project/build/portfolio/residential/residential(8).jpeg diff --git a/project/portfolio/residential/residential (9).jpeg b/project/build/portfolio/residential/residential(9).jpeg similarity index 100% rename from project/portfolio/residential/residential (9).jpeg rename to project/build/portfolio/residential/residential(9).jpeg diff --git a/project/portfolio/routes.py b/project/portfolio/routes.py index 3d31e4e..43ac9f9 100644 --- a/project/portfolio/routes.py +++ b/project/portfolio/routes.py @@ -1,5 +1,7 @@ from . import portfolio_blueprint -from flask import render_template, abort +from flask import render_template, abort, send_from_directory +from os import listdir +import os categories = ['residential', 'commercial', 'office', 'industrial'] @@ -7,6 +9,21 @@ categories = ['residential', 'commercial', 'office', 'industrial'] def index(): return render_template('index.html') -@portfolio_blueprint.route('/gallery/') +@portfolio_blueprint.route('/portfolio/') def gallery(): - return render_template('gallery.html') \ No newline at end of file + photos = listdir('portfolio/residential') + return render_template('gallery.html', photos=photos) + +def photo_generator(): + for photo in listdir('portfolio/residential'): + path = photo + yield ('show_photo', {'category':'residential', 'filename':path}) + +@portfolio_blueprint.route('/portfolio//') +def show_photo(category, filename): + root_dir = os.getcwd() + # print(os.getcwd()) + # print(os.path.join(os.getcwd(), 'portfolio', category, filename)) + # print(listdir('portfolio/residential')) + + return send_from_directory(os.path.join(root_dir, 'portfolio', category), filename) \ No newline at end of file diff --git a/project/portfolio/templates/gallery.html b/project/portfolio/templates/gallery.html deleted file mode 100644 index 2a94e05..0000000 --- a/project/portfolio/templates/gallery.html +++ /dev/null @@ -1,238 +0,0 @@ -{% extends "gallery.html" %} - -{% block content %} - - -
    - -
    - - -
    - - - - -
    - Get Quotation -
    - - - - -
    - -{% endblock %} \ No newline at end of file diff --git a/project/templates/base.html b/project/templates/base.html index be53596..37e518d 100644 --- a/project/templates/base.html +++ b/project/templates/base.html @@ -42,7 +42,7 @@ - +
    @@ -221,11 +221,11 @@ -
    + {% block content %} {% endblock %} -
    + diff --git a/project/templates/gallery.html b/project/templates/gallery.html index e5649a3..bf0c0b3 100644 --- a/project/templates/gallery.html +++ b/project/templates/gallery.html @@ -1,6 +1,82 @@ {% extends "base.html" %} {% block content %} + + +
    +
    +
    +
    +

    Gallery

    +
      +
    • Home
    • +
    • /
    • +
    • Gallery
    • +
    +
    +
    +
    +
    + + + +
    + +
    +
    + +
    + + +
    +
    + + +
    +
    + - {% endblock %} \ No newline at end of file + + + +
    + +
    + + + + + + + + + +
    + +{% endblock %} \ No newline at end of file