Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisclark committed Dec 19, 2023
1 parent df3e33c commit 4641e4d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 128 deletions.
18 changes: 9 additions & 9 deletions explorer/static/js/src/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,19 @@ export class ExplorerEditor {
$(".sort").click(function(e) {
var t = $(e.target).data("sort");
var dir = $(e.target).data("dir");
$(".sort").addClass("bi-arrow-down-up");
$(".sort").removeClass("bi-arrow-down");
$(".sort").removeClass("bi-arrow-up");
$(".sort").addClass("bi-chevron-expand");
$(".sort").removeClass("bi-chevron-down");
$(".sort").removeClass("bi-chevron-up");
if (dir === "asc"){
$(e.target).data("dir", "desc");
$(e.target).addClass("bi-arrow-up");
$(e.target).removeClass("bi-arrow-down");
$(e.target).removeClass("bi-arrow-down-up");
$(e.target).addClass("bi-chevron-up");
$(e.target).removeClass("bi-chevron-down");
$(e.target).removeClass("bi-chevron-expand");
} else {
$(e.target).data("dir", "asc");
$(e.target).addClass("bi-arrow-down");
$(e.target).removeClass("bi-arrow-up");
$(e.target).removeClass("bi-arrow-down-up");
$(e.target).addClass("bi-chevron-down");
$(e.target).removeClass("bi-chevron-up");
$(e.target).removeClass("bi-chevron-expand");
}
var vals = [];
var ct = 0;
Expand Down
111 changes: 14 additions & 97 deletions explorer/static/scss/explorer.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
.cm-wrap { height: 350px; border: 1px solid silver}
.cm-scroller { overflow: auto; min-height: 350px }
.cm-content, .cm-gutter { min-height: 350px !important; }
.cm-wrap {
height: 350px;
border: 1px solid silver
}

.collapse.in {
display: table-row;
.cm-scroller {
overflow: auto;
min-height: 350px
}

.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.01s ease;
transition: height 0.01s ease;
.cm-content, .cm-gutter {
min-height: 350px !important;
}

.link-primary {
cursor: pointer;
}

.rows-input {
Expand Down Expand Up @@ -50,54 +52,21 @@ td.name.indented {
}

.stats-wrapper {
width: 120px;
display: none;
}

.stat-wrapper {
float: left;
width: 120px;
}

.stat-label {
width: 50%;
font-weight: 300;
}

.stat-value {
width: 50%;
font-weight: 500;
}

.stats-expand {
cursor: pointer;
padding-left: 5px;
}

.data-row {
white-space: pre;
}

.CodeMirror {
height: 400px;
}

.table>thead>tr>th.preview-header {
vertical-align: top;
white-space: nowrap;
}

div.sort {
cursor: pointer;
}

.pivot-table {
padding: 15px;
}

.pvtAxisContainer, .pvtVals {
border-color: #ddd;
}

#schema_frame {
width: 100%;
border: 0;
Expand All @@ -107,68 +76,16 @@ div.sort {
cursor: pointer;
}

.CodeMirror-lines .inserted {
animation: inserted-pulse 700ms;
}

@keyframes inserted-pulse {
0% {
background-color: #f9f2f4;
color: #c7254e;
font-weight: bold;
}
100% {
background-color: transparent;
color: inherit;
font-weight: normal;
}
}

.dropdown-menu {
z-index: 9999;
}

.dropdown-menu>li>input {
display: block;
padding: 3px 20px;
clear: both;
font-weight: 400;
line-height: 1.42857143;
color: #333;
white-space: nowrap;
width: 100%;
text-align: left;
}

.dropdown-menu>li>input:hover {
color: #262626;
text-decoration: none;
background-color: #f5f5f5;
}

a#fullscreen {
padding-left: 1rem;
}

.counter {
display: none;
background-color: #ecf0f1;
font-family: monospace;
}

.name a {
text-decoration: none !important;
}

.sql {
width: 33%;
}

#sql_toggle {
padding-left: 1rem;
color: #18bc9c;
}

.query_favorite_toggle {
cursor: pointer;
}
Expand Down
28 changes: 13 additions & 15 deletions explorer/templates/explorer/preview_pane.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{% endblocktrans %}
</div>
<div class="col text-end">
<span>
<span class="me-1">
{% if rows > total_rows %}
{% trans "Showing" %}&nbsp;
<input class="rows-input" type="text" name="rows" id="rows"
Expand All @@ -44,14 +44,10 @@
{% endif %}
{% blocktrans %}of {{ total_rows }} total rows.{% endblocktrans %}
</span>
<span>
<small>
<a id="fullscreen" href="./?{{ fullscreen_params }}" target="_blank"
title="Fullscreen results">
<i class="bi-arrows-angle-expand"></i>
</a>
</small>
</span>
<a id="fullscreen" href="./?{{ fullscreen_params }}" target="_blank"
title="Fullscreen results">
<i class="bi-arrows-angle-expand"></i>
</a>
</div>
</div>
</div>
Expand All @@ -62,8 +58,8 @@
<tr>
<th class="preview-header counter"></th>
{% for h in headers %}
<th class="preview-header"><div class="sort bi-arrow-down-up" data-sort="{{ forloop.counter0 }}"
data-dir="asc">{{ h }}</div></th>
<th class="preview-header"><span><i class="sort bi-chevron-expand pe-1" data-sort="{{ forloop.counter0 }}"
data-dir="asc"></i>{{ h }}</span></th>
{% endfor %}
</tr>
<tr class="stats-th">
Expand All @@ -72,12 +68,14 @@
<th>
{% if h.summary %}
<i class="stats-expand bi-calculator"></i>
<div class="stats-wrapper">
<table class="stats-wrapper table table-sm fw-normal small">
{% for label, value in h.summary.stats.items %}
<div class="stat-wrapper"><span class="stat-label">{{ label }}:&nbsp;</span><span
class="stat-value">{{ value }}</span></div>
<tr>
<td>{{ label }}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</div>
</table>
{% endif %}
</th>
{% endfor %}
Expand Down
5 changes: 1 addition & 4 deletions explorer/templates/explorer/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,9 @@ <h2>
<div class="col text-end">
<small>
<a href="#" title="Open in playground" id="playground_button">
<i class="bi-window-plus"></i>
<i class="bi-code-square"></i>
</a>
</small>
<small>
<i id="sql_toggle" class="bi-arrows-angle-expand"></i>
</small>
</div>
{% endif %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion explorer/templates/explorer/query_confirm_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% endblocktrans %}
</div>
<div>
<input type="submit" value="Delete Query" class="btn btn-default" />
<input type="submit" value="Delete Query" class="btn btn-primary" />
</div>
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion explorer/templates/explorer/query_favorites.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% block sql_explorer_content %}
<h2>{% trans "Favorite Queries" %}</h2>
<div class="table-responsive">
<div>
<table class="table table-striped query-list">
<thead>
<tr>
Expand Down
1 change: 0 additions & 1 deletion explorer/templatetags/vite.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def get_script(file: str) -> str:
return mark_safe(f'<script type="module" src="{base_url}{file}"></script>') # nosec B308, B703



@lru_cache
def get_manifest():
with open(VITE_MANIFEST_FILE) as f:
Expand Down

0 comments on commit 4641e4d

Please sign in to comment.