Tighter editor layout with icons.
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 12 Nov 2020 14:48:44 +0000 (15:48 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 12 Nov 2020 14:48:44 +0000 (15:48 +0100)
requirements/requirements.txt
src/redakcja/static/css/html.css
src/redakcja/static/js/wiki/view_editor_wysiwyg.js
src/redakcja/templates/registration/head_login.html
src/wiki/templates/wiki/tabs/history_view_item.html
src/wiki/templates/wiki/tabs/source_editor_item.html
src/wiki/templates/wiki/tabs/summary_view_item.html
src/wiki/templates/wiki/tabs/wysiwyg_editor_item.html

index 031670a..54ac60f 100644 (file)
@@ -10,7 +10,7 @@ python-slugify
 python-docx==0.8.10
 Wikidata==0.6.1
 
-librarian==1.8.1
+librarian==1.10
 
 ## Django
 Django==3.0.4
index 98e41cd..5a969fb 100644 (file)
@@ -608,6 +608,7 @@ div[x-node] > .uwaga {
     padding: 1px;
     z-index: 2000;
     position: absolute;
+    text-align: left;
 }
 
 .html-editarea textarea {
index 72e218a..607fa3f 100644 (file)
         var w = $box.outerWidth();
         var h = $box.innerHeight();
 
-        if ($origin.is(".annotation-inline-box") | $origin.is('.reference-inline-box')) {
+        if ($origin.is(".annotation-inline-box")) {
             w = Math.max(w, 400);
             h = Math.max(h, 60);
             if($('.htmlview div').offset().left + $('.htmlview div').width() > ($('.vsplitbar').offset().left - 480)){
                 x = 100;
             }
         }
+        if ($origin.is('.reference-inline-box')) {
+            w = 400;
+            h = 32;
+            y -= 32;
+            x = Math.min(
+                x,
+                $('.htmlview div').offset().left + $('.htmlview div').width() - 400
+            );
+        }
 
         // start edition on this node
         var $overlay = $('<div class="html-editarea"><button class="accept-button">Zapisz</button><button class="delete-button">Usuń</button><button class="tytul-button akap-edit-button">tytuł dzieła</button><button class="wyroznienie-button akap-edit-button">wyróżnienie</button><button class="slowo-button akap-edit-button">słowo obce</button><button class="znak-button akap-edit-button">znak spec.</button><textarea></textarea></div>').css({
index 1ae47fa..26ccfb5 100644 (file)
@@ -1,11 +1,13 @@
 {% load i18n %}
+{% load gravatar %}
 
 {% if user.is_authenticated %}
   <div class="nav-item dropdown">
-    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-      {{ user.username }}
+    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{ user.username }}">
+      <img src="{% gravatar_url item.get_email 26 %}" alt="{{ user.username }}">
     </a>
     <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
+      <h6 class="dropdown-header">{{ user.username }}</h6>
       {% if user.is_staff %}
         <a target="_blank" class="dropdown-item" href="{% url 'admin:index' %}">{% trans "Admin" %}</a>
       {% endif %}
index 8e88451..e3d00ac 100644 (file)
@@ -1,4 +1,7 @@
 {% load i18n %}
 <li id="HistoryPerspective" data-ui-related="history-view-editor" data-ui-jsclass="HistoryPerspective" class="nav-item">
-    <a href="#" class="nav-link">{% trans "History" %}</a>
+  <a class="nav-link" href="#" title="{% trans "History" %}">
+    <span class="d-xl-none">&#x23F0;</span>
+    <span class="d-none d-xl-inline">{% trans "History" %}</span>
+  </a>
 </li>
index ba915c3..92dd4f0 100644 (file)
@@ -2,5 +2,8 @@
 <li id="CodeMirrorPerspective" class="nav-item"
        data-ui-related="source-editor"
        data-ui-jsclass="CodeMirrorPerspective">
-    <a class="nav-link" href="#">{% trans "Source code" %}</a>
+  <a class="nav-link" href="#" title="{% trans "Source code" %}">
+    <span class="d-xl-none">&lt;&gt;</span>
+    <span class="d-none d-xl-inline">{% trans "Source code" %}</span>
+  </a>
 </li>
index 1d20591..fa0335b 100644 (file)
@@ -1,4 +1,7 @@
 {% load i18n %}
 <li id="SummaryPerspective" data-ui-related="summary-view-editor" data-ui-jsclass="SummaryPerspective" class="nav-item">
-    <a class="nav-link" href="#">{% trans "Summary" %}</a>
+  <a class="nav-link" href="#" title="{% trans "Summary" %}">
+    <span class="d-xl-none">&#x1f4d3;</span>
+    <span class="d-none d-xl-inline">{% trans "Summary" %}</span>
+  </a>
 </li>
index 79ad89b..a1231b2 100644 (file)
@@ -1,4 +1,7 @@
 {% load i18n %}
 <li id="VisualPerspective" data-ui-related="simple-editor" data-ui-jsclass="VisualPerspective" class="nav-item">
-    <a href="#" class="nav-link">{% trans "Visual editor" %}</a>
+  <a class="nav-link" href="#" title="{% trans "Visual editor" %}">
+    <span class="d-xl-none">&#x1F441;</span>
+    <span class="d-none d-xl-inline">{% trans "Visual editor" %}</span>
+  </a>
 </li>