Skip to content

Commit

Permalink
Remove need for show_language_selector, can be derived.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzohrab committed Oct 26, 2023
1 parent 43cd586 commit 1141c7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lute/templates/term/_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@
<table id="term">
<tbody>

<tr id="languageSel" {% if not show_language_selector %}style="display:none;"{% endif %}>
<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. #}
{% else %}
style="display:none;"
{% endif %}>
<td>{{ form.language_id(class="form-control") }}</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion lute/term/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self):
self.current_image = None

def __repr__(self):
return f'<Term BO "{self.text}">'
return f'<Term BO "{self.text}" lang_id={self.language_id} lang={self.language}>'

@property
def language(self):
Expand Down

0 comments on commit 1141c7a

Please sign in to comment.