Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/top-navigation.html
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | <div class="btn-group float-right swh-actions-dropdown"> | ||||
{% if top_right_link %} | {% if top_right_link %} | ||||
<a href="{{ top_right_link.url | safe }}" class="btn btn-default btn-sm" role="button"> | <a href="{{ top_right_link.url | safe }}" class="btn btn-default btn-sm" role="button"> | ||||
{% if top_right_link.icon %} | {% if top_right_link.icon %} | ||||
<i class="{{ top_right_link.icon }} fa-fw"></i> | <i class="{{ top_right_link.icon }} fa-fw"></i> | ||||
{% endif %} | {% endif %} | ||||
{{ top_right_link.text }} | {{ top_right_link.text }} | ||||
</a> | </a> | ||||
{% endif %} | {% endif %} | ||||
{% if language_select %} | |||||
<select data-placeholder="Select Language" class="language-select chosen-select"> | |||||
<option value=""></option> | |||||
{% for lang in language_select %} | |||||
<option value="{{ lang }}">{{ lang }}</option> | |||||
{% endfor %} | |||||
</select> | |||||
{% endif %} | |||||
{% if show_actions_menu %} | {% if show_actions_menu %} | ||||
<button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"> | <button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"> | ||||
<i class="fa fa-bars fa-fw" aria-hidden="true"></i>Actions | <i class="fa fa-bars fa-fw" aria-hidden="true"></i>Actions | ||||
<span class="caret"></span> | <span class="caret"></span> | ||||
</button> | </button> | ||||
<ul class="dropdown-menu dropdown-menu-right swh-browse-actions-menu"> | <ul class="dropdown-menu dropdown-menu-right swh-browse-actions-menu"> | ||||
{% if not snapshot_context or not snapshot_context.is_empty %} | {% if not snapshot_context or not snapshot_context.is_empty %} | ||||
{% include "includes/vault-create-tasks.html" %} | {% include "includes/vault-create-tasks.html" %} | ||||
Show All 12 Lines | |||||
<script> | <script> | ||||
var snapshotContext = false; | var snapshotContext = false; | ||||
var branch = false; | var branch = false; | ||||
{% if snapshot_context %} | {% if snapshot_context %} | ||||
snapshotContext = true; | snapshotContext = true; | ||||
branch = "{{ snapshot_context.branch|escape }}"; | branch = "{{ snapshot_context.branch|escape }}"; | ||||
{% endif %} | {% endif %} | ||||
{% if language_select %} | |||||
vlorentz: What does this line do? | |||||
Done Inline ActionsIt was for initialising chosen on select. It works without this line, because of the next line. kalpitk: It was for initialising chosen on select.
It works without this line, because of the next line. | |||||
Not Done Inline Actions{{ language }} seems to be sanitized (when I try values with quotes, eg. http://127.0.0.1:5004/browse/origin/https://github.com/wcoder/highlightjs-line-numbers.js/content/gulpfile.js/?language=foo%22);%20alert(%22hello ), but where? vlorentz: `{{ language }}` seems to be sanitized (when I try values with quotes, eg. http://127.0.0.1… | |||||
Done Inline ActionsDjango auto-escapes template variables by default. kalpitk: Django auto-escapes template variables by default. | |||||
$(".chosen-select").val("{{ language }}"); | |||||
$(".chosen-select").chosen().change(function(event, params) { | |||||
updateLanguage(params.selected); | |||||
}); | |||||
{% endif %} | |||||
swh.browse.initSnapshotNavigation(snapshotContext, branch !== "None"); | swh.browse.initSnapshotNavigation(snapshotContext, branch !== "None"); | ||||
</script> | </script> |
What does this line do?