-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue_537_bulk_term_actions' into develop
- Loading branch information
Showing
21 changed files
with
817 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% extends 'read/term_form_base.html' %} | ||
|
||
{% block include_term_form %} | ||
<script type="text/javascript" src="{{ url_for('static', filename='js/lute-hotkey-utils.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript"> | ||
const LUTE_USER_SETTINGS = {{ user_settings | safe }} | ||
</script> | ||
|
||
<div id="term-form-container"> | ||
<div style="margin-bottom: 1em;"> | ||
<i><span id="bulkUpdateCount">Updating terms</span></i> | ||
</div> | ||
<form id="term-form" name="term_form" method="POST" action="/term/bulk_edit_from_reading_pane"> | ||
<div id="term-bulk-form-fields"> | ||
{% include 'term/_bulk_edit_form_fields.html' %} | ||
<div id="term-button-container"> | ||
<button id="btnsubmit" type="submit" class="btn btn-primary" onclick="return get_selected_word_ids();">Save</button> | ||
</div> | ||
<div id="term"> | ||
</form> | ||
</div> | ||
|
||
<script> | ||
/** Get the selected words, submit if any selected. */ | ||
function get_selected_word_ids() { | ||
const elements = $(parent.document).find("span.kwordmarked"); | ||
const wordIds = elements.map(function () { | ||
return $(this).data("wid"); | ||
}).get(); | ||
if (wordIds.length == 0) | ||
return false; | ||
$("#txtWordIds").val(wordIds.join(",")); | ||
return true; | ||
} | ||
|
||
/** Function required by _bulk_edit_form_fields.html */ | ||
// Probably a better way to do this ... | ||
function get_lang_id() { | ||
const elements = $(parent.document).find("span.word"); | ||
if (elements.length == 0) { | ||
console.log("No words on page ..."); | ||
return -999; // dummy | ||
} | ||
const first = elements.first(); | ||
return $(first).data("lang-id"); | ||
} | ||
|
||
// "Save" shortcut | ||
$(document).keydown(function(event) { | ||
const s = get_pressed_keys_as_string(event); | ||
if (s == LUTE_USER_SETTINGS.hotkey_SaveTerm) { | ||
$("#btnsubmit").click(); | ||
} | ||
}); | ||
|
||
</script> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
<title>Form</title> | ||
|
||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/jquery/jquery-ui.css') }}" /> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/tagify/tagify.css') }}" /> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/tagify/tagify_overrides.css') }}" /> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}" /> | ||
{% extends 'read/term_form_base.html' %} | ||
|
||
<link rel="stylesheet" type="text/css" href="/theme/current"> | ||
<link rel="stylesheet" type="text/css" href="/theme/custom_styles"> | ||
|
||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery.scrollTo.min.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery-ui.min.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery.jeditable.mini.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/tagify/tagify.min.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/tagify/tagify.polyfills.min.js') }}" charset="utf-8"></script> | ||
|
||
<script type="text/javascript"> | ||
var temp_tags = '{{ tags | tojson }}'; | ||
var TAGS = Array.from(JSON.parse(temp_tags)); | ||
</script> | ||
|
||
</head> | ||
|
||
<body> | ||
{% if term.flash_message %} | ||
{% block include_term_form %} | ||
{% if term.flash_message %} | ||
<p class='small-flash-notice'>{{ term.flash_message }}</p> | ||
{% endif %} | ||
{% include 'term/_form.html' %} | ||
</body> | ||
|
||
</html> | ||
{% endif %} | ||
{% include 'term/_form.html' %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
<title>Form</title> | ||
|
||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/jquery/jquery-ui.css') }}" /> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/tagify/tagify.css') }}" /> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/tagify/tagify_overrides.css') }}" /> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}" /> | ||
|
||
<link rel="stylesheet" type="text/css" href="/theme/current"> | ||
<link rel="stylesheet" type="text/css" href="/theme/custom_styles"> | ||
|
||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery.scrollTo.min.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery-ui.min.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/jquery/jquery.jeditable.mini.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/tagify/tagify.min.js') }}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{{ url_for('static', filename='vendor/tagify/tagify.polyfills.min.js') }}" charset="utf-8"></script> | ||
|
||
</head> | ||
|
||
<body> | ||
{% block include_term_form %}{% endblock %} | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.