Skip to content

Commit

Permalink
Remove unneeded var.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzohrab committed Oct 26, 2023
1 parent 1141c7a commit 9c5f484
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion lute/read/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def term_form(langid, text):
repo,
'/read/frameform.html',
render_template('/read/updated.html', term_text=term.text),
show_language_selector = False,
embedded_in_reading_frame = True
)

Expand Down
4 changes: 0 additions & 4 deletions lute/templates/term/_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
<table id="term">
<tbody>

<p>{{ term }}</p>
<p>{{ term.language_id }}</p>
<p>{{ term.language }}</p>

<tr id="languageSel"
{% if term.language_id is none and term.language is none %}
{# show the language select box. #}
Expand Down
12 changes: 4 additions & 8 deletions lute/term/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def handle_term_form(
repo,
form_template_name,
return_on_success,
show_language_selector = False,
embedded_in_reading_frame = False
):
"""
Expand All @@ -75,27 +74,24 @@ def handle_term_form(
form=form,
term=term,
language_dicts=Language.all_dictionaries(),
show_language_selector=show_language_selector,

# TODO term tags: pass dynamic list.
tags=[ "apple", "bear", "cat" ],
embedded_in_reading_frame=embedded_in_reading_frame
)


def _handle_form(term, repo, show_language_selector):
def _handle_form(term, repo):
"""
Handle the form post. Only show lang. selector
for new terms.
"""
form = TermForm(obj=term)

return handle_term_form(
term,
repo,
'/term/formframes.html',
redirect('/term/index', 302),
show_language_selector = show_language_selector,
embedded_in_reading_frame = False
)

Expand All @@ -107,7 +103,7 @@ def edit(termid):
"""
repo = Repository(db)
term = repo.load(termid)
return _handle_form(term, repo, False)
return _handle_form(term, repo)


@bp.route('/editbytext/<int:langid>/<text>', methods=['GET', 'POST'])
Expand All @@ -117,7 +113,7 @@ def edit_by_text(langid, text):
"""
repo = Repository(db)
term = repo.find(langid, text)
return _handle_form(term, repo, False)
return _handle_form(term, repo)


@bp.route('/new', methods=['GET', 'POST'])
Expand All @@ -127,7 +123,7 @@ def new():
"""
repo = Repository(db)
term = Term()
return _handle_form(term, repo, True)
return _handle_form(term, repo)


@bp.route('/search/<text>/<int:langid>', methods=['GET'])
Expand Down

0 comments on commit 9c5f484

Please sign in to comment.