* Poprawki w redmine.
authorŁukasz Rekucki <lrekucki@gmail.com>
Tue, 15 Sep 2009 15:13:59 +0000 (17:13 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Tue, 15 Sep 2009 15:13:59 +0000 (17:13 +0200)
* Lepsza autokorekta. refs #127
* Support dla kropek w id pliku.

12 files changed:
apps/explorer/fixtures/przyciski.xml [deleted file]
apps/toolbar/fixtures/przyciski.xml [new file with mode: 0755]
dump_toolbar.sh
project/static/js/editor.js
project/static/js/editor.ui.js
project/templates/explorer/editor.html
redmine/redmine_publications/app/controllers/publications_controller.rb
redmine/redmine_publications/app/views/issues/_issue_view_pub.erb [new file with mode: 0644]
redmine/redmine_publications/app/views/settings/_publications_settings.html.erb
redmine/redmine_publications/init.rb
redmine/redmine_publications/lib/issue_publication_hook.rb
redmine/redmine_publications/routes.rb

diff --git a/apps/explorer/fixtures/przyciski.xml b/apps/explorer/fixtures/przyciski.xml
deleted file mode 100755 (executable)
index afa1deb..0000000
+++ /dev/null
@@ -1,1228 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<django-objects version="1.0">
-  <object pk="23" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Dodatkowe przyciski w XMLEditor</field>
-    <field type="SlugField" name="slug">xmleditor-extra-buttons</field>
-    <field type="IntegerField" name="position">-1</field>
-  </object>
-  <object pk="24" model="toolbar.buttongroup">
-    <field type="CharField" name="name">HTMLEditor Extra</field>
-    <field type="SlugField" name="slug">htmleditor-extra</field>
-    <field type="IntegerField" name="position">-1</field>
-  </object>
-  <object pk="14" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Akapity i długie cytaty</field>
-    <field type="SlugField" name="slug">akapity-i-dlugie-cytaty</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="2" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Autokorekta</field>
-    <field type="SlugField" name="slug">autokorekta</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="21" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Bloki</field>
-    <field type="SlugField" name="slug">bloki</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="12" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Dramat wierszowany</field>
-    <field type="SlugField" name="slug">dramat-wierszowany</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="18" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Dramat współczesny</field>
-    <field type="SlugField" name="slug">dramat-wspolczesny</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="13" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Elementy początkowe</field>
-    <field type="SlugField" name="slug">elementy-poczatkowe</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="1" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Nagłówki</field>
-    <field type="SlugField" name="slug">naglowki</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="22" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Początek dramatu</field>
-    <field type="SlugField" name="slug">poczatek-dramatu</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="16" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Polecenia</field>
-    <field type="SlugField" name="slug">polecenia</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="11" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Strukturalne</field>
-    <field type="SlugField" name="slug">strukturalne</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="15" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Style znakowe</field>
-    <field type="SlugField" name="slug">style-znakowe</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="17" model="toolbar.buttongroup">
-    <field type="CharField" name="name">Wersy</field>
-    <field type="SlugField" name="slug">wersy</field>
-    <field type="IntegerField" name="position">0</field>
-  </object>
-  <object pk="5" model="toolbar.button">
-    <field type="CharField" name="label">A&lt;sup&gt;+&lt;/sup&gt;</field>
-    <field type="SlugField" name="slug">increase_font_size</field>
-    <field type="TextField" name="params">{"change": 2}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip">Zwiększ rozmiar czcionki.</field>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="23"/>
-    </field>
-  </object>
-  <object pk="6" model="toolbar.button">
-    <field type="CharField" name="label">A&lt;sup&gt;-&lt;/sup&gt;</field>
-    <field type="SlugField" name="slug">descrease_font_size</field>
-    <field type="TextField" name="params">{"change": -2}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip">Zmniejsz rozmiar czcionki.</field>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="23"/>
-    </field>
-  </object>
-  <object pk="7" model="toolbar.button">
-    <field type="CharField" name="label">A&lt;sup&gt;=&lt;/sup&gt;</field>
-    <field type="SlugField" name="slug">reset_font_size</field>
-    <field type="TextField" name="params">{"fontSize": 13}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip">Przywróć orginalny rozmiar czcionki.</field>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="23"/>
-    </field>
-  </object>
-  <object pk="76" model="toolbar.button">
-    <field type="CharField" name="label">A&lt;sup&gt;↓&lt;/sup&gt;</field>
-    <field type="SlugField" name="slug">tolowercase</field>
-    <field type="TextField" name="params">[]</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lowercase</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key">u</field>
-    <field type="PositiveIntegerField" name="key_mod">6</field>
-    <field type="CharField" name="tooltip">Zamień wielkie litery na małe.</field>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="4" model="toolbar.button">
-    <field type="CharField" name="label">Podstawowa</field>
-    <field type="SlugField" name="slug">basic_correction</field>
-    <field type="TextField" name="params">{"exprs": [["\n\\d+\n", "\n"], ["-\\s*\n+", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."]]}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">fulltextregexp</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip">Wykonuję operację z novel-pages i poem-pages.</field>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="2"/>
-    </field>
-  </object>
-  <object pk="3" model="toolbar.button">
-    <field type="CharField" name="label">Usuń spację</field>
-    <field type="SlugField" name="slug">strip_whitespace</field>
-    <field type="TextField" name="params">{"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "]]}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip">Usuwa zbędne spację z dokumentu.</field>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="2"/>
-    </field>
-  </object>
-  <object pk="84" model="toolbar.button">
-    <field type="CharField" name="label">Wers wcięty</field>
-    <field type="SlugField" name="slug">wers-wciety</field>
-    <field type="TextField" name="params">{"tag": "wers_wciety", "attrs": {"typ": ""}}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="12"/>
-      <object pk="17"/>
-    </field>
-  </object>
-  <object pk="86" model="toolbar.button">
-    <field type="CharField" name="label">Wydrukuj</field>
-    <field type="SlugField" name="slug">print-xml</field>
-    <field type="TextField" name="params">[]</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">
-      <None/>
-    </field>
-    <field type="CharField" name="link">print/xml</field>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="23"/>
-    </field>
-  </object>
-  <object pk="87" model="toolbar.button">
-    <field type="CharField" name="label">Wydrukuj</field>
-    <field type="SlugField" name="slug">htmleditor-print</field>
-    <field type="TextField" name="params">[]</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">
-      <None/>
-    </field>
-    <field type="CharField" name="link">print/html</field>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="24"/>
-    </field>
-  </object>
-  <object pk="88" model="toolbar.button">
-    <field type="CharField" name="label">Wydziel</field>
-    <field type="SlugField" name="slug">split-text-from-xmleditor</field>
-    <field type="TextField" name="params">[]</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">show_splitmodal</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="23"/>
-    </field>
-  </object>
-  <object pk="77" model="toolbar.button">
-    <field type="CharField" name="label">Zamień cudzysłowy</field>
-    <field type="SlugField" name="slug">zamien-cudzyslowy</field>
-    <field type="TextField" name="params">{"exprs": [["\u00bb|\u201e", ",,"], ["\u00ab", "\""], ["\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", ",,$1"]]}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="2"/>
-    </field>
-  </object>
-  <object pk="2" model="toolbar.button">
-    <field type="CharField" name="label">Zamień dywiz</field>
-    <field type="SlugField" name="slug">zamien_dywiz</field>
-    <field type="TextField" name="params">{"exprs": [["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"]]}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip">Zamienia '—' na '---', oraz '1—2' na '1--2'.</field>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="2"/>
-    </field>
-  </object>
-  <object pk="39" model="toolbar.button">
-    <field type="CharField" name="label">akapit</field>
-    <field type="SlugField" name="slug">akapit</field>
-    <field type="TextField" name="params">{"tag": "akap"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="14"/>
-    </field>
-  </object>
-  <object pk="40" model="toolbar.button">
-    <field type="CharField" name="label">akapit cd.</field>
-    <field type="SlugField" name="slug">akapit-cd</field>
-    <field type="TextField" name="params">{"tag": "akap_cd"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="14"/>
-    </field>
-  </object>
-  <object pk="41" model="toolbar.button">
-    <field type="CharField" name="label">akapit dialogowy</field>
-    <field type="SlugField" name="slug">akapit-dialogowy</field>
-    <field type="TextField" name="params">{"tag": "akap_dialog"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="14"/>
-    </field>
-  </object>
-  <object pk="14" model="toolbar.button">
-    <field type="CharField" name="label">akt</field>
-    <field type="SlugField" name="slug">akt</field>
-    <field type="TextField" name="params">{"tag": "akt"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="1"/>
-    </field>
-  </object>
-  <object pk="32" model="toolbar.button">
-    <field type="CharField" name="label">autor</field>
-    <field type="SlugField" name="slug">autor</field>
-    <field type="TextField" name="params">{"tag": "autor"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-    </field>
-  </object>
-  <object pk="10" model="toolbar.button">
-    <field type="CharField" name="label">część/księga</field>
-    <field type="SlugField" name="slug">czesc</field>
-    <field type="TextField" name="params">{"tag": "naglowek_czesc"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="1"/>
-    </field>
-  </object>
-  <object pk="74" model="toolbar.button">
-    <field type="CharField" name="label">dedykacja</field>
-    <field type="SlugField" name="slug">dedykacja</field>
-    <field type="TextField" name="params">{"tag": "dedykacja"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-      <object pk="22"/>
-    </field>
-  </object>
-  <object pk="62" model="toolbar.button">
-    <field type="CharField" name="label">didaskalia</field>
-    <field type="SlugField" name="slug">didaskalia</field>
-    <field type="TextField" name="params">{"tag": "didaskalia"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="12"/>
-      <object pk="18"/>
-    </field>
-  </object>
-  <object pk="79" model="toolbar.button">
-    <field type="CharField" name="label">didaskalia początkowe</field>
-    <field type="SlugField" name="slug">didaskalia-poczatkowe</field>
-    <field type="TextField" name="params">{"tag": "miejsce_czas"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="22"/>
-    </field>
-  </object>
-  <object pk="63" model="toolbar.button">
-    <field type="CharField" name="label">didaskalia wewn.</field>
-    <field type="SlugField" name="slug">didaskalia-wewn</field>
-    <field type="TextField" name="params">{"tag": "didask_tekst"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="18"/>
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="20" model="toolbar.button">
-    <field type="CharField" name="label">dramat wiersz.</field>
-    <field type="SlugField" name="slug">dramat-wiersz</field>
-    <field type="TextField" name="params">{"tag": "dramat_wierszowany_l"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="22" model="toolbar.button">
-    <field type="CharField" name="label">dramat wiersz./w. łam</field>
-    <field type="SlugField" name="slug">dramat-wiersz-w-lam</field>
-    <field type="TextField" name="params">{"tag": "dramat_wierszowany_lp"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="21" model="toolbar.button">
-    <field type="CharField" name="label">dramat współczesny</field>
-    <field type="SlugField" name="slug">dramat-wspolczesny</field>
-    <field type="TextField" name="params">{"tag": "dramat_wspolczesny"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="38" model="toolbar.button">
-    <field type="CharField" name="label">dzieło nadrzędne</field>
-    <field type="SlugField" name="slug">dzielo-nadrzedne</field>
-    <field type="TextField" name="params">{"tag": "dzielo_nadrzedne"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-    </field>
-  </object>
-  <object pk="67" model="toolbar.button">
-    <field type="CharField" name="label">długi cyt. poet.</field>
-    <field type="SlugField" name="slug">dlugi-cyt-poet</field>
-    <field type="TextField" name="params">{"tag": "poezja_cyt"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="14"/>
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="42" model="toolbar.button">
-    <field type="CharField" name="label">długi cytat</field>
-    <field type="SlugField" name="slug">dlugi-cytat</field>
-    <field type="TextField" name="params">{"tag": "dlugi_cyt"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="14"/>
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="52" model="toolbar.button">
-    <field type="CharField" name="label">ekstra</field>
-    <field type="SlugField" name="slug">ekstra</field>
-    <field type="TextField" name="params">{"tag": "ekstra"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="82" model="toolbar.button">
-    <field type="CharField" name="label">kwestia</field>
-    <field type="SlugField" name="slug">kwestia</field>
-    <field type="TextField" name="params">{"tag": "kwestia"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="12"/>
-      <object pk="18"/>
-    </field>
-  </object>
-  <object pk="23" model="toolbar.button">
-    <field type="CharField" name="label">liryka</field>
-    <field type="SlugField" name="slug">liryka</field>
-    <field type="TextField" name="params">{"tag": "liryka_l"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="24" model="toolbar.button">
-    <field type="CharField" name="label">liryka/w. łam</field>
-    <field type="SlugField" name="slug">liryka-w-lam</field>
-    <field type="TextField" name="params">{"tag": "liryka_lp"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="78" model="toolbar.button">
-    <field type="CharField" name="label">lista osób: pole</field>
-    <field type="SlugField" name="slug">lista-osob-pole</field>
-    <field type="TextField" name="params">{"tag": "lista_osoba", "attrs": {"typ": ""}}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="22"/>
-    </field>
-  </object>
-  <object pk="47" model="toolbar.button">
-    <field type="CharField" name="label">mamtemat.</field>
-    <field type="SlugField" name="slug">matemat</field>
-    <field type="TextField" name="params">{"tag": "mat"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="75" model="toolbar.button">
-    <field type="CharField" name="label">motto</field>
-    <field type="SlugField" name="slug">motto</field>
-    <field type="TextField" name="params">{"tag": "motto"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-      <object pk="22"/>
-    </field>
-  </object>
-  <object pk="37" model="toolbar.button">
-    <field type="CharField" name="label">motto podpis</field>
-    <field type="SlugField" name="slug">motto-podpis</field>
-    <field type="TextField" name="params">{"tag": "motto_podpis"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-    </field>
-  </object>
-  <object pk="16" model="toolbar.button">
-    <field type="CharField" name="label">nagłówek kwestii</field>
-    <field type="SlugField" name="slug">naglowek-kwestii</field>
-    <field type="TextField" name="params">{"tag": "naglowek_osoba"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="1"/>
-    </field>
-  </object>
-  <object pk="35" model="toolbar.button">
-    <field type="CharField" name="label">nota</field>
-    <field type="SlugField" name="slug">nota</field>
-    <field type="TextField" name="params">{"tag": "nota"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-    </field>
-  </object>
-  <object pk="18" model="toolbar.button">
-    <field type="CharField" name="label">opowiadanie</field>
-    <field type="SlugField" name="slug">opowiadanie</field>
-    <field type="TextField" name="params">{"tag": "opowiadanie"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="64" model="toolbar.button">
-    <field type="CharField" name="label">osoba</field>
-    <field type="SlugField" name="slug">osoba</field>
-    <field type="TextField" name="params">{"tag": "osoba"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="18"/>
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="12" model="toolbar.button">
-    <field type="CharField" name="label">podrozdział</field>
-    <field type="SlugField" name="slug">podrozdzial</field>
-    <field type="TextField" name="params">{"tag": "naglowek_podrozdzial"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="1"/>
-    </field>
-  </object>
-  <object pk="34" model="toolbar.button">
-    <field type="CharField" name="label">podtytuł</field>
-    <field type="SlugField" name="slug">podtytul</field>
-    <field type="TextField" name="params">{"tag": "podtytul"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-    </field>
-  </object>
-  <object pk="19" model="toolbar.button">
-    <field type="CharField" name="label">powieść</field>
-    <field type="SlugField" name="slug">powiesc</field>
-    <field type="TextField" name="params">{"tag": "powiesc"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="68" model="toolbar.button">
-    <field type="CharField" name="label">przypis autorski</field>
-    <field type="SlugField" name="slug">przypis-autorski</field>
-    <field type="TextField" name="params">{"tag": "pa"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="71" model="toolbar.button">
-    <field type="CharField" name="label">przypis edytorski</field>
-    <field type="SlugField" name="slug">przypis-edytorski</field>
-    <field type="TextField" name="params">{"tag": "pe"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="70" model="toolbar.button">
-    <field type="CharField" name="label">przypis redaktorski</field>
-    <field type="SlugField" name="slug">przypis-redaktorski</field>
-    <field type="TextField" name="params">{"tag": "pr"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="69" model="toolbar.button">
-    <field type="CharField" name="label">przypis tłumacza</field>
-    <field type="SlugField" name="slug">przypis-tlumacza</field>
-    <field type="TextField" name="params">{"tag": "pt"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="11" model="toolbar.button">
-    <field type="CharField" name="label">rozdział</field>
-    <field type="SlugField" name="slug">rozdzial</field>
-    <field type="TextField" name="params">{"tag": "naglowek_rozdzial"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="1"/>
-    </field>
-  </object>
-  <object pk="15" model="toolbar.button">
-    <field type="CharField" name="label">scena</field>
-    <field type="SlugField" name="slug">scena</field>
-    <field type="TextField" name="params">{"tag": "naglowek_scena"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="1"/>
-    </field>
-  </object>
-  <object pk="54" model="toolbar.button">
-    <field type="CharField" name="label">sep. asteryks</field>
-    <field type="SlugField" name="slug">sep-asteryks</field>
-    <field type="TextField" name="params">{"tag": "sekcja_asteryks"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="16"/>
-    </field>
-  </object>
-  <object pk="55" model="toolbar.button">
-    <field type="CharField" name="label">sep. linia</field>
-    <field type="SlugField" name="slug">sep-linia</field>
-    <field type="TextField" name="params">{"tag": "separator_linia"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="16"/>
-    </field>
-  </object>
-  <object pk="53" model="toolbar.button">
-    <field type="CharField" name="label">sep. światło</field>
-    <field type="SlugField" name="slug">sep-swiatlo</field>
-    <field type="TextField" name="params">{"tag": "sekcja_swiatlo"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="16"/>
-    </field>
-  </object>
-  <object pk="81" model="toolbar.button">
-    <field type="CharField" name="label">strofa</field>
-    <field type="SlugField" name="slug">strofa</field>
-    <field type="TextField" name="params">{"tag": "strofa"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_stanza</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key">s</field>
-    <field type="PositiveIntegerField" name="key_mod">1</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="12"/>
-      <object pk="17"/>
-    </field>
-  </object>
-  <object pk="46" model="toolbar.button">
-    <field type="CharField" name="label">słowo obce</field>
-    <field type="SlugField" name="slug">slowo-obce</field>
-    <field type="TextField" name="params">{"tag": "slowo_obce"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="17" model="toolbar.button">
-    <field type="CharField" name="label">tagi główne</field>
-    <field type="SlugField" name="slug">tagi-glowne</field>
-    <field type="TextField" name="params">{"tag": "utwor"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="33" model="toolbar.button">
-    <field type="CharField" name="label">tytuł</field>
-    <field type="SlugField" name="slug">tytul</field>
-    <field type="TextField" name="params">{"tag": "nazwa_utworu"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="13"/>
-    </field>
-  </object>
-  <object pk="45" model="toolbar.button">
-    <field type="CharField" name="label">tytuł dzieła</field>
-    <field type="SlugField" name="slug">tytul-dziela</field>
-    <field type="TextField" name="params">{"tag": "tytul_dziela", "attrs": {"typ": "1"}}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="51" model="toolbar.button">
-    <field type="CharField" name="label">uwaga</field>
-    <field type="SlugField" name="slug">uwaga</field>
-    <field type="TextField" name="params">{"tag": "uwaga"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="83" model="toolbar.button">
-    <field type="CharField" name="label">wers akap.</field>
-    <field type="SlugField" name="slug">wers-akap</field>
-    <field type="TextField" name="params">{"tag": "wers_akap"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="12"/>
-      <object pk="17"/>
-    </field>
-  </object>
-  <object pk="85" model="toolbar.button">
-    <field type="CharField" name="label">wers cd.</field>
-    <field type="SlugField" name="slug">wers-cd</field>
-    <field type="TextField" name="params">{"tag": "wers_cd"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="12"/>
-      <object pk="17"/>
-    </field>
-  </object>
-  <object pk="48" model="toolbar.button">
-    <field type="CharField" name="label">www</field>
-    <field type="SlugField" name="slug">www</field>
-    <field type="TextField" name="params">{"tag": "www"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="44" model="toolbar.button">
-    <field type="CharField" name="label">wyróżnienie</field>
-    <field type="SlugField" name="slug">wyroznienie</field>
-    <field type="TextField" name="params">{"tag": "wyroznienie"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="15"/>
-    </field>
-  </object>
-  <object pk="25" model="toolbar.button">
-    <field type="CharField" name="label">wywiad</field>
-    <field type="SlugField" name="slug">wywiad</field>
-    <field type="TextField" name="params">{"tag": "wywiad"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="11"/>
-    </field>
-  </object>
-  <object pk="73" model="toolbar.button">
-    <field type="CharField" name="label">wywiad odpowiedź</field>
-    <field type="SlugField" name="slug">wywiad-odpowiedz</field>
-    <field type="TextField" name="params">{"tag": "wywiad_odp"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="72" model="toolbar.button">
-    <field type="CharField" name="label">wywiad pytanie</field>
-    <field type="SlugField" name="slug">wywiad-pytanie</field>
-    <field type="TextField" name="params">{"tag": "wywiad_pyt"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="21"/>
-    </field>
-  </object>
-  <object pk="56" model="toolbar.button">
-    <field type="CharField" name="label">zastępnik wersu</field>
-    <field type="SlugField" name="slug">zastepnik-wersu</field>
-    <field type="TextField" name="params">{"tag": "zastepnik_wersu"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="16"/>
-    </field>
-  </object>
-  <object pk="13" model="toolbar.button">
-    <field type="CharField" name="label">śródtytuł</field>
-    <field type="SlugField" name="slug">srodtytul</field>
-    <field type="TextField" name="params">{"tag": "srodtytul"}</field>
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
-    <field type="CharField" name="link"/>
-    <field type="CharField" name="key"/>
-    <field type="PositiveIntegerField" name="key_mod">0</field>
-    <field type="CharField" name="tooltip"/>
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
-      <object pk="1"/>
-    </field>
-  </object>
-  <object pk="insert_tag" model="toolbar.scriptlet">
-    <field type="TextField" name="code">var texteditor = panel.texteditor;
-
-var text = texteditor.selection();
-
-var out = '&lt;'+params.tag;
-
-for (var attr in params.attrs) {
-
-    out += ' '+attr+'="' + params.attrs[attr] + '"';
-
-};
-
-out += '&gt;';
-
-out += text;
-
-out += '&lt;/' + params.tag + '&gt;';
-
-
-texteditor.replaceSelection(out);
-
-
-
-if (text.length == 0) {
-
-    var pos = texteditor.cursorPosition();
-
-    texteditor.selectLines(pos.line, pos.character + params.tag.length + 2);
-
-}
-
-
-
-panel.fireEvent('contentChanged');</field>
-  </object>
-  <object pk="lineregexp" model="toolbar.scriptlet">
-    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);
-
-var cm = panel.texteditor;
-var exprs = $.map(params.exprs, function(expr) {
-
-    var opts = "g";
-
-    if(expr.length &gt; 2)
-
-        opts = expr[2];
-
-    return {rx: new RegExp(expr[0], opts), repl: expr[1]};
-
-});
-
-
-
-var partial = true;
-
-var text = cm.selection();
-
-
-
-if(!text) {
-
-    var cpos = cm.cursorPosition();
-
-    cpos.line = cm.lineNumber(cpos.line)
-
-    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);
-
-    text = cm.selection();
-
-    partial = false;
-
-}
-
-
-
-var changed = 0;
-var lines = text.split('\n');
-var lines = $.map(lines, function(line) { 
-    var old_line = line;
-    $(exprs).each(function() { 
-        var expr = this;
-        line = line.replace(expr.rx, expr.repl);
-    });
-
-    if(old_line != line) changed += 1;
-    return line;
-});
-
-if(changed &gt; 0) 
-{
-    cm.replaceSelection( lines.join('\n') );
-    panel.fireEvent('contentChanged');
-    editor.showPopup('generic-yes', 'Zmieniono ' + changed + ' linii.', 1500);
-    editor.advancePopupQueue();
-}
-else {
-    editor.showPopup('generic-info',  'Brak zmian w tekście', 1500);
-    editor.advancePopupQueue();
-}
-
-if(!partial)
-    cm.selectLines( cm.nthLine(cpos.line), cpos.character )</field>
-  </object>
-  <object pk="codemirror_fontsize" model="toolbar.scriptlet">
-    <field type="TextField" name="code">var texteditor = panel.texteditor;
-
-var frameBody = $('body', $(texteditor.frame).contents());
-
-
-
-if(params.fontSize) {
-
-    frameBody.css('font-size', params.fontSize);
-
-}
-
-else {
-
-    var old_size = parseInt(frameBody.css('font-size'));
-
-    frameBody.css('font-size', old_size + (params.change || 0) );
-
-}</field>
-  </object>
-  <object pk="fulltextregexp" model="toolbar.scriptlet">
-    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);
-
-var cm = panel.texteditor;
-
-var exprs = $.map(params.exprs, function(expr) {
-    var opts = "mg";
-    if(expr.length &gt; 2)
-        opts = expr[2];
-
-    return {rx: new RegExp(expr[0], opts), repl: expr[1]};
-});
-
-var partial = true;
-var text = cm.selection();
-
-if(!text) {
-    var cpos = cm.cursorPosition();
-    cpos.line = cm.lineNumber(cpos.line)
-    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);
-
-    text = cm.selection();
-    partial = false;
-}
-
-
-
-var original = text;
-$(exprs).each(function() { 
-    text = text.replace(this.rx, this.repl);
-});
-
-if( original != text) 
-{    
-    cm.replaceSelection(text);
-    panel.fireEvent('contentChanged');
-    editor.showPopup('generic-yes', 'Zmieniono tekst' );
-    editor.advancePopupQueue();
-}
-else {
-    editor.showPopup('generic-info', 'Brak zmian w tekście.');
-    editor.advancePopupQueue();
-}
-
-if(!partial) {
-    cm.selectLines( cm.nthLine(cpos.line), cpos.character );
-}</field>
-  </object>
-  <object pk="macro" model="toolbar.scriptlet">
-    <field type="TextField" name="code">params.each(function() {
-
-    editor.callScriptlet(this[0], this[1]);
-
-});</field>
-  </object>
-  <object pk="lowercase" model="toolbar.scriptlet">
-    <field type="TextField" name="code">var cm = panel.texteditor;
-
-var text = cm.selection();
-
-if(!text) return;
-
-var repl = text.toLowerCase();
-
-if(repl != text) {
-
-    cm.replaceSelection(repl);
-
-    panel.fireEvent('contentChanged');
-
-};</field>
-  </object>
-  <object pk="insert_stanza" model="toolbar.scriptlet">
-    <field type="TextField" name="code">var texteditor = panel.texteditor;
-
-var text = texteditor.selection();
-
-
-
-if(text) {
-
-   text = '\n' + text.split('\n').join('\\\n') + '\n';
-
-}
-
-
-
-texteditor.replaceSelection('&lt;strofa&gt;'+text+'&lt;/strofa&gt;');
-
-
-
-if (!text) {
-
-    var pos = texteditor.cursorPosition();
-
-    texteditor.selectLines(pos.line, pos.character + 6 + 2);
-
-}
-
-
-
-
-
-
-
-panel.fireEvent('contentChanged');</field>
-  </object>
-  <object pk="show_splitmodal" model="toolbar.scriptlet">
-    <field type="TextField" name="code">var cm = panel.texteditor;
-
-cm.focus();
-
-var text = cm.selection();
-
-if(!text) return;
-
-
-
-cm.replaceSelection('&lt;include-tag-placeholder /&gt;');
-
-var fulltext = cm.getCode();
-
-
-
-$('#split-dialog').jqmShow({
-
-    selection: text, fulltext: fulltext,
-
-    success: function(uri) {
-
-        editor.refreshPanels();
-
-    },
-
-    failure: function() { cm.undo(); } 
-
-}) ;
-
-
-
-</field>
-  </object>
-</django-objects>
diff --git a/apps/toolbar/fixtures/przyciski.xml b/apps/toolbar/fixtures/przyciski.xml
new file mode 100755 (executable)
index 0000000..e2aa914
--- /dev/null
@@ -0,0 +1,1242 @@
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+  <object pk="23" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Dodatkowe przyciski w XMLEditor</field>
+    <field type="SlugField" name="slug">xmleditor-extra-buttons</field>
+    <field type="IntegerField" name="position">-1</field>
+  </object>
+  <object pk="24" model="toolbar.buttongroup">
+    <field type="CharField" name="name">HTMLEditor Extra</field>
+    <field type="SlugField" name="slug">htmleditor-extra</field>
+    <field type="IntegerField" name="position">-1</field>
+  </object>
+  <object pk="14" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Akapity i długie cytaty</field>
+    <field type="SlugField" name="slug">akapity-i-dlugie-cytaty</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="2" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Autokorekta</field>
+    <field type="SlugField" name="slug">autokorekta</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="21" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Bloki</field>
+    <field type="SlugField" name="slug">bloki</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="12" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Dramat wierszowany</field>
+    <field type="SlugField" name="slug">dramat-wierszowany</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="18" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Dramat współczesny</field>
+    <field type="SlugField" name="slug">dramat-wspolczesny</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="13" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Elementy początkowe</field>
+    <field type="SlugField" name="slug">elementy-poczatkowe</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="1" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Nagłówki</field>
+    <field type="SlugField" name="slug">naglowki</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="22" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Początek dramatu</field>
+    <field type="SlugField" name="slug">poczatek-dramatu</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="16" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Polecenia</field>
+    <field type="SlugField" name="slug">polecenia</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="11" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Strukturalne</field>
+    <field type="SlugField" name="slug">strukturalne</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="15" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Style znakowe</field>
+    <field type="SlugField" name="slug">style-znakowe</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="17" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Wersy</field>
+    <field type="SlugField" name="slug">wersy</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="5" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;+&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">increase_font_size</field>
+    <field type="TextField" name="params">{"change": 2}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Zwiększ rozmiar czcionki.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="6" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;-&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">descrease_font_size</field>
+    <field type="TextField" name="params">{"change": -2}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Zmniejsz rozmiar czcionki.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="7" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;=&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">reset_font_size</field>
+    <field type="TextField" name="params">{"fontSize": 13}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Przywróć orginalny rozmiar czcionki.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="76" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;↓&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">tolowercase</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lowercase</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key">u</field>
+    <field type="PositiveIntegerField" name="key_mod">1</field>
+    <field type="CharField" name="tooltip">Zamień wielkie litery na małe.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="77" model="toolbar.button">
+    <field type="CharField" name="label">Cudzysłowy (1)</field>
+    <field type="SlugField" name="slug">fix-quotes-inner-arrows</field>
+    <field type="TextField" name="params">{"exprs": [["\u00ab|\u201e", ",,"], ["\u00bb", "\""], ["([^=])\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", "$1,,$2"], ["^\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", ",,$1"], ["(,,)\\s+|\\s+(\")", "$1"]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="89" model="toolbar.button">
+    <field type="CharField" name="label">Cudzysłowy (2)</field>
+    <field type="SlugField" name="slug">swap-quotes-outer-arrows</field>
+    <field type="TextField" name="params">{"exprs": [["\u00bb|\u201e", ",,"], ["\u00ab", "\""], ["([^=])\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", "$1,,$2"], ["^\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", ",,$1"], ["(,,)\\s+|\\s+(\")", "$1"]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="4" model="toolbar.button">
+    <field type="CharField" name="label">Podstawowa</field>
+    <field type="SlugField" name="slug">basic_correction</field>
+    <field type="TextField" name="params">[["fulltextregexp", {"exprs": [["\ufeff", ""], ["$[\\s]*\\d+[\\s]*^", ""], ["-\\s*^", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."]]}], ["lineregexp", {"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "], ["(,,)\\s+|\\s+(\")", "$1"], ["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"], ["&lt;(/?)P([aert])", "&lt;$1p$2"], ["([^\\.])(\\s*)&lt;/p", "$1.$2&lt;/p"]]}]]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">macro</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Wykonuję operację z novel-pages i poem-pages.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="3" model="toolbar.button">
+    <field type="CharField" name="label">Usuń spację</field>
+    <field type="SlugField" name="slug">strip_whitespace</field>
+    <field type="TextField" name="params">{"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "], ["(,,)\\s+|\\s+(\")", "$1"]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Usuwa zbędne spację z dokumentu.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="84" model="toolbar.button">
+    <field type="CharField" name="label">Wers wcięty</field>
+    <field type="SlugField" name="slug">wers-wciety</field>
+    <field type="TextField" name="params">{"tag": "wers_wciety", "attrs": {"typ": ""}}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="86" model="toolbar.button">
+    <field type="CharField" name="label">Wydrukuj</field>
+    <field type="SlugField" name="slug">print-xml</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">
+      <None/>
+    </field>
+    <field type="CharField" name="link">print/xml</field>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="87" model="toolbar.button">
+    <field type="CharField" name="label">Wydrukuj</field>
+    <field type="SlugField" name="slug">htmleditor-print</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">
+      <None/>
+    </field>
+    <field type="CharField" name="link">print/html</field>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="24"/>
+    </field>
+  </object>
+  <object pk="88" model="toolbar.button">
+    <field type="CharField" name="label">Wydziel</field>
+    <field type="SlugField" name="slug">split-text-from-xmleditor</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">show_splitmodal</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="2" model="toolbar.button">
+    <field type="CharField" name="label">Zamień dywiz</field>
+    <field type="SlugField" name="slug">zamien_dywiz</field>
+    <field type="TextField" name="params">{"exprs": [["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Zamienia '—' na '---', oraz '1—2' na '1--2'.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="39" model="toolbar.button">
+    <field type="CharField" name="label">akapit</field>
+    <field type="SlugField" name="slug">akapit</field>
+    <field type="TextField" name="params">{"tag": "akap"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+    </field>
+  </object>
+  <object pk="40" model="toolbar.button">
+    <field type="CharField" name="label">akapit cd.</field>
+    <field type="SlugField" name="slug">akapit-cd</field>
+    <field type="TextField" name="params">{"tag": "akap_cd"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+    </field>
+  </object>
+  <object pk="41" model="toolbar.button">
+    <field type="CharField" name="label">akapit dialogowy</field>
+    <field type="SlugField" name="slug">akapit-dialogowy</field>
+    <field type="TextField" name="params">{"tag": "akap_dialog"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+    </field>
+  </object>
+  <object pk="14" model="toolbar.button">
+    <field type="CharField" name="label">akt</field>
+    <field type="SlugField" name="slug">akt</field>
+    <field type="TextField" name="params">{"tag": "akt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="32" model="toolbar.button">
+    <field type="CharField" name="label">autor</field>
+    <field type="SlugField" name="slug">autor</field>
+    <field type="TextField" name="params">{"tag": "autor"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="10" model="toolbar.button">
+    <field type="CharField" name="label">część/księga</field>
+    <field type="SlugField" name="slug">czesc</field>
+    <field type="TextField" name="params">{"tag": "naglowek_czesc"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="74" model="toolbar.button">
+    <field type="CharField" name="label">dedykacja</field>
+    <field type="SlugField" name="slug">dedykacja</field>
+    <field type="TextField" name="params">{"tag": "dedykacja"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="62" model="toolbar.button">
+    <field type="CharField" name="label">didaskalia</field>
+    <field type="SlugField" name="slug">didaskalia</field>
+    <field type="TextField" name="params">{"tag": "didaskalia"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="18"/>
+    </field>
+  </object>
+  <object pk="79" model="toolbar.button">
+    <field type="CharField" name="label">didaskalia początkowe</field>
+    <field type="SlugField" name="slug">didaskalia-poczatkowe</field>
+    <field type="TextField" name="params">{"tag": "miejsce_czas"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="63" model="toolbar.button">
+    <field type="CharField" name="label">didaskalia wewn.</field>
+    <field type="SlugField" name="slug">didaskalia-wewn</field>
+    <field type="TextField" name="params">{"tag": "didask_tekst"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="18"/>
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="20" model="toolbar.button">
+    <field type="CharField" name="label">dramat wiersz.</field>
+    <field type="SlugField" name="slug">dramat-wiersz</field>
+    <field type="TextField" name="params">{"tag": "dramat_wierszowany_l"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="22" model="toolbar.button">
+    <field type="CharField" name="label">dramat wiersz./w. łam</field>
+    <field type="SlugField" name="slug">dramat-wiersz-w-lam</field>
+    <field type="TextField" name="params">{"tag": "dramat_wierszowany_lp"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="21" model="toolbar.button">
+    <field type="CharField" name="label">dramat współczesny</field>
+    <field type="SlugField" name="slug">dramat-wspolczesny</field>
+    <field type="TextField" name="params">{"tag": "dramat_wspolczesny"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="38" model="toolbar.button">
+    <field type="CharField" name="label">dzieło nadrzędne</field>
+    <field type="SlugField" name="slug">dzielo-nadrzedne</field>
+    <field type="TextField" name="params">{"tag": "dzielo_nadrzedne"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="67" model="toolbar.button">
+    <field type="CharField" name="label">długi cyt. poet.</field>
+    <field type="SlugField" name="slug">dlugi-cyt-poet</field>
+    <field type="TextField" name="params">{"tag": "poezja_cyt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="42" model="toolbar.button">
+    <field type="CharField" name="label">długi cytat</field>
+    <field type="SlugField" name="slug">dlugi-cytat</field>
+    <field type="TextField" name="params">{"tag": "dlugi_cyt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="52" model="toolbar.button">
+    <field type="CharField" name="label">ekstra</field>
+    <field type="SlugField" name="slug">ekstra</field>
+    <field type="TextField" name="params">{"tag": "ekstra"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="82" model="toolbar.button">
+    <field type="CharField" name="label">kwestia</field>
+    <field type="SlugField" name="slug">kwestia</field>
+    <field type="TextField" name="params">{"tag": "kwestia"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="18"/>
+    </field>
+  </object>
+  <object pk="23" model="toolbar.button">
+    <field type="CharField" name="label">liryka</field>
+    <field type="SlugField" name="slug">liryka</field>
+    <field type="TextField" name="params">{"tag": "liryka_l"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="24" model="toolbar.button">
+    <field type="CharField" name="label">liryka/w. łam</field>
+    <field type="SlugField" name="slug">liryka-w-lam</field>
+    <field type="TextField" name="params">{"tag": "liryka_lp"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="78" model="toolbar.button">
+    <field type="CharField" name="label">lista osób: pole</field>
+    <field type="SlugField" name="slug">lista-osob-pole</field>
+    <field type="TextField" name="params">{"tag": "lista_osoba", "attrs": {"typ": ""}}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="47" model="toolbar.button">
+    <field type="CharField" name="label">mamtemat.</field>
+    <field type="SlugField" name="slug">matemat</field>
+    <field type="TextField" name="params">{"tag": "mat"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="75" model="toolbar.button">
+    <field type="CharField" name="label">motto</field>
+    <field type="SlugField" name="slug">motto</field>
+    <field type="TextField" name="params">{"tag": "motto"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="37" model="toolbar.button">
+    <field type="CharField" name="label">motto podpis</field>
+    <field type="SlugField" name="slug">motto-podpis</field>
+    <field type="TextField" name="params">{"tag": "motto_podpis"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="16" model="toolbar.button">
+    <field type="CharField" name="label">nagłówek kwestii</field>
+    <field type="SlugField" name="slug">naglowek-kwestii</field>
+    <field type="TextField" name="params">{"tag": "naglowek_osoba"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="35" model="toolbar.button">
+    <field type="CharField" name="label">nota</field>
+    <field type="SlugField" name="slug">nota</field>
+    <field type="TextField" name="params">{"tag": "nota"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="18" model="toolbar.button">
+    <field type="CharField" name="label">opowiadanie</field>
+    <field type="SlugField" name="slug">opowiadanie</field>
+    <field type="TextField" name="params">{"tag": "opowiadanie"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="64" model="toolbar.button">
+    <field type="CharField" name="label">osoba</field>
+    <field type="SlugField" name="slug">osoba</field>
+    <field type="TextField" name="params">{"tag": "osoba"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="18"/>
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="12" model="toolbar.button">
+    <field type="CharField" name="label">podrozdział</field>
+    <field type="SlugField" name="slug">podrozdzial</field>
+    <field type="TextField" name="params">{"tag": "naglowek_podrozdzial"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="34" model="toolbar.button">
+    <field type="CharField" name="label">podtytuł</field>
+    <field type="SlugField" name="slug">podtytul</field>
+    <field type="TextField" name="params">{"tag": "podtytul"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="19" model="toolbar.button">
+    <field type="CharField" name="label">powieść</field>
+    <field type="SlugField" name="slug">powiesc</field>
+    <field type="TextField" name="params">{"tag": "powiesc"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="68" model="toolbar.button">
+    <field type="CharField" name="label">przypis autorski</field>
+    <field type="SlugField" name="slug">przypis-autorski</field>
+    <field type="TextField" name="params">{"tag": "pa"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="71" model="toolbar.button">
+    <field type="CharField" name="label">przypis edytorski</field>
+    <field type="SlugField" name="slug">przypis-edytorski</field>
+    <field type="TextField" name="params">{"tag": "pe"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="70" model="toolbar.button">
+    <field type="CharField" name="label">przypis redaktorski</field>
+    <field type="SlugField" name="slug">przypis-redaktorski</field>
+    <field type="TextField" name="params">{"tag": "pr"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="69" model="toolbar.button">
+    <field type="CharField" name="label">przypis tłumacza</field>
+    <field type="SlugField" name="slug">przypis-tlumacza</field>
+    <field type="TextField" name="params">{"tag": "pt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="11" model="toolbar.button">
+    <field type="CharField" name="label">rozdział</field>
+    <field type="SlugField" name="slug">rozdzial</field>
+    <field type="TextField" name="params">{"tag": "naglowek_rozdzial"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="15" model="toolbar.button">
+    <field type="CharField" name="label">scena</field>
+    <field type="SlugField" name="slug">scena</field>
+    <field type="TextField" name="params">{"tag": "naglowek_scena"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="54" model="toolbar.button">
+    <field type="CharField" name="label">sep. asteryks</field>
+    <field type="SlugField" name="slug">sep-asteryks</field>
+    <field type="TextField" name="params">{"tag": "sekcja_asteryks"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="55" model="toolbar.button">
+    <field type="CharField" name="label">sep. linia</field>
+    <field type="SlugField" name="slug">sep-linia</field>
+    <field type="TextField" name="params">{"tag": "separator_linia"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="53" model="toolbar.button">
+    <field type="CharField" name="label">sep. światło</field>
+    <field type="SlugField" name="slug">sep-swiatlo</field>
+    <field type="TextField" name="params">{"tag": "sekcja_swiatlo"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="81" model="toolbar.button">
+    <field type="CharField" name="label">strofa</field>
+    <field type="SlugField" name="slug">strofa</field>
+    <field type="TextField" name="params">{"tag": "strofa"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_stanza</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key">s</field>
+    <field type="PositiveIntegerField" name="key_mod">1</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="46" model="toolbar.button">
+    <field type="CharField" name="label">słowo obce</field>
+    <field type="SlugField" name="slug">slowo-obce</field>
+    <field type="TextField" name="params">{"tag": "slowo_obce"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="17" model="toolbar.button">
+    <field type="CharField" name="label">tagi główne</field>
+    <field type="SlugField" name="slug">tagi-glowne</field>
+    <field type="TextField" name="params">{"tag": "utwor"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="33" model="toolbar.button">
+    <field type="CharField" name="label">tytuł</field>
+    <field type="SlugField" name="slug">tytul</field>
+    <field type="TextField" name="params">{"tag": "nazwa_utworu"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="45" model="toolbar.button">
+    <field type="CharField" name="label">tytuł dzieła</field>
+    <field type="SlugField" name="slug">tytul-dziela</field>
+    <field type="TextField" name="params">{"tag": "tytul_dziela", "attrs": {"typ": "1"}}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="51" model="toolbar.button">
+    <field type="CharField" name="label">uwaga</field>
+    <field type="SlugField" name="slug">uwaga</field>
+    <field type="TextField" name="params">{"tag": "uwaga"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="83" model="toolbar.button">
+    <field type="CharField" name="label">wers akap.</field>
+    <field type="SlugField" name="slug">wers-akap</field>
+    <field type="TextField" name="params">{"tag": "wers_akap"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="85" model="toolbar.button">
+    <field type="CharField" name="label">wers cd.</field>
+    <field type="SlugField" name="slug">wers-cd</field>
+    <field type="TextField" name="params">{"tag": "wers_cd"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="48" model="toolbar.button">
+    <field type="CharField" name="label">www</field>
+    <field type="SlugField" name="slug">www</field>
+    <field type="TextField" name="params">{"tag": "www"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="44" model="toolbar.button">
+    <field type="CharField" name="label">wyróżnienie</field>
+    <field type="SlugField" name="slug">wyroznienie</field>
+    <field type="TextField" name="params">{"tag": "wyroznienie"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="25" model="toolbar.button">
+    <field type="CharField" name="label">wywiad</field>
+    <field type="SlugField" name="slug">wywiad</field>
+    <field type="TextField" name="params">{"tag": "wywiad"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="73" model="toolbar.button">
+    <field type="CharField" name="label">wywiad odpowiedź</field>
+    <field type="SlugField" name="slug">wywiad-odpowiedz</field>
+    <field type="TextField" name="params">{"tag": "wywiad_odp"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="72" model="toolbar.button">
+    <field type="CharField" name="label">wywiad pytanie</field>
+    <field type="SlugField" name="slug">wywiad-pytanie</field>
+    <field type="TextField" name="params">{"tag": "wywiad_pyt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="56" model="toolbar.button">
+    <field type="CharField" name="label">zastępnik wersu</field>
+    <field type="SlugField" name="slug">zastepnik-wersu</field>
+    <field type="TextField" name="params">{"tag": "zastepnik_wersu"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="13" model="toolbar.button">
+    <field type="CharField" name="label">śródtytuł</field>
+    <field type="SlugField" name="slug">srodtytul</field>
+    <field type="TextField" name="params">{"tag": "srodtytul"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="insert_tag" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var texteditor = panel.texteditor;
+
+var text = texteditor.selection();
+
+var out = '&lt;'+params.tag;
+
+for (var attr in params.attrs) {
+
+    out += ' '+attr+'="' + params.attrs[attr] + '"';
+
+};
+
+out += '&gt;';
+
+out += text;
+
+out += '&lt;/' + params.tag + '&gt;';
+
+
+texteditor.replaceSelection(out);
+
+
+
+if (text.length == 0) {
+
+    var pos = texteditor.cursorPosition();
+
+    texteditor.selectLines(pos.line, pos.character + params.tag.length + 2);
+
+}
+
+
+
+panel.fireEvent('contentChanged');</field>
+  </object>
+  <object pk="lineregexp" model="toolbar.scriptlet">
+    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);
+
+var cm = panel.texteditor;
+var exprs = $.map(params.exprs, function(expr) {
+
+    var opts = "g";
+
+    if(expr.length &gt; 2)
+
+        opts = expr[2];
+
+    return {rx: new RegExp(expr[0], opts), repl: expr[1]};
+
+});
+
+
+
+var partial = true;
+
+var text = cm.selection();
+
+
+
+if(!text) {
+
+    var cpos = cm.cursorPosition();
+
+    cpos.line = cm.lineNumber(cpos.line)
+
+    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);
+
+    text = cm.selection();
+
+    partial = false;
+
+}
+
+
+
+var changed = 0;
+var lines = text.split('\n');
+var lines = $.map(lines, function(line) { 
+    var old_line = line;
+    $(exprs).each(function() { 
+        var expr = this;
+        line = line.replace(expr.rx, expr.repl);
+    });
+
+    if(old_line != line) changed += 1;
+    return line;
+});
+
+if(changed &gt; 0) 
+{
+    cm.replaceSelection( lines.join('\n') );
+    panel.fireEvent('contentChanged');
+    editor.showPopup('generic-yes', 'Zmieniono ' + changed + ' linii.', 1500);
+    editor.advancePopupQueue();
+}
+else {
+    editor.showPopup('generic-info',  'Brak zmian w tekście', 1500);
+    editor.advancePopupQueue();
+}
+
+if(!partial)
+    cm.selectLines( cm.nthLine(cpos.line), cpos.character )</field>
+  </object>
+  <object pk="codemirror_fontsize" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var texteditor = panel.texteditor;
+
+var frameBody = $('body', $(texteditor.frame).contents());
+
+
+
+if(params.fontSize) {
+
+    frameBody.css('font-size', params.fontSize);
+
+}
+
+else {
+
+    var old_size = parseInt(frameBody.css('font-size'));
+
+    frameBody.css('font-size', old_size + (params.change || 0) );
+
+}</field>
+  </object>
+  <object pk="fulltextregexp" model="toolbar.scriptlet">
+    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);
+$.log(editor, panel, params);
+var cm = panel.texteditor;
+var exprs = $.map(params.exprs, function(expr) {
+    var opts = "mg";
+    if(expr.length &gt; 2)
+        opts = expr[2];
+
+    return {rx: new RegExp(expr[0], opts), repl: expr[1]};
+});
+
+var partial = true;
+var text = cm.selection();
+
+if(!text) {
+    var cpos = cm.cursorPosition();
+    cpos.line = cm.lineNumber(cpos.line)
+    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);
+
+    text = cm.selection();
+    partial = false;
+}
+
+var original = text;
+$(exprs).each(function() { 
+    text = text.replace(this.rx, this.repl);
+});
+
+if( original != text) 
+{    
+    cm.replaceSelection(text);
+    panel.fireEvent('contentChanged');
+    editor.showPopup('generic-yes', 'Zmieniono tekst' );
+    editor.advancePopupQueue();
+}
+else {
+    editor.showPopup('generic-info', 'Brak zmian w tekście.');
+    editor.advancePopupQueue();
+}
+
+if(!partial) {
+    cm.selectLines( cm.nthLine(cpos.line), cpos.character );
+}</field>
+  </object>
+  <object pk="macro" model="toolbar.scriptlet">
+    <field type="TextField" name="code">$(params).each(function() {
+    $.log(this[0], this[1]);
+    editor.callScriptlet(this[0], panel, this[1]);
+
+});</field>
+  </object>
+  <object pk="lowercase" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var cm = panel.texteditor;
+var text = cm.selection();
+
+if(!text) return;
+var repl = '';
+var lcase = text.toLowerCase();
+var ucase = text.toUpperCase();
+
+if(lcase == text) repl = ucase; /* was lowercase */
+else if(ucase != text) repl = lcase; /* neither lower- or upper-case */
+else { /* upper case -&gt; camel-case */
+   repl = ''
+   $(lcase.split(/\s/)).each(function() { 
+     if(this.length &gt; 0) repl += this[0].toUpperCase() + this.slice(1) + ' ';
+   }); 
+} 
+
+if(repl != text) {
+    cm.replaceSelection(repl);
+    panel.fireEvent('contentChanged');
+};</field>
+  </object>
+  <object pk="insert_stanza" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var texteditor = panel.texteditor;
+var text = texteditor.selection();
+
+if(text) {
+  var verses = text.split('\n');
+  var text = ''; var buf = ''; var ebuf = '';
+  var first = true;
+
+  for(var i=0;  i &lt; verses.length; i++) {
+    verse = verses[i].replace(/^\s+/, "").replace(/\s+$/, "");   
+    if(verse) {
+      text += (buf ? buf + '\\\n' : '') + ebuf;
+      buf = (first ? '&lt;strofa&gt;\n' : '') + verses[i];
+      ebuf = '';
+      first = false;
+    } else {    
+      ebuf += '\n' + verses[i];
+    }
+  };
+  text = text + buf + '\n&lt;/strofa&gt;' + ebuf; 
+  texteditor.replaceSelection(text);
+}
+
+if (!text) {
+    var pos = texteditor.cursorPosition();
+    texteditor.selectLines(pos.line, pos.character + 6 + 2);
+}
+
+
+
+
+
+
+
+panel.fireEvent('contentChanged');</field>
+  </object>
+  <object pk="show_splitmodal" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var cm = panel.texteditor;
+
+cm.focus();
+
+var text = cm.selection();
+
+if(!text) return;
+
+
+
+cm.replaceSelection('&lt;include-tag-placeholder /&gt;');
+
+var fulltext = cm.getCode();
+
+
+
+$('#split-dialog').jqmShow({
+
+    selection: text, fulltext: fulltext,
+
+    success: function(uri) {
+
+        editor.refreshPanels();
+
+    },
+
+    failure: function() { cm.undo(); } 
+
+}) ;</field>
+  </object>
+</django-objects>
index 6dcbbe0..aede174 100755 (executable)
@@ -1 +1 @@
-./project/manage.py dumpdata --format=xml toolbar | xmllint --format - > fixtures/przyciski.new.xml
+./project/manage.py dumpdata --format=xml toolbar | xmllint --format - > apps/toolbar/fixtures/przyciski.xml
index 3ae16b0..e37228c 100644 (file)
@@ -460,8 +460,10 @@ Editor.prototype.sendMergeRequest = function (message) {
     if( $('.panel-wrap.changed').length != 0)        
         alert("There are unsaved changes - can't commit.");
 
-    var self =  this;
-    $.log('URL !: ', $('#commit-dialog form').attr('action'));
+    var self =  this;    
+
+    $('#commit-dialog-related-issues input:checked').
+        each(function() { message += ' refs #' + $(this).val(); });  
     
     $.ajax({        
         url: $('#commit-dialog form').attr('action'),
index aed0455..4d2a5d3 100755 (executable)
@@ -163,15 +163,17 @@ Editor.prototype.setupUI = function() {
     $('#commit-dialog').\r
     jqm({\r
         modal: true,\r
+        onShow: $.fbind(self, self.loadRelatedIssues),\r
         trigger: '#toolbar-button-commit'\r
     });\r
-\r
+    \r
+    /* STATIC BINDS */\r
     $('#commit-dialog-cancel-button').click(function() {\r
         $('#commit-dialog-error-empty-message').hide();\r
         $('#commit-dialog').jqmHide();\r
     });\r
 \r
-    $('#commit-dialog-save-button').click( function (event, data) \r
+    $('#commit-dialog-save-button').click( function (event, data)\r
     {\r
         if( $('#commit-dialog-message').val().match(/^\s*$/)) {\r
             $('#commit-dialog-error-empty-message').fadeIn();\r
@@ -180,10 +182,11 @@ Editor.prototype.setupUI = function() {
             $('#commit-dialog-error-empty-message').hide();\r
             $('#commit-dialog').jqmHide();\r
             self.sendMergeRequest($('#commit-dialog-message').val() );\r
-        }       \r
-     \r
+        }\r
+\r
         return false;\r
-    });    \r
+    });\r
+    \r
 \r
     /* SPLIT DIALOG */\r
     $('#split-dialog').jqm({\r
@@ -195,6 +198,31 @@ Editor.prototype.setupUI = function() {
 // $('#split-dialog').   \r
 }\r
 \r
+Editor.prototype.loadRelatedIssues = function(hash)\r
+{\r
+    var self = this;\r
+    var c = $('#commit-dialog-related-issues');\r
+\r
+    $("div.loading-box", c).show();\r
+    $("div.fatal-error-box", c).hide();\r
+    $("div.container-box", c).hide();\r
+    \r
+    $.getJSON( c.attr('ui:ajax-src') + '?callback=?',\r
+    function(data, status)\r
+    {\r
+        var fmt = '';\r
+        $(data).each( function() {\r
+            fmt += '<label><input type="checkbox" checked="checked"'\r
+            fmt += ' value="' + this.id + '" />' + this.subject +'</label>\n'\r
+        });\r
+        $("div.container-box", c).html(fmt);\r
+        $("div.loading-box", c).hide();\r
+        $("div.container-box", c).show();        \r
+    });   \r
+    \r
+    hash.w.show();\r
+}\r
+\r
 Editor.prototype.loadSplitDialog = function(hash)\r
 {\r
     var self = this;    \r
index 6ee1cf8..02a1c75 100644 (file)
             </div>
             {% endfor %}
         </div>
+
         <div id="commit-dialog" class="jqmWindow">
             <form action="{% url file_commit fileid %}" method="POST">
                 <label for="message">Commit message:</label>
-                <textarea cols="60" rows="15" name="message" id="commit-dialog-message"></textarea>
-                <p id="commit-dialog-error-empty-message">Wiadomość nie może być pusta.</p>
+                <textarea cols="60" rows="10" name="message" id="commit-dialog-message"></textarea>
+                <p id="commit-dialog-error-empty-message">Wiadomość nie może być pusta.</p>                
+                <fieldset id="commit-dialog-related-issues" 
+                          ui:ajax-src="http://localhost:3000/publications/issues/{{fileid}}">
+                    <legend>Related issues</legend>
+                    <div class="loading-box" style="display: none;">
+                        <p>Loading related issues...</p>
+                    </div>
+                    <div class="container-box">No related issues.</div>
+                </fieldset>
                 <p>
                    <input type="submit" value="Save" id="commit-dialog-save-button" />
                    <input type="reset" value="Cancel" id="commit-dialog-cancel-button" />
         <div id="split-dialog" class="jqmWindow">
             <div class="container-box"> </div>
             <div class="loading-box" style="display: none;">
-                <p>Wczytuję zawartość okna...</p>
+                <p>Loading dialog contents...</p>
                 <!-- <p><button type="button" class="dialog-close-button">Close</button></p> -->
             </div>
             <div class="fatal-error-box" style="display: none;">
index a9d7c15..6c1e734 100644 (file)
@@ -1,64 +1,59 @@
 class PublicationsController < ApplicationController
   unloadable
 
-#  before_filter :authorize, :only => [:issues]
+  #  before_filter :authorize, :only => [:issues]
 
   def index
        @publications = Publication.all
-       respond_to do |format|  
-         format.html
-         format.xml { render :xml => @publications }
-         format.json { render :json => @publications }
-       end
+    respond_to do |format|
+      format.html
+      format.xml { render :xml => @publications }
+      format.json { render :json => @publications }
+    end
   end
 
   def refresh
-       @match_status = []
+    @match_status = []
 
-       regexp = Regexp.new(Setting.plugin_redmine_publications[:pattern])
-       Repository.all.each do |repo|
-         repo_status = []
-         repo.entries.each do |entry|
-           match = entry.path.match(regexp)
-            if match
-             Publication.find_or_create_by_name(:name => match[1], 
-               :source_file => entry.path, :repository_id => repo.id)
-             repo_status += [{:path => entry.path, :match => match[1], :matched => true}]
-            else
-             repo_status += [{:path => entry.path, :match =>nil, :matched => false}]
-           end
-          end
-          @match_status += [{:repo => repo, :status => repo_status}]
-        end    
+    regexp = Regexp.new(Setting.plugin_redmine_publications[:pattern])
+    Publication.delete_all()
+    repos = Repository.all
+    if repos
+    repos.each do |repo|
+      repo_status = []
+      if repo.entries
+      repo.entries.each do |entry|
+        match = entry.path.match(regexp)
+        if match
+          Publication.find_or_create_by_name(:name => match[1],
+            :source_file => entry.path, :repository_id => repo.id)
+          repo_status += [{:path => entry.path, :match => match[1], :matched => true}]
+        else
+          repo_status += [{:path => entry.path, :match =>nil, :matched => false}]
+        end
+      end
+      @match_status += [{:repo => repo, :status => repo_status}]
+      end
+    end
        
-       respond_to do |format|  
-         format.html
-         format.xml { render :xml => @match_status}
-         format.json { render :json => @match_status }
-       end
+    respond_to do |format|
+      format.html
+      format.xml { render :xml => @match_status}
+      format.json { render :json => @match_status }
+    end
+    end
   end
 
   def issues
-       @publication = Publication.find_by_name(params[:pub])
-
-       joins = "JOIN issue_publications ON (issues.id = issue_publications.issue_id)"
-       conditions = ['issue_publications.publication_id = ? ', @publication.id ]
-       @issues = Issue.all(:joins => joins, :conditions =>  conditions)
-       respond_to do |format|
-         format.html
-          format.xml do 
-           render :xml => @issues
-          end
+    @publication = Publication.find_by_name(params[:pub])
 
-         format.json do
-           headers['Content-Type'] = 'application/json'
-           render :json => @issues
-         end
-        end
-  end
+    joins = "JOIN issue_publications ON (issues.id = issue_publications.issue_id)"
+    conditions = ['issue_publications.publication_id = ? ', @publication.id ]
+    @issues = Issue.all(:joins => joins, :conditions =>  conditions)
 
-  def redirect_to_platform
-       render :text => ""
+    respond_to do |fmt| 
+       fmt.json { render :json => @issues, :callback => params[:callback] }
+    end
   end
 
   private
diff --git a/redmine/redmine_publications/app/views/issues/_issue_view_pub.erb b/redmine/redmine_publications/app/views/issues/_issue_view_pub.erb
new file mode 100644 (file)
index 0000000..26ce997
--- /dev/null
@@ -0,0 +1,8 @@
+<tr>
+    <td><b>Publication(s)</b></td>
+    <td>
+<% @issue.publication_names.each  do |pub| %>
+      <a href="<%= Setting.plugin_redmine_publications[:editorurl].sub(':pubid', pub) %>"><%= pub %></a><br />
+<% end %>
+    </td>
+</tr>
index 0465535..8ab2a7b 100644 (file)
   <label for="settings[pattern]">Filtr publikacji: </label>
   <%= text_field_tag 'settings[pattern]', @settings[:pattern] || '' %>
 </p>
+
+<p>
+  <label for="settings[editorurl]">Docelowy URL: </label>
+  <%= text_field_tag 'settings[editorurl]', @settings[:editorurl] || '' %>
+</p>
+
 </fieldset>
index b1739c3..0aa6f07 100644 (file)
@@ -24,7 +24,7 @@ Redmine::Plugin.register :redmine_publications do
   # permission :view_issues_for_publication, :publications => :issues 
 
   settings :partial => 'settings/publications_settings',
-       :default => { :tracker => '1', :pattern => '.*/[a-z_].xml'}
+      :default => { :tracker => '1', :pattern => '.*/[a-z_].xml', :editorurl => 'http://localhost/:pubid'}
 
   menu :application_menu, :publications, { :controller => 'publications', :action => 'index' }, :caption => 'Publikacje'
 
index 77fa215..6d2101c 100644 (file)
@@ -1,36 +1,55 @@
 # Provides a link to the document on the platform
 class IssuesPublicationHook < Redmine::Hook::ViewListener
 
-  def view_issues_show_details_bottom(context)
-       # TODO: złapać wyjątek konwersji
-       if context[:issue].tracker_id == Setting.plugin_redmine_publications[:tracker].to_i
-          result = "<tr><td><b>Publication(s):</b></td><td>"
-         names = context[:issue].publication_names {|name| "<span>" + name + "</span>"} 
-         result << names.join(', ')
-         result << "</td></tr>"
-       end
+  def self.render_on(hook, options={})
+    define_method hook do |context|
+      if !options.include?(:if) || evaluate_if_option(options[:if], context)
+        context[:controller].send(:render_to_string, {:locals => context}.merge(options))
+      end
+    end
   end
 
+  private
+
+  def evaluate_if_option(if_option, context)
+    case if_option
+    when Symbol
+      send(if_option, context)
+    when Method, Proc
+      if_option.call(context)
+    end
+  end
+
+  def is_pticket?(context)
+    context[:issue].tracker_id == Setting.plugin_redmine_publications[:tracker].to_i
+  end
+
+  public
+
+  render_on :view_issues_show_details_bottom, :partial => 'issue_view_pub', :if => :is_pticket?
+  render_on :view_issues_form_details_bottom, :partial => 'issue_form_pub', :if => :is_pticket?
+
+  #  names = context[:issue].publication_names {|name| "<span>" + name + "</span>"}
+  #  result << names.join(', ')
+
   def controller_issues_edit_before_save(context)
-       if context[:issue].tracker.id == Setting.plugin_redmine_publications[:tracker].to_i
-         old_value = context[:issue].publication_names
-         new_value = context[:params][:publications].split(',').map { |n| n.strip }
-         context[:journal].details << JournalDetail.new(
-               :property => 'attr', :prop_key => "publications", 
-               :old_value => old_value.join(', '), 
-               :value => new_value.join(', ') ) unless new_value==old_value
-         context[:issue].publication_names = new_value
-       end
+    if is_pticket?context
+      old_value = context[:issue].publication_names
+      new_value = context[:params][:publications].split(',').map { |n| n.strip }
+      context[:journal].details << JournalDetail.new(
+        :property => 'attr', :prop_key => "publications",
+        :old_value => old_value.join(', '),
+        :value => new_value.join(', ') ) unless new_value==old_value
+      context[:issue].publication_names = new_value
+    end
   end
 
 
   def controller_issues_new_after_save(context)
-       if context[:issue].tracker.id == Setting.plugin_redmine_publications[:tracker].to_i
-         value = context[:params][:publications].split(',').map { |n| n.strip }
-         context[:issue].publication_names = value
-         context[:issue].save
-       end
+    if is_pticket?context
+      value = context[:params][:publications].split(',').map { |n| n.strip }
+      context[:issue].publication_names = value
+      context[:issue].save
+    end
   end
-       
-  render_on :view_issues_form_details_bottom, :partial => 'issue_form_pub'
 end
index d1cf057..8752c69 100644 (file)
@@ -6,8 +6,5 @@ connect 'publications/:action.:format',
        :controller => 'publications' 
 
 connect 'publications/:action/:pub', 
-       :controller => 'publications',
-       :format => 'html'
-       
-connect 'publications/:action/:pub.:format', 
-       :controller => 'publications' 
+       :controller => 'publications', :format => 'json',
+     :pub => /[^\/?]+/