Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rxd
AI
Commits
191efa91
Commit
191efa91
authored
2 years ago
by
rxd
Browse files
Options
Downloads
Patches
Plain Diff
empty search check
parent
8b0fb0f9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MemeGenerator/templates/index.html
+1
-2
1 addition, 2 deletions
MemeGenerator/templates/index.html
MemeGenerator/views/index.py
+4
-0
4 additions, 0 deletions
MemeGenerator/views/index.py
with
5 additions
and
2 deletions
MemeGenerator/templates/index.html
+
1
−
2
View file @
191efa91
...
...
@@ -6,12 +6,11 @@
<div
class=
"card-header"
>
Your next Viral Meme starts here...
</div>
<div
class=
"card-body"
>
<div
class=
"form-center"
>
<form
action=
"{{url_for("
show_search
",
page=
1)}}"
method=
"GET"
>
<form
name=
"search_form"
action=
"{{url_for("
show_search
",
page=
1)}}"
"
method=
"GET"
>
<input
type=
"text"
value=
"{{ query }}"
name=
"q"
/>
<input
type=
"submit"
value=
"Search"
/>
</form>
</div>
</div>
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
MemeGenerator/views/index.py
+
4
−
0
View file @
191efa91
...
...
@@ -5,6 +5,7 @@ MemeGenerator index (main) view.
from
collections
import
defaultdict
import
os
import
sys
import
flask
...
...
@@ -25,6 +26,9 @@ def show_index():
def
show_search
(
page
=
1
):
"""
Show result search page.
"""
query
=
flask
.
request
.
args
.
get
(
'
q
'
)
# check for empty input as flickr doesn't allow empty search
if
query
==
''
:
query
=
'
UMICH
'
page
=
int
(
page
)
if
page
<
1
:
page
=
1
search_resutlts
=
flickr
.
photos
.
search
(
text
=
query
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment