|
|
| (не показано 5 промежуточных версий 1 участника) |
| Строка 1: |
Строка 1: |
| <noinclude>{{Documentation}}</noinclude> | | <noinclude>Шаблон архивного песенника.</noinclude><includeonly> |
| <includeonly> | | ''Архивный песенник.'' {{{Title|}}} |
| <div class="songbook-container">
| |
| <div class="songbook-header">
| |
| <h1>{{{Title}}}</h1>
| |
| <p>{{{Description}}}</p>
| |
| <div class="songbook-actions">
| |
| <button class="add-song">Добавить песню</button>
| |
| <button class="export-pdf">Экспорт в PDF</button>
| |
| </div>
| |
| <div class="song-search" style="display:none">
| |
| {{#forminput:form=AddSongToBook|autocomplete on category=Песни}}
| |
| </div>
| |
| </div>
| |
|
| |
|
| <div class="song-list" id="sortable-list">
| | {{{Description|}}} |
| {{#cargo_query:
| |
| tables=SongbookEntries
| |
| |join on=SongbookEntries.SongPage=song._pageName
| |
| |where=SongbookEntries.SongbookID="{{{SongbookID}}}"
| |
| |order by=SongbookEntries.SortOrder
| |
| |fields=SongbookEntries.EntryID,
| |
| SongbookEntries.SongPage
| |
| |format=template
| |
| |template=SongbookItem
| |
| }}
| |
| </div>
| |
| </div>
| |
|
| |
|
| <script>
| | [[Служебная:Мои песенники|Мои песенники]] · [[Служебная:Публичные песенники|Публичные песенники]] |
| document.addEventListener('DOMContentLoaded', function() {
| |
| new Sortable(document.getElementById('sortable-list'), {
| |
| animation: 150,
| |
| onUpdate: function(evt) {
| |
| const entries = Array.from(evt.from.children).map((item, index) => ({
| |
| entryId: item.dataset.entryId,
| |
| order: index + 1
| |
| }));
| |
|
| |
| new mw.Api().postWithToken('csrf', {
| |
| action: 'cargoupdate',
| |
| table: 'SongbookEntries',
| |
| updates: entries.map(e => `SortOrder=${e.order} WHERE EntryID="${e.entryId}"`)
| |
| });
| |
| }
| |
| });
| |
| });
| |
| </script>
| |
| </includeonly> | | </includeonly> |
Шаблон архивного песенника.