Commit 4dd66a9b6da2d50155ff4a640d9140affaf5e778
1 parent
13420a2f
made panes in entry view resizable
Showing
8 changed files
with
66 additions
and
8 deletions
entries/static/entries/css/entries.css
... | ... | @@ -177,3 +177,24 @@ legend { |
177 | 177 | background-image: url("/static/entries/img/lemma.png"); |
178 | 178 | background-repeat: repeat; |
179 | 179 | } |
180 | + | |
181 | +.gutter { | |
182 | + background-color: #9e9e9e; | |
183 | + background-repeat: no-repeat; | |
184 | + background-position: 50%; | |
185 | +} | |
186 | + | |
187 | +.gutter.gutter-horizontal { | |
188 | + background-image: url("/static/entries/img/gutter-h.png"); | |
189 | + cursor: col-resize; | |
190 | +} | |
191 | + | |
192 | +.gutter.gutter-vertical { | |
193 | + background-image: url("/static/entries/img/gutter-v.png"); | |
194 | + cursor: row-resize; | |
195 | +} | |
196 | + | |
197 | +/* https://datatables.net/forums/discussion/56716/table-header-is-not-resizing-when-sidebar-is-hidden */ | |
198 | +.dataTables_scrollHeadInner, .table { | |
199 | + width:100% !important; | |
200 | +} | |
... | ... |
entries/static/entries/img/gutter-h.png
0 โ 100644
193 Bytes
entries/static/entries/img/gutter-v.png
0 โ 100644
203 Bytes
entries/static/entries/img/lemma.png
0 โ 100644
197 Bytes
entries/static/entries/js/entries.js
... | ... | @@ -1020,6 +1020,40 @@ function initialize_entries_list() { |
1020 | 1020 | |
1021 | 1021 | $(document).ready(function() { |
1022 | 1022 | |
1023 | + Split(['#entries-list', '#entry-display'], { | |
1024 | + sizes: [20, 80], | |
1025 | + minSize: 300, | |
1026 | + gutterSize: 4, | |
1027 | + elementStyle: (dimension, size, gutterSize) => { | |
1028 | + return { | |
1029 | + 'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)' | |
1030 | + } | |
1031 | + }, | |
1032 | + }); | |
1033 | + | |
1034 | + Split(['#semantics-top-pane', '#semantics-bottom-pane'], { | |
1035 | + direction: 'vertical', | |
1036 | + sizes: [75, 25], | |
1037 | + gutterSize: 4, | |
1038 | + }); | |
1039 | + | |
1040 | + Split(['#syntax-schemata', '#syntax-examples-pane'], { | |
1041 | + direction: 'vertical', | |
1042 | + sizes: [75, 25], | |
1043 | + gutterSize: 4, | |
1044 | + }); | |
1045 | + | |
1046 | + Split(['#semantics-frames', '#semantics-schemata'], { | |
1047 | + sizes: [40, 60], | |
1048 | + minSize: 400, | |
1049 | + gutterSize: 4, | |
1050 | + elementStyle: (dimension, size, gutterSize) => { | |
1051 | + return { | |
1052 | + 'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)' | |
1053 | + } | |
1054 | + }, | |
1055 | + }); | |
1056 | + | |
1023 | 1057 | adjust_heights(); |
1024 | 1058 | |
1025 | 1059 | $(window).resize(adjust_heights); |
... | ... |
entries/templates/entries.html
... | ... | @@ -17,6 +17,8 @@ |
17 | 17 | {% endblock %} |
18 | 18 | |
19 | 19 | {% block scripts %} |
20 | + <!-- https://www.cssscript.com/split-view/ --> | |
21 | + <script src="https://unpkg.com/split.js/dist/split.min.js"></script> | |
20 | 22 | <!-- https://datatables.net/ --> |
21 | 23 | <script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.22/sc-2.0.3/datatables.min.js"></script> |
22 | 24 | <script src="{% static 'common/js/csrf.js' %}"></script> |
... | ... | @@ -59,7 +61,7 @@ |
59 | 61 | |
60 | 62 | <div class="row h-100 m-0 p-0 bg-secondary"> |
61 | 63 | <!-- left panel: list of entries --> |
62 | - <div id="entries-list" class="col-2 h-100 w-100 px-0 border-right border-primary"> | |
64 | + <div id="entries-list" class="col h-100 w-100 px-0"> | |
63 | 65 | <div id="filter-div" class="col p-0 bg-primary"> |
64 | 66 | <button type="button" id='filter-button' class="btn btn-primary" data-toggle="modal" data-target="#entry-filters"> |
65 | 67 | {% trans "Filtrowanie" %} |
... | ... |
entries/templates/entry_display.html
... | ... | @@ -20,11 +20,11 @@ |
20 | 20 | |
21 | 21 | <div class="tab-content h-100 w-100 p-0" id="entryTabsContent"> |
22 | 22 | <div class="col h-100 w-100 tab-pane show active" id="semantics" role="tabpanel" aria-labelledby="semantics-tab"> |
23 | - <div class="row h-75 p-0"> | |
24 | - <div class="col-5 h-100 py-2 px-3 overflow-auto border-right border-primary" id="semantics-frames"></div> | |
25 | - <div class="col-7 h-100 py-2 px-3 overflow-auto" id="semantics-schemata"></div> | |
23 | + <div class="row p-0" id="semantics-top-pane"> | |
24 | + <div class="col h-100 py-2 px-3 overflow-auto" id="semantics-frames"></div> | |
25 | + <div class="col h-100 py-2 px-3 overflow-auto" id="semantics-schemata"></div> | |
26 | 26 | </div> |
27 | - <div class="row h-25 p-2 overflow-auto border-top border-primary"> | |
27 | + <div class="row p-2 overflow-auto" id="semantics-bottom-pane"> | |
28 | 28 | <table id="semantics-examples" class="table table-sm table-hover"> |
29 | 29 | <thead> |
30 | 30 | <tr> |
... | ... | @@ -40,8 +40,8 @@ |
40 | 40 | </div> |
41 | 41 | </div> |
42 | 42 | <div class="col h-100 w-100 p-0 tab-pane" id="syntax" role="tabpanel" aria-labelledby="syntax-tab"> |
43 | - <div class="col h-75 w-100 py-2 px-3 overflow-auto" id="syntax-schemata"></div> | |
44 | - <div class="col h-25 w-100 p-2 overflow-auto border-top border-primary"> | |
43 | + <div class="col w-100 py-2 px-3 overflow-auto" id="syntax-schemata"></div> | |
44 | + <div class="col w-100 p-2 overflow-auto" id="syntax-examples-pane"> | |
45 | 45 | <table id="syntax-examples" class="table table-sm table-hover table-responsive"> |
46 | 46 | <thead> |
47 | 47 | <tr> |
... | ... |
entries/urls.py
... | ... | @@ -13,6 +13,7 @@ urlpatterns = [ |
13 | 13 | |
14 | 14 | path('autocomplete/', autocompletes.autocomplete, name='autocomplete'), |
15 | 15 | |
16 | - path('test/', views.test, name='test'), | |
16 | + # TODO remove! | |
17 | + #path('test/', views.test, name='test'), | |
17 | 18 | path('', views.entries, name='entries'), |
18 | 19 | ] |
... | ... |