From a3c2ef408408e44898caf15b3c0cfa1f634538b6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 2 Oct 2017 12:11:52 +0200 Subject: wiki: show save button and commit input field in all tabs if there is unsaved content. fix #853 --- view/tpl/wiki.tpl | 62 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 25 deletions(-) (limited to 'view/tpl') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 70a13806d..3047dbb80 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -1,7 +1,7 @@ -
+
- [{{$typename}}]  + [{{$typename}}]  {{if $showPageControls}} {{/if}} - {{if $showPageControls}} -
-
-
- -
- -
-
-
-
- {{/if}}
@@ -74,6 +62,16 @@
+ {{if $showPageControls}} + + {{/if}}
@@ -106,6 +104,7 @@ window.wiki_page_name = '{{$page}}'; window.wiki_page_content = '{{$content|escape:'javascript'}}'; window.wiki_page_commit = '{{$commit}}'; + window.saved = true; $("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary'); $("#generic-modal-ok-{{$wikiModalID}}").addClass('btn-danger'); @@ -174,10 +173,16 @@ adjustInlineEditorHeight(); } }, 500); // Return the focus to the editor allowing immediate text entry - $('#page-tools').show(); + $('#page-tools, #id_{{$commitMsg.0}}_wrapper').show(); }); $('#wiki-get-preview').click(function (ev) { + if(window.saved) { + $('#page-tools, #id_{{$commitMsg.0}}_wrapper').hide(); + } + else { + $('#page-tools').hide(); + } $.post("wiki/{{$channel_address}}/preview", { {{if !$mimeType || $mimeType == 'text/markdown'}} content: editor.getValue(), @@ -188,24 +193,28 @@ mimetype: '{{$mimeType}}' }, function (data) { - if (data.success) { - $('#wiki-preview').html(data.html); - {{if !$mimeType || $mimeType == 'text/markdown'}} - $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); - {{/if}} - $('#page-tools').hide(); - } else { - window.console.log('Error previewing page.'); - } + if (data.success) { + $('#wiki-preview').html(data.html); + {{if !$mimeType || $mimeType == 'text/markdown'}} + $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); + {{/if}} + } else { + window.console.log('Error previewing page.'); + } }, 'json'); ev.preventDefault(); }); $('#wiki-get-history').click(function (ev) { + if(window.saved) { + $('#page-tools, #id_{{$commitMsg.0}}_wrapper').hide(); + } + else { + $('#page-tools').hide(); + } $.post("wiki/{{$channel_address}}/history/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) { if (data.success) { $('#page-history-list').html(data.historyHTML); - $('#page-tools').hide(); } else { window.console.log('Error getting page history.'); } @@ -254,6 +263,7 @@ }, function (data) { if (data.success) { + window.saved = true; window.console.log('Page saved successfully.'); window.wiki_page_content = currentContent; $('#id_commitMsg').val(''); // Clear the commit message box @@ -446,6 +456,7 @@ {{if !$mimeType || $mimeType == 'text/markdown'}} $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); window.editor.on("input", function() { + window.saved = false; if(window.editor.getSession().getUndoManager().isClean()) { $('#save-page').addClass('disabled'); } else { @@ -454,6 +465,7 @@ }); {{else}} window.editor.on("input", function() { + window.saved = false; $('#save-page').removeClass('disabled'); }); {{if $mimeType == 'text/bbcode'}} -- cgit v1.2.3 From 1f8b705a6a35545c281f5bf1d4a2c66404e58343 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 2 Oct 2017 12:16:53 +0200 Subject: whitespace --- view/tpl/wiki.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'view/tpl') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 3047dbb80..22480be5b 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -218,9 +218,9 @@ } else { window.console.log('Error getting page history.'); } - }, 'json'); - ev.preventDefault(); - }); + }, 'json'); + ev.preventDefault(); + }); function wiki_refresh_page_list() { if (window.wiki_resource_id === '') { -- cgit v1.2.3 From 66511d8f078cebdbad34bf1b40097159c2335bf4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 3 Oct 2017 10:53:08 +0200 Subject: move common connections widget to left aside --- view/tpl/remote_friends_common.tpl | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'view/tpl') diff --git a/view/tpl/remote_friends_common.tpl b/view/tpl/remote_friends_common.tpl index 7ec1a2e6b..9e149b574 100755 --- a/view/tpl/remote_friends_common.tpl +++ b/view/tpl/remote_friends_common.tpl @@ -1,28 +1,16 @@
-
- -
- {{if $items}} - {{foreach $items as $item}} -
-
- - {{$item.xchan_name}} - -
-
- -
-
- {{/foreach}} - {{/if}} -
- {{if $linkmore}}{{/if}} +

{{$desc}}

+ {{if $linkmore}} + {{$more}} + {{/if}} + {{if $items}} +
+ {{foreach $items as $item}} +
+ {{$item.xchan_name}}
+ {{/foreach}}
-
+ {{/if}} +
-- cgit v1.2.3 From fa93114804801bceabea06570e8eee602167600a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 3 Oct 2017 11:37:45 +0200 Subject: some basic work on mod common --- view/tpl/common_friends.tpl | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'view/tpl') diff --git a/view/tpl/common_friends.tpl b/view/tpl/common_friends.tpl index fa2cf5a13..b99075210 100755 --- a/view/tpl/common_friends.tpl +++ b/view/tpl/common_friends.tpl @@ -1,15 +1,17 @@
-
- - {{$name}} - +
+

{{$title}}

-
-
- {{$name}} +
+ {{foreach $items as $item}} +
+ + {{$item.name}} + +
+ {{$item.name}} +
+
+ {{/foreach}}
- {{if $note}} -
{{$note}}
- {{/if}} -
-- cgit v1.2.3 From 295ed07d40ea330ef438d9cad8fe3af8fd265507 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 4 Oct 2017 13:37:17 +0200 Subject: bring back notifications for account approvals --- view/tpl/nav.tpl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'view/tpl') diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 72860aebe..0d0b0b600 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -128,7 +128,7 @@ {{/if}} {{if $nav.intros}}
{{/if}} + {{if $nav.registrations}} + + {{/if}} {{if $nav.notifications}}
{{/if}} + {{if $nav.files}} + + {{/if}} {{if $nav.login && !$userinfo}} {{/if}} - {{if $nav.files}} - - {{/if}} + {{if $nav.pubs}}