diff --git a/MyPortfolio/data.json b/MyPortfolio/data.json index b5d270aa1ced51ff6f8ff938a7d537c2ea12593b..4572ba40389ff953867a57aac2c9586bf1af214b 100644 --- a/MyPortfolio/data.json +++ b/MyPortfolio/data.json @@ -16,13 +16,13 @@ "course_id": "TDP003", "end_date": "2009-09-06", "project_id": 1, - "big_image": "XXX" + "big_image": "https://miro.medium.com/v2/resize:fit:1400/0*UD5SJeGeDOJDJanZ" }, { "start_date": "2009-09-07", "short_description": "Spreadsheet program for economics.", "course_name": "OK\u00c4NT", - "long_description": "This is a spreadsheet program, perfect for when you need to budget your snus!", + "long_description": "This is a excel clone, perfect for when you need to budget your snus!", "group_size": 4, "academic_credits": "WUT?", "lulz_had": "few", @@ -31,13 +31,14 @@ "techniques_used": [ "c++", "csv", - "python" + "python", + "pandas" ], "project_name": "Spreader", "course_id": "TDP003", "end_date": "2009-09-08", "project_id": 2, - "big_image": "XXX" + "big_image": "https://cdn.britannica.com/29/147629-050-71369707/Screenshot-Microsoft-Excel.jpg" }, { "start_date": "2009-09-08", @@ -57,7 +58,7 @@ "course_id": "TDP003", "end_date": "2009-09-11", "project_id": 3, - "big_image": "XXX" + "big_image": "https://m.media-amazon.com/images/I/81s2LsEkFnL._AC_UF1000,1000_QL80_.jpg" }, { "start_date": "2009-09-09", @@ -79,13 +80,13 @@ "course_id": " \"", "end_date": "2009-09-10", "project_id": 4, - "big_image": "XXX" + "big_image": "https://www.svtstatic.se/image-news/480/wide/0.5/0.5/e-15892158-1510121858000" }, { "start_date": "2009-09-10", "short_description": "Swedish neovim plugin", "course_name": "HOHO", - "long_description": "Allows for swedish to autocompleted and spellchecked in NeoVim!", + "long_description": "Allows for swedish to autocompleted and spellchecked in NeoVim! Spread the word!", "group_size": 8, "academic_credits": "WUT?", "lulz_had": "over 9000", @@ -100,7 +101,7 @@ "course_id": " \"", "end_date": "2009-09-15", "project_id": 5, - "big_image": "XXX" + "big_image": "https://external-preview.redd.it/the-complete-guide-to-ios-macos-development-in-neovim-v0-eqhjSrRyyRM0TzH_MILAzGdIt4VL9s1qDa-tekA0-iQ.jpg?width=1080&crop=smart&auto=webp&s=5ab3616d5ace8cede13e49093d5e84f4ad98f403" }, { "start_date": "2009-09-12", @@ -120,6 +121,6 @@ "course_id": " \"", "end_date": "2009-09-18", "project_id": 6, - "big_image": "XXX" + "big_image": "https://external-preview.redd.it/i-created-a-simple-mod-manager-that-allows-you-to-easily-v0-k6wSM98B9HfhzZ2hymBc66TPXqlDqKuAIxXmIkP25bA.png?format=pjpg&auto=webp&s=d98d33691357ad0ff77c5c69ed91cfe7dee8e5bd" } ] diff --git a/MyPortfolio/data.py b/MyPortfolio/data.py index f6a7152677fe8ed0422ac2f37caf3be287f61f70..318064d5669d9d7b2d7788105b931727de8810fd 100644 --- a/MyPortfolio/data.py +++ b/MyPortfolio/data.py @@ -108,7 +108,7 @@ def search(data, sort_by='start_date', sort_order='desc', techniques=None, searc search_results = [] for project in results: - if search_fields is not None and search_fields != "" and search != "": + if search_fields is not None and search_fields != "" and search != "" and search_fields != ['None']: for field in search_fields: substring = project[field] # Check type before calling lower() diff --git a/MyPortfolio/myFlaskProject.py b/MyPortfolio/myFlaskProject.py index bdc61295a8c8e0566a178618ad9c1c6e88cd25eb..ec72c3a2f15045ba724754d62e33aedd51ec11ef 100644 --- a/MyPortfolio/myFlaskProject.py +++ b/MyPortfolio/myFlaskProject.py @@ -38,11 +38,13 @@ def techniques(): search_query = request.form.get('search', '') sort_by = request.form.get('sort_by', 'start_date') sort_order = request.form.get('sort_order', 'desc') + search_field = request.form.getlist('search_field', None) techniques_search = request.form.getlist('technique') #print(techniques_search) + print(search_field) - filtered_projects = search(load('data.json'), sort_by=sort_by, sort_order=sort_order, techniques=techniques_search, search=search_query) + filtered_projects = search(load('data.json'), sort_by=sort_by, sort_order=sort_order, techniques=techniques_search, search=search_query, search_fields=search_field) return render_template('techniques.html', techniques = techniques, @@ -50,7 +52,8 @@ def techniques(): projects=filtered_projects, search_query=search_query, sort_by=sort_by, - sort_order=sort_order) + sort_order=sort_order, + search_field=search_field) if __name__ == "__main__": app.run(debug=True) diff --git a/MyPortfolio/static/style/main.css b/MyPortfolio/static/style/main.css index 411afe7f64d9050e0b263350ae8bc520e4663a45..38d952046c41d8ff361dd0434b378e31b74b57c6 100644 --- a/MyPortfolio/static/style/main.css +++ b/MyPortfolio/static/style/main.css @@ -180,7 +180,7 @@ header a { flex-shrink: 1; - background:rgba(25,25,25,.1); + background:rgba(25,25,25,.3); height: 175px; width: 300px; @@ -301,9 +301,9 @@ header a { .project-showcase img { - object-fit:scale-down; - width: 25%; - height: 25%; + object-fit:fill; + width: 50%; + height: 50%; } @@ -311,7 +311,7 @@ header a { display: flex; width: 100%; align-content: center; - margin-top: 85px; + margin-top: 30px; margin-bottom: 125px; } diff --git a/MyPortfolio/templates/project_details.html b/MyPortfolio/templates/project_details.html index 3f11d6ac8887fec1c82e194b9a5a25817c551ce7..c0782af9ff3a422b715c5848196e706762d21109 100644 --- a/MyPortfolio/templates/project_details.html +++ b/MyPortfolio/templates/project_details.html @@ -24,7 +24,7 @@ <div class="content-container"> <div class="project-showcase"> <h1>{{ project['project_name'] }}</h1> - <img class="showcase-img" src="{{ project['small_image'] }}" alt="Project Image"> + <img class="showcase-img" src="{{ project['big_image'] }}" alt="Project Image"> <div class="project-stats"> <ul> diff --git a/MyPortfolio/templates/techniques.html b/MyPortfolio/templates/techniques.html index 3b2322042d9a6a191cc9f5db150b2ccfd53d2d07..45df760256f9d95e8a6ae4fea398c5f947e637e1 100644 --- a/MyPortfolio/templates/techniques.html +++ b/MyPortfolio/templates/techniques.html @@ -41,6 +41,14 @@ <option value="desc" {% if sort_order == 'desc' %}selected{% endif %}>Descending</option> <option value="asc" {% if sort_order == 'asc' %}selected{% endif %}>Ascending</option> </select> + <select name="search_field"> + <option value=None {% if search_field == None %}selected{% endif %}>All</option> + <option value="long_description" {% if search_field == ['long_description'] %}selected{% endif %}>Description</option> + <option value="start_date" {% if search_field == ['start_date'] %}selected{% endif %}>Start Date</option> + <option value="end_date" {% if search_field == ['end_date'] %}selected{% endif %}>End Date</option> + <option value="project_name" {% if search_field == ['project_name'] %}selected{% endif %}>Project Name</option> + <option value="course_name" {% if search_field == ['course_name'] %}selected{% endif %}>Course Name</option> + </select> <button type="submit">Search</button> </div>