diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 7063055c5d..f72b1e1aaa 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -247,7 +247,7 @@ define('forum/chats', [ let modal; buttonEl.on('click', function () { - app.parseAndTranslate('partials/modals/manage_room', {}, function (html) { + app.parseAndTranslate('modals/manage-room', {}, function (html) { modal = bootbox.dialog({ title: '[[modules:chat.manage-room]]', message: html, @@ -325,7 +325,7 @@ define('forum/chats', [ } } - app.parseAndTranslate('partials/modals/manage_room_users', data, function (html) { + app.parseAndTranslate('partials/chats/manage-room-users', data, function (html) { listEl.html(html); }); }; @@ -334,7 +334,7 @@ define('forum/chats', [ let modal; buttonEl.on('click', function () { - app.parseAndTranslate('partials/modals/rename_room', { + app.parseAndTranslate('modals/rename-room', { name: roomName || ajaxify.data.roomName, }, function (html) { modal = bootbox.dialog({ diff --git a/public/src/client/topic/diffs.js b/public/src/client/topic/diffs.js index ea492348cb..d635c4e0f6 100644 --- a/public/src/client/topic/diffs.js +++ b/public/src/client/topic/diffs.js @@ -109,7 +109,7 @@ define('forum/topic/diffs', ['api', 'bootbox', 'alerts', 'forum/topic/images'], params.unshift(blockName); } - app.parseAndTranslate('partials/modals/post_history', ...params); + app.parseAndTranslate('modals/post-history', ...params); }); } diff --git a/public/src/client/topic/votes.js b/public/src/client/topic/votes.js index 74402df1e4..3f2bc718d0 100644 --- a/public/src/client/topic/votes.js +++ b/public/src/client/topic/votes.js @@ -100,7 +100,7 @@ define('forum/topic/votes', [ return alerts.error(err); } - app.parseAndTranslate('partials/modals/votes_modal', data, function (html) { + app.parseAndTranslate('modals/votes', data, function (html) { const dialog = bootbox.dialog({ title: '[[global:voters]]', message: html, diff --git a/public/src/modules/accounts/picture.js b/public/src/modules/accounts/picture.js index a95ea2270e..e9413bf209 100644 --- a/public/src/modules/accounts/picture.js +++ b/public/src/modules/accounts/picture.js @@ -172,7 +172,7 @@ define('accounts/picture', [ modal.find('[data-action="upload-url"]').on('click', function () { modal.modal('hide'); - app.parseAndTranslate('partials/modals/upload_picture_from_url_modal', {}, function (uploadModal) { + app.parseAndTranslate('modals/upload-picture-from-url', {}, function (uploadModal) { uploadModal.modal('show'); uploadModal.find('.upload-btn').on('click', function () { diff --git a/public/src/modules/flags.js b/public/src/modules/flags.js index 820dad9a7a..bff55bf8b5 100644 --- a/public/src/modules/flags.js +++ b/public/src/modules/flags.js @@ -8,7 +8,7 @@ define('flags', ['hooks', 'components', 'api', 'alerts'], function (hooks, compo let flagReason; Flag.showFlagModal = function (data) { - app.parseAndTranslate('partials/modals/flag_modal', data, function (html) { + app.parseAndTranslate('modals/flag', data, function (html) { flagModal = html; flagModal.on('hidden.bs.modal', function () { flagModal.remove(); diff --git a/public/src/modules/pictureCropper.js b/public/src/modules/pictureCropper.js index cb1201ba29..c6b7185406 100644 --- a/public/src/modules/pictureCropper.js +++ b/public/src/modules/pictureCropper.js @@ -5,7 +5,7 @@ define('pictureCropper', ['alerts'], function (alerts) { module.show = function (data, callback) { const fileSize = data.hasOwnProperty('fileSize') && data.fileSize !== undefined ? parseInt(data.fileSize, 10) : false; - app.parseAndTranslate('partials/modals/upload_file_modal', { + app.parseAndTranslate('modals/upload-file', { showHelp: data.hasOwnProperty('showHelp') && data.showHelp !== undefined ? data.showHelp : true, fileSize: fileSize, title: data.title || '[[global:upload_file]]', diff --git a/public/src/modules/uploader.js b/public/src/modules/uploader.js index c8d5351e7e..8aa010871a 100644 --- a/public/src/modules/uploader.js +++ b/public/src/modules/uploader.js @@ -6,7 +6,7 @@ define('uploader', ['jquery-form'], function () { module.show = function (data, callback) { const fileSize = data.hasOwnProperty('fileSize') && data.fileSize !== undefined ? parseInt(data.fileSize, 10) : false; - app.parseAndTranslate('partials/modals/upload_file_modal', { + app.parseAndTranslate('modals/upload-file', { showHelp: data.hasOwnProperty('showHelp') && data.showHelp !== undefined ? data.showHelp : true, fileSize: fileSize, title: data.title || '[[global:upload_file]]', diff --git a/src/views/modals/flag.tpl b/src/views/modals/flag.tpl new file mode 100644 index 0000000000..3b101138e4 --- /dev/null +++ b/src/views/modals/flag.tpl @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/src/views/modals/manage-room.tpl b/src/views/modals/manage-room.tpl new file mode 100644 index 0000000000..de9ac4f331 --- /dev/null +++ b/src/views/modals/manage-room.tpl @@ -0,0 +1,11 @@ +
+ +

+

[[modules:chat.add-user-help]]

+ +
+ + +
\ No newline at end of file diff --git a/src/views/modals/post-history.tpl b/src/views/modals/post-history.tpl new file mode 100644 index 0000000000..1f187e991e --- /dev/null +++ b/src/views/modals/post-history.tpl @@ -0,0 +1,36 @@ +

+ + [[topic:diffs.description, {numDiffs}]] + + [[topic:diffs.no-revisions-description, {numDiffs}]] + +

+ +
+ + +
+ + + + {{{ if editable }}} + + {{{ end }}} + {{{ if deletable }}} + + {{{ end }}} + {{{ if editable }}} +

[[topic:diffs.restore-description]]

+ {{{ end }}} + +
+ diff --git a/src/views/modals/rename-room.tpl b/src/views/modals/rename-room.tpl new file mode 100644 index 0000000000..9a77ca105c --- /dev/null +++ b/src/views/modals/rename-room.tpl @@ -0,0 +1,4 @@ + +

+ [[modules:chat.rename-help]] +

\ No newline at end of file diff --git a/src/views/modals/upload-file.tpl b/src/views/modals/upload-file.tpl new file mode 100644 index 0000000000..6f46f54d6a --- /dev/null +++ b/src/views/modals/upload-file.tpl @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/src/views/modals/upload-picture-from-url.tpl b/src/views/modals/upload-picture-from-url.tpl new file mode 100644 index 0000000000..0de3317aa4 --- /dev/null +++ b/src/views/modals/upload-picture-from-url.tpl @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/src/views/modals/votes.tpl b/src/views/modals/votes.tpl new file mode 100644 index 0000000000..e38fa3e374 --- /dev/null +++ b/src/views/modals/votes.tpl @@ -0,0 +1,10 @@ +

[[global:upvoters]] ({upvoteCount})

+{{{each upvoters}}} +{buildAvatar(upvoters, "24px", true)} +{{{end}}} + +

[[global:downvoters]] ({downvoteCount})

+{{{each downvoters}}} +{buildAvatar(downvoters, "24px", true)} +{{{end}}} + diff --git a/src/views/partials/chats/manage-room-users.tpl b/src/views/partials/chats/manage-room-users.tpl new file mode 100644 index 0000000000..f8808587bd --- /dev/null +++ b/src/views/partials/chats/manage-room-users.tpl @@ -0,0 +1,7 @@ +{{{ each users }}} +
  • + {{{ if ./canKick }}}{{{ end }}} + {buildAvatar(users, "24px", true)} + {../username} {{{ if ./isOwner }}}{{{ end }}} +
  • +{{{ end }}} \ No newline at end of file