diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 28382c8b67e67d6c3e6d50872f03a8941e60d08c..35e73d3f4a62960172aca9112a76d182fb33b268 100644
Binary files a/apps/comments/js/commentstabview.js and b/apps/comments/js/commentstabview.js differ
diff --git a/apps/comments/js/merged.json b/apps/comments/js/merged.json
index d5b2b88233433192b77ca0f4bac3d526bfa6ce23..8f40b5621a66703b7ec83ff0dd9158857c67b2a0 100644
--- a/apps/comments/js/merged.json
+++ b/apps/comments/js/merged.json
@@ -1,5 +1,6 @@
 [
   "app.js",
+  "templates.js",
   "commentmodel.js",
   "commentcollection.js",
   "commentsummarymodel.js",
diff --git a/apps/comments/js/templates.js b/apps/comments/js/templates.js
new file mode 100644
index 0000000000000000000000000000000000000000..90ded7fe4e5f00dd6aa1310c34dc7540bc10a5d3
Binary files /dev/null and b/apps/comments/js/templates.js differ
diff --git a/apps/comments/js/templates/comment.handlebars b/apps/comments/js/templates/comment.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..c1a1091a4e0c61df4669f6b9e4a5dfb47b0c15d8
--- /dev/null
+++ b/apps/comments/js/templates/comment.handlebars
@@ -0,0 +1,15 @@
+<li class="comment{{#if isUnread}} unread{{/if}}{{#if isLong}} collapsed{{/if}}" data-id="{{id}}">
+	<div class="authorRow">
+		<div class="avatar{{#if isUserAuthor}} currentUser{{/if}}" {{#if actorId}}data-username="{{actorId}}"{{/if}}> </div>
+		<div class="author{{#if isUserAuthor}} currentUser{{/if}}">{{actorDisplayName}}</div>
+		{{#if isUserAuthor}}
+			<a href="#" class="action more icon icon-more has-tooltip"></a>
+			<div class="deleteLoading icon-loading-small hidden"></div>
+		{{/if}}
+		<div class="date has-tooltip live-relative-timestamp" data-timestamp="{{timestamp}}" title="{{altDate}}">{{date}}</div>
+	</div>
+	<div class="message">{{{formattedMessage}}}</div>
+	{{#if isLong}}
+		<div class="message-overlay"></div>
+	{{/if}}
+</li>
diff --git a/apps/comments/js/templates/edit_comment.handlebars b/apps/comments/js/templates/edit_comment.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..05f89ec598a679286d3421d0b0906635acc666e3
--- /dev/null
+++ b/apps/comments/js/templates/edit_comment.handlebars
@@ -0,0 +1,16 @@
+<{{tag}} class="newCommentRow comment" data-id="{{id}}">
+	<div class="authorRow">
+		<div class="avatar currentUser" data-username="{{actorId}}"></div>
+		<div class="author currentUser">{{actorDisplayName}}</div>
+		{{#if isEditMode}}
+			<div class="action-container">
+				<a href="#" class="action cancel icon icon-close has-tooltip" title="{{cancelText}}"></a>
+			</div>
+		{{/if}}
+	</div>
+	<form class="newCommentForm">
+		<div contentEditable="true" class="message" data-placeholder="{{newMessagePlaceholder}}">{{message}}</div>
+		<input class="submit icon-confirm has-tooltip" type="submit" value="" title="{{submitText}}"/>
+		<div class="submitLoading icon-loading-small hidden"></div>'+
+	</form>
+'</{{tag}}>
diff --git a/apps/comments/js/templates/view.handlebars b/apps/comments/js/templates/view.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..5f52a42861dcfb31c0ce3e6b6e6797582f68fc88
--- /dev/null
+++ b/apps/comments/js/templates/view.handlebars
@@ -0,0 +1,6 @@
+<ul class="comments">
+</ul>
+<div class="emptycontent hidden"><div class="icon-comment"></div>
+	<p>{{emptyResultLabel}}</p></div>
+<input type="button" class="showMore hidden" value="{{moreLabel}}" name="show-more" id="show-more" />
+<div class="loading hidden" style="height: 50px"></div>'
diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js
index aed1736693a6e7746d7796d15aaba308abfb7cc4..2a5d589a73098582740e63c2f3e89b1ad07d6e71 100644
--- a/apps/files/js/detailsview.js
+++ b/apps/files/js/detailsview.js
@@ -9,22 +9,6 @@
  */
 
 (function() {
-	var TEMPLATE =
-		'	<div class="detailFileInfoContainer">' +
-		'	</div>' +
-		'	{{#if tabHeaders}}' +
-		'	<ul class="tabHeaders">' +
-		'		{{#each tabHeaders}}' +
-		'		<li class="tabHeader" data-tabid="{{tabId}}" tabindex="0">' +
-		'			<a href="#" tabindex="-1">{{label}}</a>' +
-		'		</li>' +
-		'		{{/each}}' +
-		'	</ul>' +
-		'	{{/if}}' +
-		'	<div class="tabsContainer">' +
-		'	</div>' +
-		'	<a class="close icon-close" href="#"><span class="hidden-visually">{{closeLabel}}</span></a>';
-
 	/**
 	 * @class OCA.Files.DetailsView
 	 * @classdesc
@@ -37,8 +21,6 @@
 		tabName: 'div',
 		className: 'detailsView scroll-container',
 
-		_template: null,
-
 		/**
 		 * List of detail tab views
 		 *
@@ -107,10 +89,7 @@
 		},
 
 		template: function(vars) {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
-			return this._template(vars);
+			return OCA.Files.Templates['detailsview'](vars);
 		},
 
 		/**
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 4fcb290ca8bc99a46717f4a33cd693a75db61d77..5af558d77ba7ab8f5d2d4e5da7975eaa8e3a8573 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -10,17 +10,6 @@
 
 (function() {
 
-	var TEMPLATE_FILE_ACTION_TRIGGER =
-		'<a class="action action-{{nameLowerCase}}" href="#" data-action="{{name}}">' +
-		'{{#if icon}}' +
-			'<img class="svg" alt="{{altText}}" src="{{icon}}" />' +
-		'{{else}}' +
-			'{{#if iconClass}}<span class="icon {{iconClass}}" />{{/if}}' +
-			'{{#unless hasDisplayName}}<span class="hidden-visually">{{altText}}</span>{{/unless}}' +
-		'{{/if}}' +
-		'{{#if displayName}}<span> {{displayName}}</span>{{/if}}' +
-		'</a>';
-
 	/**
 	 * Construct a new FileActions instance
 	 * @constructs FileActions
@@ -335,11 +324,7 @@
 		 * @param {Object} params action params
 		 */
 		_makeActionLink: function(params) {
-			if (!this._fileActionTriggerTemplate) {
-				this._fileActionTriggerTemplate = Handlebars.compile(TEMPLATE_FILE_ACTION_TRIGGER);
-			}
-
-			return $(this._fileActionTriggerTemplate(params));
+			return $(OCA.Files.Templates['file_action_trigger'](params));
 		},
 
 		/**
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index c6e603e0c94f368f515836b184b3a04a70450a28..ab3607e3db9e0d17c6e2c04e427ee280b099eb40 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -10,11 +10,6 @@
 
 (function() {
 
-	var TEMPLATE_ADDBUTTON = '<a href="#" class="button new">' +
-		'<span class="icon {{iconClass}}"></span>' +
-		'<span class="hidden-visually">{{addText}}</span>' +
-		'</a>';
-
 	/**
 	 * @class OCA.Files.FileList
 	 * @classdesc
@@ -3295,10 +3290,7 @@
 			if (!$actionsContainer.length || this.$el.find('.button.upload').length) {
 				return;
 			}
-			if (!this._addButtonTemplate) {
-				this._addButtonTemplate = Handlebars.compile(TEMPLATE_ADDBUTTON);
-			}
-			var $newButton = $(this._addButtonTemplate({
+			var $newButton = $(OCA.Files.Templates['template_addbutton']({
 				addText: t('files', 'New'),
 				iconClass: 'icon-add'
 			}));
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js
index 626ab86ded3a41f8c8cca3d58d71146fdef97940..82860780d325f0365f971f3edaaf2487fd97659e 100644
--- a/apps/files/js/mainfileinfodetailview.js
+++ b/apps/files/js/mainfileinfodetailview.js
@@ -9,29 +9,6 @@
  */
 
 (function() {
-	var TEMPLATE =
-		'<div class="thumbnailContainer"><a href="#" class="thumbnail action-default"><div class="stretcher"/></a></div>' +
-		'<div class="file-details-container">' +
-		'<div class="fileName">' +
-			'<h3 title="{{name}}" class="ellipsis">{{name}}</h3>' +
-			'<a class="permalink" href="{{permalink}}" title="{{permalinkTitle}}" data-clipboard-text="{{permalink}}">' +
-				'<span class="icon icon-clippy"></span>' +
-				'<span class="hidden-visually">{{permalinkTitle}}</span>' +
-			'</a>' +
-		'</div>' +
-		'	<div class="file-details ellipsis">' +
-		'		{{#if hasFavoriteAction}}' +
-		'		<a href="#" class="action action-favorite favorite permanent">' +
-		'			<span class="icon {{starClass}}" title="{{starAltText}}"></span>' +
-		'		</a>' +
-		'		{{/if}}' +
-		'		{{#if hasSize}}<span class="size" title="{{altSize}}">{{size}}</span>, {{/if}}<span class="date live-relative-timestamp" data-timestamp="{{timestamp}}" title="{{altDate}}">{{date}}</span>' +
-		'	</div>' +
-		'</div>' +
-		'<div class="hidden permalink-field">' +
-			'<input type="text" value="{{permalink}}" placeholder="{{permalinkTitle}}" readonly="readonly"/>' +
-		'</div>';
-
 	/**
 	 * @class OCA.Files.MainFileInfoDetailView
 	 * @classdesc
@@ -71,10 +48,7 @@
 		},
 
 		template: function(data) {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
-			return this._template(data);
+			return OCA.Files.Templates['mainfileinfodetailsview'](data);
 		},
 
 		initialize: function(options) {
diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js
index 0ad7312c985bf2d25ae43163143ac38c9f6f468d..109a2fed67e420373445275cc0cf021e30cbefae 100644
--- a/apps/files/js/newfilemenu.js
+++ b/apps/files/js/newfilemenu.js
@@ -12,24 +12,6 @@
 
 (function() {
 
-	var TEMPLATE_MENU =
-		'<ul>' +
-		'<li>' +
-		'<label for="file_upload_start" class="menuitem" data-action="upload" title="{{uploadMaxHumanFilesize}}" tabindex="0"><span class="svg icon icon-upload"></span><span class="displayname">{{uploadLabel}}</span></label>' +
-		'</li>' +
-		'{{#each items}}' +
-		'<li>' +
-		'<a href="#" class="menuitem" data-templatename="{{templateName}}" data-filetype="{{fileType}}" data-action="{{id}}"><span class="icon {{iconClass}} svg"></span><span class="displayname">{{displayName}}</span></a>' +
-		'</li>' +
-		'{{/each}}' +
-		'</ul>';
-
-	var TEMPLATE_FILENAME_FORM =
-		'<form class="filenameform">' +
-		'<input id="{{cid}}-input-{{fileType}}" type="text" value="{{fileName}}" autocomplete="off" autocapitalize="off">' +
-		'<input type="submit" value=" " class="icon-confirm" />'
-		'</form>';
-
 	/**
 	 * Construct a new NewFileMenu instance
 	 * @constructs NewFileMenu
@@ -78,10 +60,7 @@
 		},
 
 		template: function(data) {
-			if (!OCA.Files.NewFileMenu._TEMPLATE) {
-				OCA.Files.NewFileMenu._TEMPLATE = Handlebars.compile(TEMPLATE_MENU);
-			}
-			return OCA.Files.NewFileMenu._TEMPLATE(data);
+			return OCA.Files.Templates['newfilemenu'](data);
 		},
 
 		/**
@@ -111,9 +90,6 @@
 
 		_promptFileName: function($target) {
 			var self = this;
-			if (!OCA.Files.NewFileMenu._TEMPLATE_FORM) {
-				OCA.Files.NewFileMenu._TEMPLATE_FORM = Handlebars.compile(TEMPLATE_FILENAME_FORM);
-			}
 
 			if ($target.find('form').length) {
 				$target.find('input[type=\'text\']').focus();
@@ -128,7 +104,7 @@
 
 			var newName = $target.attr('data-templatename');
 			var fileType = $target.attr('data-filetype');
-			var $form = $(OCA.Files.NewFileMenu._TEMPLATE_FORM({
+			var $form = $(OCA.Files.Templates['newfilemenu_filename_form']({
 				fileName: newName,
 				cid: this.cid,
 				fileType: fileType
diff --git a/apps/files/js/tagsplugin.js b/apps/files/js/tagsplugin.js
index 4ce6604384d9ce4783c5b2f47a0c11c61a66cf92..b8e17115b4b137152e93d7f561a0218595b82010 100644
--- a/apps/files/js/tagsplugin.js
+++ b/apps/files/js/tagsplugin.js
@@ -17,13 +17,6 @@
 		PROPERTY_FAVORITE: '{' + OC.Files.Client.NS_OWNCLOUD + '}favorite'
 	});
 
-	var TEMPLATE_FAVORITE_MARK =
-		'<div ' +
-		'class="favorite-mark {{#isFavorite}}permanent{{/isFavorite}}">' +
-		'<span class="icon {{iconClass}}" />' +
-		'<span class="hidden-visually">{{altText}}</span>' +
-		'</div>';
-
 	/**
 	 * Returns the icon class for the matching state
 	 *
@@ -41,10 +34,7 @@
 	 * @return {Object} jQuery object
 	 */
 	function renderStar (state) {
-		if (!this._template) {
-			this._template = Handlebars.compile(TEMPLATE_FAVORITE_MARK);
-		}
-		return this._template({
+		return OCA.Files.Templates['favorite_mark']({
 			isFavorite: state,
 			altText: state ? t('files', 'Favorited') : t('files', 'Not favorited'),
 			iconClass: getStarIconClass(state)
diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js
index 8ada62b6d606655a759bfe602b3b45078c1820ea..1433b240700ae5c763bc9dd0df4e02a3fdf71cfa 100644
--- a/apps/files/js/templates.js
+++ b/apps/files/js/templates.js
@@ -1,5 +1,86 @@
 (function() {
   var template = Handlebars.template, templates = OCA.Files.Templates = OCA.Files.Templates || {};
+templates['detailsview'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return "<ul class=\"tabHeaders\">\n"
+    + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.tabHeaders : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "</ul>\n";
+},"2":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "	<li class=\"tabHeader\" data-tabid=\""
+    + alias4(((helper = (helper = helpers.tabId || (depth0 != null ? depth0.tabId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tabId","hash":{},"data":data}) : helper)))
+    + "\" tabindex=\"0\">\n		<a href=\"#\" tabindex=\"-1\">"
+    + alias4(((helper = (helper = helpers.label || (depth0 != null ? depth0.label : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"label","hash":{},"data":data}) : helper)))
+    + "</a>\n	</li>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});
+
+  return "<div class=\"detailFileInfoContainer\"></div>\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tabHeaders : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "<div class=\"tabsContainer\"></div>\n<a class=\"close icon-close\" href=\"#\"><span class=\"hidden-visually\">"
+    + container.escapeExpression(((helper = (helper = helpers.closeLabel || (depth0 != null ? depth0.closeLabel : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"closeLabel","hash":{},"data":data}) : helper)))
+    + "</span></a>\n";
+},"useData":true});
+templates['favorite_mark'] = template({"1":function(container,depth0,helpers,partials,data) {
+    return "permanent";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression, buffer = 
+  "<div class=\"favorite-mark ";
+  stack1 = ((helper = (helper = helpers.isFavorite || (depth0 != null ? depth0.isFavorite : depth0)) != null ? helper : alias2),(options={"name":"isFavorite","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
+  if (!helpers.isFavorite) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
+  if (stack1 != null) { buffer += stack1; }
+  return buffer + "\">\n	<span class=\"icon "
+    + alias4(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"iconClass","hash":{},"data":data}) : helper)))
+    + "\" />\n	<span class=\"hidden-visually\">"
+    + alias4(((helper = (helper = helpers.altText || (depth0 != null ? depth0.altText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"altText","hash":{},"data":data}) : helper)))
+    + "</span>\n</div>\n";
+},"useData":true});
+templates['file_action_trigger'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "		<img class=\"svg\" alt=\""
+    + alias4(((helper = (helper = helpers.altText || (depth0 != null ? depth0.altText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"altText","hash":{},"data":data}) : helper)))
+    + "\" src=\""
+    + alias4(((helper = (helper = helpers.icon || (depth0 != null ? depth0.icon : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"icon","hash":{},"data":data}) : helper)))
+    + "\" />\n";
+},"3":function(container,depth0,helpers,partials,data) {
+    var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});
+
+  return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasDisplayName : depth0),{"name":"unless","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"4":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "			<span class=\"icon "
+    + container.escapeExpression(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"iconClass","hash":{},"data":data}) : helper)))
+    + "\" />\n";
+},"6":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "			<span class=\"hidden-visually\">"
+    + container.escapeExpression(((helper = (helper = helpers.altText || (depth0 != null ? depth0.altText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"altText","hash":{},"data":data}) : helper)))
+    + "</span>\n";
+},"8":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "<span> "
+    + container.escapeExpression(((helper = (helper = helpers.displayName || (depth0 != null ? depth0.displayName : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"displayName","hash":{},"data":data}) : helper)))
+    + "</span>";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<a class=\"action action-"
+    + alias4(((helper = (helper = helpers.nameLowerCase || (depth0 != null ? depth0.nameLowerCase : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"nameLowerCase","hash":{},"data":data}) : helper)))
+    + "\" href=\"#\" data-action=\""
+    + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+    + "\">\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.icon : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
+    + "	"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.displayName : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\n</a>\n";
+},"useData":true});
 templates['filemultiselectmenu'] = template({"1":function(container,depth0,helpers,partials,data) {
     var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
 
@@ -36,4 +117,96 @@ templates['filesummary'] = template({"compiler":[7,">= 4.0.0"],"main":function(c
     + container.escapeExpression(((helper = (helper = helpers.connectorLabel || (depth0 != null ? depth0.connectorLabel : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"connectorLabel","hash":{},"data":data}) : helper)))
     + "</span>\n	<span class=\"fileinfo\"></span>\n	<span class=\"hiddeninfo\"></span>\n	<span class=\"filter\"></span>\n</span>\n";
 },"useData":true});
+templates['mainfileinfodetailsview'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "			<a href=\"#\" class=\"action action-favorite favorite permanent\">\n				<span class=\"icon "
+    + alias4(((helper = (helper = helpers.starClass || (depth0 != null ? depth0.starClass : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"starClass","hash":{},"data":data}) : helper)))
+    + "\" title=\""
+    + alias4(((helper = (helper = helpers.starAltText || (depth0 != null ? depth0.starAltText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"starAltText","hash":{},"data":data}) : helper)))
+    + "\"></span>\n			</a>\n";
+},"3":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<span class=\"size\" title=\""
+    + alias4(((helper = (helper = helpers.altSize || (depth0 != null ? depth0.altSize : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"altSize","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.size || (depth0 != null ? depth0.size : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"size","hash":{},"data":data}) : helper)))
+    + "</span>, ";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<div class=\"thumbnailContainer\"><a href=\"#\" class=\"thumbnail action-default\"><div class=\"stretcher\"/></a></div>\n<div class=\"file-details-container\">\n	<div class=\"fileName\">\n		<h3 title=\""
+    + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+    + "\" class=\"ellipsis\">"
+    + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+    + "</h3>\n		<a class=\"permalink\" href=\""
+    + alias4(((helper = (helper = helpers.permalink || (depth0 != null ? depth0.permalink : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"permalink","hash":{},"data":data}) : helper)))
+    + "\" title=\""
+    + alias4(((helper = (helper = helpers.permalinkTitle || (depth0 != null ? depth0.permalinkTitle : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"permalinkTitle","hash":{},"data":data}) : helper)))
+    + "\" data-clipboard-text=\""
+    + alias4(((helper = (helper = helpers.permalink || (depth0 != null ? depth0.permalink : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"permalink","hash":{},"data":data}) : helper)))
+    + "\">\n			<span class=\"icon icon-clippy\"></span>\n			<span class=\"hidden-visually\">"
+    + alias4(((helper = (helper = helpers.permalinkTitle || (depth0 != null ? depth0.permalinkTitle : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"permalinkTitle","hash":{},"data":data}) : helper)))
+    + "</span>\n		</a>\n	</div>\n	<div class=\"file-details ellipsis\">\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasFavoriteAction : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "		"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasSize : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "<span class=\"date live-relative-timestamp\" data-timestamp=\""
+    + alias4(((helper = (helper = helpers.timestamp || (depth0 != null ? depth0.timestamp : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"timestamp","hash":{},"data":data}) : helper)))
+    + "\" title=\""
+    + alias4(((helper = (helper = helpers.altDate || (depth0 != null ? depth0.altDate : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"altDate","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.date || (depth0 != null ? depth0.date : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"date","hash":{},"data":data}) : helper)))
+    + "</span>\n	</div>\n</div>\n<div class=\"hidden permalink-field\">\n	<input type=\"text\" value=\""
+    + alias4(((helper = (helper = helpers.permalink || (depth0 != null ? depth0.permalink : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"permalink","hash":{},"data":data}) : helper)))
+    + "\" placeholder=\""
+    + alias4(((helper = (helper = helpers.permalinkTitle || (depth0 != null ? depth0.permalinkTitle : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"permalinkTitle","hash":{},"data":data}) : helper)))
+    + "\" readonly=\"readonly\"/>\n</div>\n";
+},"useData":true});
+templates['newfilemenu'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "		<li>\n			<a href=\"#\" class=\"menuitem\" data-templatename=\""
+    + alias4(((helper = (helper = helpers.templateName || (depth0 != null ? depth0.templateName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"templateName","hash":{},"data":data}) : helper)))
+    + "\" data-filetype=\""
+    + alias4(((helper = (helper = helpers.fileType || (depth0 != null ? depth0.fileType : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"fileType","hash":{},"data":data}) : helper)))
+    + "\" data-action=\""
+    + alias4(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data}) : helper)))
+    + "\"><span class=\"icon "
+    + alias4(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"iconClass","hash":{},"data":data}) : helper)))
+    + " svg\"></span><span class=\"displayname\">"
+    + alias4(((helper = (helper = helpers.displayName || (depth0 != null ? depth0.displayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data}) : helper)))
+    + "</span></a>\n		</li>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<ul>\n	<li>\n		<label for=\"file_upload_start\" class=\"menuitem\" data-action=\"upload\" title=\""
+    + alias4(((helper = (helper = helpers.uploadMaxHumanFilesize || (depth0 != null ? depth0.uploadMaxHumanFilesize : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"uploadMaxHumanFilesize","hash":{},"data":data}) : helper)))
+    + "\" tabindex=\"0\"><span class=\"svg icon icon-upload\"></span><span class=\"displayname\">"
+    + alias4(((helper = (helper = helpers.uploadLabel || (depth0 != null ? depth0.uploadLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"uploadLabel","hash":{},"data":data}) : helper)))
+    + "</span></label>\n	</li>\n"
+    + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.items : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "</ul>\n";
+},"useData":true});
+templates['newfilemenu_filename_form'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<form class=\"filenameform\">\n	<input id=\""
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-input-"
+    + alias4(((helper = (helper = helpers.fileType || (depth0 != null ? depth0.fileType : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"fileType","hash":{},"data":data}) : helper)))
+    + "\" type=\"text\" value=\""
+    + alias4(((helper = (helper = helpers.fileName || (depth0 != null ? depth0.fileName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"fileName","hash":{},"data":data}) : helper)))
+    + "\" autocomplete=\"off\" autocapitalize=\"off\">\n	<input type=\"submit\" value=\" \" class=\"icon-confirm\" />'\n</form>\n";
+},"useData":true});
+templates['template_addbutton'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<a href=\"#\" class=\"button new\">\n	<span class=\"icon "
+    + alias4(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"iconClass","hash":{},"data":data}) : helper)))
+    + "\"></span>\n	<span class=\"hidden-visually\">"
+    + alias4(((helper = (helper = helpers.addText || (depth0 != null ? depth0.addText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addText","hash":{},"data":data}) : helper)))
+    + "</span>\n</a>\n";
+},"useData":true});
 })();
\ No newline at end of file
diff --git a/apps/files/js/templates/detailsview.handlebars b/apps/files/js/templates/detailsview.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..841a8fe25fe45a79ce2003eb5fb39c141d964c32
--- /dev/null
+++ b/apps/files/js/templates/detailsview.handlebars
@@ -0,0 +1,12 @@
+<div class="detailFileInfoContainer"></div>
+{{#if tabHeaders}}
+<ul class="tabHeaders">
+	{{#each tabHeaders}}
+	<li class="tabHeader" data-tabid="{{tabId}}" tabindex="0">
+		<a href="#" tabindex="-1">{{label}}</a>
+	</li>
+	{{/each}}
+</ul>
+{{/if}}
+<div class="tabsContainer"></div>
+<a class="close icon-close" href="#"><span class="hidden-visually">{{closeLabel}}</span></a>
diff --git a/apps/files/js/templates/favorite_mark.handlebars b/apps/files/js/templates/favorite_mark.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..7e0cb4385a85de7dad218d791153872a4b73d44d
--- /dev/null
+++ b/apps/files/js/templates/favorite_mark.handlebars
@@ -0,0 +1,4 @@
+<div class="favorite-mark {{#isFavorite}}permanent{{/isFavorite}}">
+	<span class="icon {{iconClass}}" />
+	<span class="hidden-visually">{{altText}}</span>
+</div>
diff --git a/apps/files/js/templates/file_action_trigger.handlebars b/apps/files/js/templates/file_action_trigger.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..d7112ee2b2f2a157e24f0ec5409c72365224dfc3
--- /dev/null
+++ b/apps/files/js/templates/file_action_trigger.handlebars
@@ -0,0 +1,13 @@
+<a class="action action-{{nameLowerCase}}" href="#" data-action="{{name}}">
+	{{#if icon}}
+		<img class="svg" alt="{{altText}}" src="{{icon}}" />
+	{{else}}
+		{{#if iconClass}}
+			<span class="icon {{iconClass}}" />
+		{{/if}}
+		{{#unless hasDisplayName}}
+			<span class="hidden-visually">{{altText}}</span>
+		{{/unless}}
+	{{/if}}
+	{{#if displayName}}<span> {{displayName}}</span>{{/if}}
+</a>
diff --git a/apps/files/js/templates/mainfileinfodetailsview.handlebars b/apps/files/js/templates/mainfileinfodetailsview.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..02a4cdb64161a07f4ab104d37ebccd60785395b4
--- /dev/null
+++ b/apps/files/js/templates/mainfileinfodetailsview.handlebars
@@ -0,0 +1,21 @@
+<div class="thumbnailContainer"><a href="#" class="thumbnail action-default"><div class="stretcher"/></a></div>
+<div class="file-details-container">
+	<div class="fileName">
+		<h3 title="{{name}}" class="ellipsis">{{name}}</h3>
+		<a class="permalink" href="{{permalink}}" title="{{permalinkTitle}}" data-clipboard-text="{{permalink}}">
+			<span class="icon icon-clippy"></span>
+			<span class="hidden-visually">{{permalinkTitle}}</span>
+		</a>
+	</div>
+	<div class="file-details ellipsis">
+		{{#if hasFavoriteAction}}
+			<a href="#" class="action action-favorite favorite permanent">
+				<span class="icon {{starClass}}" title="{{starAltText}}"></span>
+			</a>
+		{{/if}}
+		{{#if hasSize}}<span class="size" title="{{altSize}}">{{size}}</span>, {{/if}}<span class="date live-relative-timestamp" data-timestamp="{{timestamp}}" title="{{altDate}}">{{date}}</span>
+	</div>
+</div>
+<div class="hidden permalink-field">
+	<input type="text" value="{{permalink}}" placeholder="{{permalinkTitle}}" readonly="readonly"/>
+</div>
diff --git a/apps/files/js/templates/newfilemenu.handlebars b/apps/files/js/templates/newfilemenu.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..0d9ad9682caf8a960f65f05b234442fc5d3fdfff
--- /dev/null
+++ b/apps/files/js/templates/newfilemenu.handlebars
@@ -0,0 +1,10 @@
+<ul>
+	<li>
+		<label for="file_upload_start" class="menuitem" data-action="upload" title="{{uploadMaxHumanFilesize}}" tabindex="0"><span class="svg icon icon-upload"></span><span class="displayname">{{uploadLabel}}</span></label>
+	</li>
+	{{#each items}}
+		<li>
+			<a href="#" class="menuitem" data-templatename="{{templateName}}" data-filetype="{{fileType}}" data-action="{{id}}"><span class="icon {{iconClass}} svg"></span><span class="displayname">{{displayName}}</span></a>
+		</li>
+	{{/each}}
+</ul>
diff --git a/apps/files/js/templates/newfilemenu_filename_form.handlebars b/apps/files/js/templates/newfilemenu_filename_form.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..cf18b28cad28f469bf40a4781a56fd462637da9e
--- /dev/null
+++ b/apps/files/js/templates/newfilemenu_filename_form.handlebars
@@ -0,0 +1,4 @@
+<form class="filenameform">
+	<input id="{{cid}}-input-{{fileType}}" type="text" value="{{fileName}}" autocomplete="off" autocapitalize="off">
+	<input type="submit" value=" " class="icon-confirm" />'
+</form>
diff --git a/apps/files/js/templates/template_addbutton.handlebars b/apps/files/js/templates/template_addbutton.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..62a022715a92647fe6ab747ac70da5eed1906264
--- /dev/null
+++ b/apps/files/js/templates/template_addbutton.handlebars
@@ -0,0 +1,4 @@
+<a href="#" class="button new">
+	<span class="icon {{iconClass}}"></span>
+	<span class="hidden-visually">{{addText}}</span>
+</a>
diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js
index 7bb1f1229d09de6ca5988e5e5196172fdbde03ad..fc7f2c5f0451bc09460f17bca4fdec0e2d60be68 100644
--- a/apps/files_sharing/js/sharetabview.js
+++ b/apps/files_sharing/js/sharetabview.js
@@ -25,10 +25,7 @@
 		className: 'tab shareTabView',
 
 		template: function(params) {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
-			return this._template(params);
+			return 	TEMPLATE;
 		},
 
 		getLabel: function() {
diff --git a/apps/files_versions/js/merged.json b/apps/files_versions/js/merged.json
index 1a7fbad298b6d4dbc2abb1dee1ef932f080b99ff..67ee60b38516e1bc6010bfc6cda87e92656bddfb 100644
--- a/apps/files_versions/js/merged.json
+++ b/apps/files_versions/js/merged.json
@@ -1,5 +1,6 @@
 [
   "versionmodel.js",
+  "templates.js",
   "versioncollection.js",
   "versionstabview.js",
   "filesplugin.js"
diff --git a/apps/files_versions/js/templates.js b/apps/files_versions/js/templates.js
new file mode 100644
index 0000000000000000000000000000000000000000..17293d763dffa0959f3ced5627614ecc22c9f051
Binary files /dev/null and b/apps/files_versions/js/templates.js differ
diff --git a/apps/files_versions/js/templates/item.handlebars b/apps/files_versions/js/templates/item.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..6d11b9c088846040a28d7920aa80d9c3427d2f4e
--- /dev/null
+++ b/apps/files_versions/js/templates/item.handlebars
@@ -0,0 +1,22 @@
+<li data-revision="{{timestamp}}">
+	<div>
+		<div class="preview-container">
+			<img class="preview" src="{{previewUrl}}" width="44" height="44"/>
+		</div>
+		<div class="version-container">
+			<div>
+				<a href="{{downloadUrl}}" class="downloadVersion"><img src="{{downloadIconUrl}}" />
+					<span class="versiondate has-tooltip live-relative-timestamp" data-timestamp="{{millisecondsTimestamp}}" title="{{formattedTimestamp}}">{{relativeTimestamp}}</span>
+				</a>
+			</div>
+			{{#hasDetails}}
+				<div class="version-details">
+					<span class="size has-tooltip" title="{{altSize}}">{{humanReadableSize}}</span>
+				</div>
+			{{/hasDetails}}
+		</div>
+		{{#canRevert}}
+			<a href="#" class="revertVersion" title="{{revertLabel}}"><img src="{{revertIconUrl}}" /></a>
+		{{/canRevert}}
+	</div>
+</li>
diff --git a/apps/files_versions/js/templates/template.handlebars b/apps/files_versions/js/templates/template.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..f01a6f416266f35fb8490daf7ce3be799dd6b3ec
--- /dev/null
+++ b/apps/files_versions/js/templates/template.handlebars
@@ -0,0 +1,10 @@
+<ul class="versions"></ul>
+<div class="clear-float"></div>
+<div class="empty hidden">
+	<div class="emptycontent">
+		<div class="icon-history"></div>
+		<p>{{emptyResultLabel}}</p>
+	</div>
+</div>
+<input type="button" class="showMoreVersions hidden" value="{{moreVersionsLabel}}" name="show-more-versions" id="show-more-versions" />
+<div class="loading hidden" style="height: 50px"></div>
diff --git a/apps/files_versions/js/versionstabview.js b/apps/files_versions/js/versionstabview.js
index 3a9026901ea83b458eeb38c0f84187b664493e64..dacd567fdc99010ba069ae6e3f48a97adb685872 100644
Binary files a/apps/files_versions/js/versionstabview.js and b/apps/files_versions/js/versionstabview.js differ
diff --git a/apps/systemtags/js/systemtagsinfoviewtoggleview.js b/apps/systemtags/js/systemtagsinfoviewtoggleview.js
index 13a48e49cfb0716a6bf43d2b7629a125e88df78e..a3261e7994d22d5a9a3d5d5c8ce8fe517558afc4 100644
--- a/apps/systemtags/js/systemtagsinfoviewtoggleview.js
+++ b/apps/systemtags/js/systemtagsinfoviewtoggleview.js
@@ -21,9 +21,6 @@
 
 (function(OCA) {
 
-	var TEMPLATE =
-		'<span class="icon icon-tag"/>' + t('systemtags', 'Tags');
-
 	/**
 	 * @class OCA.SystemTags.SystemTagsInfoViewToggleView
 	 * @classdesc
@@ -49,10 +46,7 @@
 		_systemTagsInfoView: null,
 
 		template: function(data) {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
-			return this._template(data);
+			return '<span class="icon icon-tag"/>' + t('systemtags', 'Tags');
 		},
 
 		/**
diff --git a/build/compile-handlebars-templates.sh b/build/compile-handlebars-templates.sh
index 585406c4e8f5a99a1a7138fd8583b2bb9936c380..2f83dd3956ac12bfd891dc7817342853228ca0a8 100755
--- a/build/compile-handlebars-templates.sh
+++ b/build/compile-handlebars-templates.sh
@@ -10,9 +10,22 @@ handlebars -n OC.Settings.Templates  settings/js/authtoken.handlebars -f setting
 # Contactsmenu
 handlebars -n OC.ContactsMenu.Templates core/js/contactsmenu -f core/js/contactsmenu_templates.js
 
+# Systemtags
+handlebars -n OC.SystemTags.Templates core/js/systemtags/templates -f core/js/systemtags/templates.js
+
+# Share
+handlebars -n OC.Share.Templates core/js/share -f core/js/sharetemplates.js
+
 # Files app
 handlebars -n OCA.Files.Templates apps/files/js/templates -f apps/files/js/templates.js
 
+# Comments app
+handlebars -n OCA.Comments.Templates apps/comments/js/templates -f apps/comments/js/templates.js
+
+# Versions app
+handlebars -n OCA.Versions.Templates apps/files_versions/js/templates -f apps/files_versions/js/templates.js
+
+
 if [[ $(git diff --name-only) ]]; then
     echo "Please submit your compiled handlebars templates"
     echo
diff --git a/core/js/core.json b/core/js/core.json
index 19f361d2dfeed06deb5207a7e3b02abf7429b52f..12249d4dbafa0481e13e55318e9bae8630f70387 100644
--- a/core/js/core.json
+++ b/core/js/core.json
@@ -33,6 +33,7 @@
 		"l10n.js",
 		"apps.js",
 		"share.js",
+		"sharetemplates.js",
 		"sharesocialmanager.js",
 		"shareconfigmodel.js",
 		"shareitemmodel.js",
@@ -58,6 +59,7 @@
 		"files/fileinfo.js",
 		"files/client.js",
 		"systemtags/systemtags.js",
+		"systemtags/templates.js",
 		"systemtags/systemtagmodel.js",
 		"systemtags/systemtagscollection.js",
 		"systemtags/systemtagsmappingcollection.js",
diff --git a/core/js/merged-share-backend.json b/core/js/merged-share-backend.json
index 63c3575a6660dbf55e16bbdb14baccbe750f63a3..8d67d9309cd38df3488c639004ba654330345bad 100644
--- a/core/js/merged-share-backend.json
+++ b/core/js/merged-share-backend.json
@@ -1,5 +1,6 @@
 [
 	"shareconfigmodel.js",
+	"sharetemplates.js",
 	"shareitemmodel.js",
 	"sharesocialmanager.js",
 	"sharedialogresharerinfoview.js",
diff --git a/core/js/share/sharedialoglinkshareview.handlebars b/core/js/share/sharedialoglinkshareview.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..e0787cc7d3bceaf469b44a7ecbdc0ce3079d6473
--- /dev/null
+++ b/core/js/share/sharedialoglinkshareview.handlebars
@@ -0,0 +1,25 @@
+{{#if shareAllowed}}
+<ul id="shareLink" class="shareWithList">
+	<li data-share-id="{{cid}}">
+		<div class="avatar icon-public-white"></div><span class="username" title="{{linkShareLabel}}">{{linkShareLabel}}</span>
+		<span class="sharingOptionsGroup">
+			<span class="shareOption">
+				<span class="icon-loading-small hidden"></span>
+				<input id="linkCheckbox-{{cid}}" {{#if isLinkShare}}checked="checked"{{/if}} type="checkbox" name="linkCheckbox" class="linkCheckbox permissions checkbox">
+				<label for="linkCheckbox-{{cid}}">{{linkShareEnableLabel}}</label>
+			</span>
+			{{#if showMenu}}
+				<div class="share-menu" tabindex="0"><span class="icon icon-more"></span>
+					{{#if showPending}}
+						{{{pendingPopoverMenu}}}
+					{{else}}
+						{{{popoverMenu}}}
+					{{/if}}
+				</div>
+			{{/if}}
+		</span>
+	</li>
+</ul>
+{{else}}
+{{#if noSharingPlaceholder}}<input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{noSharingPlaceholder}}" disabled="disabled"/>{{/if}}
+{{/if}}'
diff --git a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..412ed8efca0f433351fdbf395899c62655e13640
--- /dev/null
+++ b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars
@@ -0,0 +1,96 @@
+<div class="popovermenu menu">
+	<ul>
+		<li>
+			<a href="#" class="menuitem clipboardButton" data-clipboard-text="{{shareLinkURL}}">
+				<span class="icon icon-clippy" ></span>
+				<span>{{copyLabel}}</span>
+			</a>
+		</li>
+		<li class="hidden linkTextMenu">
+			<span class="menuitem icon-link-text">
+				<input id="linkText-{{cid}}" class="linkText" type="text" readonly="readonly" value="{{shareLinkURL}}" />
+			</span>
+		</li>
+		{{#if publicUpload}}
+			<li>
+				<span class="shareOption menuitem">
+					<span class="icon-loading-small hidden"></span>
+					<input type="radio" name="publicUpload" value="{{publicUploadRValue}}" id="sharingDialogAllowPublicUpload-r-{{cid}}" class="radio publicUploadRadio" {{{publicUploadRChecked}}} />
+					<label for="sharingDialogAllowPublicUpload-r-{{cid}}">{{publicUploadRLabel}}</label>
+				</span>
+			</li>
+			<li>
+				<span class="shareOption menuitem">
+					<span class="icon-loading-small hidden"></span>
+					<input type="radio" name="publicUpload" value="{{publicUploadRWValue}}" id="sharingDialogAllowPublicUpload-rw-{{cid}}" class="radio publicUploadRadio" {{{publicUploadRWChecked}}} />
+					<label for="sharingDialogAllowPublicUpload-rw-{{cid}}">{{publicUploadRWLabel}}</label>
+				</span></li>
+			<li>
+				<span class="shareOption menuitem">
+					<span class="icon-loading-small hidden"></span>
+					<input type="radio" name="publicUpload" value="{{publicUploadWValue}}" id="sharingDialogAllowPublicUpload-w-{{cid}}" class="radio publicUploadRadio" {{{publicUploadWChecked}}} />
+					<label for="sharingDialogAllowPublicUpload-w-{{cid}}">{{publicUploadWLabel}}</label>
+				</span>
+			</li>
+		{{/if}}
+		{{#if publicEditing}}
+			<li id="allowPublicEditingWrapper">
+				<span class="shareOption menuitem">
+					<span class="icon-loading-small hidden"></span>
+					<input type="checkbox" name="allowPublicEditing" id="sharingDialogAllowPublicEditing-{{cid}}" class="checkbox publicEditingCheckbox" {{{publicEditingChecked}}} />
+					<label for="sharingDialogAllowPublicEditing-{{cid}}">{{publicEditingLabel}}</label>
+				</span>
+			</li>
+		{{/if}}
+		{{#if showPasswordCheckBox}}
+			<li>
+				<span class="shareOption menuitem">
+					<input type="checkbox" name="showPassword" id="showPassword-{{cid}}" class="checkbox showPasswordCheckbox"
+					{{#if isPasswordSet}}checked="checked"{{/if}} {{#if isPasswordEnforced}}disabled="disabled"{{/if}} value="1" />
+					<label for="showPassword-{{cid}}">{{enablePasswordLabel}}</label>
+				</span>
+			</li>
+			<li class="{{#unless isPasswordSet}}hidden{{/unless}} linkPassMenu">
+				<span class="shareOption menuitem icon-share-pass">
+					<input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" autocomplete="new-password" />
+					<span class="icon icon-loading-small hidden"></span>
+				</span>
+			</li>
+		{{/if}}
+		<li>
+			<span class="shareOption menuitem">
+				<input id="expireDate-{{cid}}" type="checkbox" name="expirationDate" class="expireDate checkbox"
+				{{#if hasExpireDate}}checked="checked"{{/if}} {{#if isExpirationEnforced}}disabled="disabled"{{/if}}" />
+				<label for="expireDate-{{cid}}">{{expireDateLabel}}</label>
+			</span>
+		</li>
+		<li class="{{#unless hasExpireDate}}hidden{{/unless}}">
+			<span class="menuitem icon-expiredate expirationDateContainer-{{cid}}">
+				<label for="expirationDatePicker-{{cid}}" class="hidden-visually" value="{{expirationDate}}">{{expirationLabel}}</label>
+				<input id="expirationDatePicker-{{cid}}" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{#if hasExpireDate}}{{expireDate}}{{else}}{{defaultExpireDate}}{{/if}}" />
+			</span>
+			</li>
+		<li>
+			<a href="#" class="share-add">
+				<span class="icon-loading-small hidden"></span>
+				<span class="icon icon-edit"></span>
+				<span>{{addNoteLabel}}</span>
+				<input type="button" class="share-note-delete icon-delete">
+			</a>
+		</li>
+		<li class="share-note-form share-note-link hidden">
+			<span class="menuitem icon-note">
+				<textarea class="share-note">{{shareNote}}</textarea>
+				<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" />
+				</span>
+		</li>
+		{{#each social}}
+			<li>
+				<a href="#" class="shareOption menuitem pop-up" data-url="{{url}}" data-window="{{newWindow}}">
+					<span class="icon {{iconClass}}"></span>
+					<span>{{label}}</span>
+				</a>
+			</li>
+		{{/each}}
+	</ul>
+</div>
diff --git a/core/js/share/sharedialoglinkshareview_popover_menu_pending.handlebars b/core/js/share/sharedialoglinkshareview_popover_menu_pending.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..e39c082315ba320ca408d5f133c0e600fd0427d8
--- /dev/null
+++ b/core/js/share/sharedialoglinkshareview_popover_menu_pending.handlebars
@@ -0,0 +1,14 @@
+<div class="popovermenu pendingpopover menu">
+	<ul>
+		{{#if isPasswordEnforced}}
+			<li><span class="shareOption menuitem">
+				<input type="checkbox" name="showPassword" id="showPassword-{{cid}}" checked="checked" disabled class="checkbox showPasswordCheckbox" value="1" />
+				<label for="showPassword-{{cid}}">{{enablePasswordLabel}}</label>
+			</span></li>
+			<li class="linkPassMenu"><span class="shareOption menuitem icon-share-pass">
+				<input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" autocomplete="new-password" />
+				<span class="icon icon-loading-small hidden"></span>
+			</span></li>
+		{{/if}}
+	</ul>
+</div>
diff --git a/core/js/share/sharedialogresharerinfoview.handlebars b/core/js/share/sharedialogresharerinfoview.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..e2cfa13da965cda78087da42101f62dc0b1dd66c
--- /dev/null
+++ b/core/js/share/sharedialogresharerinfoview.handlebars
@@ -0,0 +1,5 @@
+<span class="reshare">
+	<div class="avatar" data-userName="{{reshareOwner}}"></div>
+	{{sharedByText}}
+</span>' +
+{{#if hasShareNote}}<div class="share-note">{{shareNote}}</div>{{/if}}
diff --git a/core/js/share/sharedialogshareelistview.handlebars b/core/js/share/sharedialogshareelistview.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..ba9aa6e510a81bfda85ab9e220d3b975a7dd36e3
--- /dev/null
+++ b/core/js/share/sharedialogshareelistview.handlebars
@@ -0,0 +1,28 @@
+<ul id="shareWithList" class="shareWithList">
+	{{#each sharees}}
+		<li data-share-id="{{shareId}}" data-share-type="{{shareType}}" data-share-with="{{shareWith}}">
+			<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" data-avatar="{{shareWithAvatar}}" data-displayname="{{shareWithDisplayName}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>
+			<span class="username" title="{{shareWithTitle}}">{{shareWithDisplayName}}</span>
+			<span class="sharingOptionsGroup">
+				{{#if editPermissionPossible}}
+					<span class="shareOption">
+						<input id="canEdit-{{cid}}-{{shareId}}" type="checkbox" name="edit" class="permissions checkbox" />
+						<label for="canEdit-{{cid}}-{{shareId}}">{{canEditLabel}}</label>
+					</span>
+				{{/if}}
+				<div tabindex="0" class="share-menu"><span class="icon icon-more"></span>
+					{{{popoverMenu}}}
+				</div>
+			</span>
+		</li>
+		{{/each}}
+	{{#each linkReshares}}
+		<li data-share-id="{{shareId}}" data-share-type="{{shareType}}">
+			<div class="avatar" data-username="{{shareInitiator}}"></div>
+			<span class="has-tooltip username" title="{{shareInitiator}}"> t('core', '{{shareInitiatorDisplayName}} shared via link') + '</span>
+			<span class="sharingOptionsGroup">
+				<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">{{unshareLabel}}</span></a>
+			</span>
+		</li>
+	{{/each}}
+</ul>
diff --git a/core/js/share/sharedialogshareelistview_popover_menu.handlebars b/core/js/share/sharedialogshareelistview_popover_menu.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..c135d31b0814456c4f691d33135227e150b8152f
--- /dev/null
+++ b/core/js/share/sharedialogshareelistview_popover_menu.handlebars
@@ -0,0 +1,106 @@
+<div class="popovermenu bubble hidden menu">
+	<ul>
+		{{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isMailShare}}
+			<li>
+				<span class="shareOption menuitem">
+					<input id="canShare-{{cid}}-{{shareId}}" type="checkbox" name="share" class="permissions checkbox" {{#if hasSharePermission}}checked="checked"{{/if}} data-permissions="{{sharePermission}}" />
+					<label for="canShare-{{cid}}-{{shareId}}">{{canShareLabel}}</label>
+				</span>
+				</li>
+			{{/unless}} {{/if}} {{/if}}
+		{{#if isFolder}}
+			{{#if createPermissionPossible}}{{#unless isMailShare}}
+				<li>
+					<span class="shareOption menuitem">
+						<input id="canCreate-{{cid}}-{{shareId}}" type="checkbox" name="create" class="permissions checkbox" {{#if hasCreatePermission}}checked="checked"{{/if}} data-permissions="{{createPermission}}"/>
+						<label for="canCreate-{{cid}}-{{shareId}}">{{createPermissionLabel}}</label>
+					</span>
+				</li>
+			{{/unless}}{{/if}}
+			{{#if updatePermissionPossible}}{{#unless isMailShare}}
+				<li>
+					<span class="shareOption menuitem">
+						<input id="canUpdate-{{cid}}-{{shareId}}" type="checkbox" name="update" class="permissions checkbox" {{#if hasUpdatePermission}}checked="checked"{{/if}} data-permissions="{{updatePermission}}"/>
+						<label for="canUpdate-{{cid}}-{{shareId}}">{{updatePermissionLabel}}</label>
+					</span>
+				</li>
+				{{/unless}}{{/if}}
+			{{#if deletePermissionPossible}}{{#unless isMailShare}}
+				<li>
+					<span class="shareOption menuitem">
+						<input id="canDelete-{{cid}}-{{shareId}}" type="checkbox" name="delete" class="permissions checkbox" {{#if hasDeletePermission}}checked="checked"{{/if}} data-permissions="{{deletePermission}}"/>
+						<label for="canDelete-{{cid}}-{{shareId}}">{{deletePermissionLabel}}</label>
+					</span>
+				</li>
+				{{/unless}}{{/if}}
+			{{/if}}
+		{{#if isMailShare}}
+			{{#if hasCreatePermission}}
+				<li>
+					<span class="shareOption menuitem">
+						<input id="secureDrop-{{cid}}-{{shareId}}" type="checkbox" name="secureDrop" class="checkbox secureDrop" {{#if secureDropMode}}checked="checked"{{/if}} data-permissions="{{readPermission}}"/>
+						<label for="secureDrop-{{cid}}-{{shareId}}">{{secureDropLabel}}</label>
+					</span>
+				</li>
+			{{/if}}
+			<li>
+				<span class="shareOption menuitem">
+					<input id="password-{{cid}}-{{shareId}}" type="checkbox" name="password" class="password checkbox" {{#if isPasswordSet}}checked="checked"{{/if}}{{#if isPasswordSet}}{{#if isPasswordForMailSharesRequired}}disabled=""{{/if}}{{/if}}" />
+					<label for="password-{{cid}}-{{shareId}}">{{passwordLabel}}</label>
+				</span>
+			</li>
+			<li class="passwordMenu-{{cid}}-{{shareId}} {{#unless isPasswordSet}}hidden{{/unless}}">
+				<span class="passwordContainer-{{cid}}-{{shareId}} icon-passwordmail menuitem">
+					<label for="passwordField-{{cid}}-{{shareId}}" class="hidden-visually" value="{{password}}">{{passwordLabel}}</label>
+					<input id="passwordField-{{cid}}-{{shareId}}" class="passwordField" type="password" placeholder="{{passwordPlaceholder}}" value="{{passwordValue}}" autocomplete="new-password" />
+					<span class="icon-loading-small hidden"></span>
+				</span>
+			</li>
+			{{#if isTalkEnabled}}
+				<li>
+					<span class="shareOption menuitem">
+						<input id="passwordByTalk-{{cid}}-{{shareId}}" type="checkbox" name="passwordByTalk" class="passwordByTalk checkbox" {{#if isPasswordByTalkSet}}checked="checked"{{/if}} />
+						<label for="passwordByTalk-{{cid}}-{{shareId}}">{{passwordByTalkLabel}}</label>
+					</span>
+				</li>
+				<li class="passwordByTalkMenu-{{cid}}-{{shareId}} {{#unless isPasswordByTalkSet}}hidden{{/unless}}">
+					<span class="passwordByTalkContainer-{{cid}}-{{shareId}} icon-passwordtalk menuitem">
+						<label for="passwordByTalkField-{{cid}}-{{shareId}}" class="hidden-visually" value="{{password}}">{{passwordByTalkLabel}}</label>
+						<input id="passwordByTalkField-{{cid}}-{{shareId}}" class="passwordField" type="password" placeholder="{{passwordByTalkPlaceholder}}" value="{{passwordValue}}" autocomplete="new-password" />
+						<span class="icon-loading-small hidden"></span>
+					</span>
+				</li>
+				{{/if}}
+			{{/if}}
+		<li>
+			<span class="shareOption menuitem">
+				<input id="expireDate-{{cid}}-{{shareId}}" type="checkbox" name="expirationDate" class="expireDate checkbox" {{#if hasExpireDate}}checked="checked"{{/if}}" />
+				<label for="expireDate-{{cid}}-{{shareId}}">{{expireDateLabel}}</label>
+			</span>
+		</li>
+		<li class="expirationDateMenu-{{cid}}-{{shareId}} {{#unless hasExpireDate}}hidden{{/unless}}">
+			<span class="expirationDateContainer-{{cid}}-{{shareId}} icon-expiredate menuitem">
+				<label for="expirationDatePicker-{{cid}}-{{shareId}}" class="hidden-visually" value="{{expirationDate}}">{{expirationLabel}}</label>
+				<input id="expirationDatePicker-{{cid}}-{{shareId}}" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{#if hasExpireDate}}{{expireDate}}{{else}}{{defaultExpireDate}}{{/if}}" />
+			</span>
+		</li>
+		{{#if isNoteAvailable}}
+			<li>
+				<a href="#" class="share-add"><span class="icon-loading-small hidden"></span>
+					<span class="icon icon-edit"></span>
+					<span>{{addNoteLabel}}</span>
+					<input type="button" class="share-note-delete icon-delete">
+				</a>
+			</li>
+			<li class="share-note-form hidden">
+				<span class="menuitem icon-note">
+					<textarea class="share-note">{{shareNote}}</textarea>
+					<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" />
+				</span>
+			</li>
+		{{/if}}
+		<li>
+			<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span>{{unshareLabel}}</span></a>
+		</li>
+	</ul>
+</div>
diff --git a/core/js/share/sharedialogview.handlebars b/core/js/share/sharedialogview.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..d364be901abc22e3b6b7cb431078189383f15f83
--- /dev/null
+++ b/core/js/share/sharedialogview.handlebars
@@ -0,0 +1,12 @@
+<div class="resharerInfoView subView"></div>
+{{#if isSharingAllowed}}
+	<label for="shareWith-{{cid}}" class="hidden-visually">{{shareLabel}}</label>
+	<div class="oneline">
+		<input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{sharePlaceholder}}" />
+		<span class="shareWithLoading icon-loading-small hidden"></span>'+
+		<span class="shareWithConfirm icon icon-confirm"></span>
+	</div>
+{{/if}}
+<div class="linkShareView subView"></div>
+<div class="shareeListView subView"></div>
+<div class="loading hidden" style="height: 50px"></div>';
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 9cd48aaf9a7849181a1728e0e338f478ec46acd9..995ff480aa672ea74e2dfd2e7b35979deb03f640 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -19,138 +19,6 @@
 	var PASSWORD_PLACEHOLDER_MESSAGE = t('core', 'Choose a password for the public link');
 	var PASSWORD_PLACEHOLDER_MESSAGE_OPTIONAL = t('core', 'Choose a password for the public link or press the "Enter" key');
 
-	var TEMPLATE =
-			'{{#if shareAllowed}}' +
-			'<ul id="shareLink" class="shareWithList">' +
-			'	<li data-share-id="{{cid}}">' +
-			'		<div class="avatar icon-public-white"></div><span class="username" title="{{linkShareLabel}}">{{linkShareLabel}}</span>' +
-			'		<span class="sharingOptionsGroup">' +
-			'			<span class="shareOption"> ' +
-			'				<span class="icon-loading-small hidden"></span>' +
-			'				<input id="linkCheckbox-{{cid}}" {{#if isLinkShare}}checked="checked"{{/if}} type="checkbox" name="linkCheckbox" class="linkCheckbox permissions checkbox">' +
-			'				<label for="linkCheckbox-{{cid}}">{{linkShareEnableLabel}}</label>' +
-			'			</span>' +
-			'			{{#if showMenu}}' +
-			'			<div class="share-menu" tabindex="0"><span class="icon icon-more"></span>' +
-			'				{{#if showPending}}' +
-			'					{{{pendingPopoverMenu}}}' +
-			'				{{else}}' +
-			'					{{{popoverMenu}}}' +
-			'				{{/if}}' +
-			'			</div>' +
-			'			{{/if}}' +
-			'		</span>' +
-			'	</li>' +
-			'</ul>' +
-			'{{else}}' +
-			// FIXME: this doesn't belong in this view
-			'{{#if noSharingPlaceholder}}<input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{noSharingPlaceholder}}" disabled="disabled"/>{{/if}}' +
-			'{{/if}}'
-		;
-	var TEMPLATE_POPOVER_MENU =
-		'<div class="popovermenu menu">' +
-			'<ul>' +
-				'<li>' +
-					'<a href="#" class="menuitem clipboardButton" data-clipboard-text="{{shareLinkURL}}">' +
-						'<span class="icon icon-clippy" ></span>' +
-						'<span>{{copyLabel}}</span>' +
-					'</a>' +
-				'</li>' +
-				'<li class="hidden linkTextMenu">' +
-					'<span class="menuitem icon-link-text">' +
-						'<input id="linkText-{{cid}}" class="linkText" type="text" readonly="readonly" value="{{shareLinkURL}}" />' +
-					'</span>' +
-				'</li>' +
-				'{{#if publicUpload}}' +
-					'<li><span class="shareOption menuitem">' +
-						'<span class="icon-loading-small hidden"></span>' +
-						'<input type="radio" name="publicUpload" value="{{publicUploadRValue}}" id="sharingDialogAllowPublicUpload-r-{{cid}}" class="radio publicUploadRadio" {{{publicUploadRChecked}}} />' +
-						'<label for="sharingDialogAllowPublicUpload-r-{{cid}}">{{publicUploadRLabel}}</label>' +
-					'</span></li>' +
-					'<li><span class="shareOption menuitem">' +
-						'<span class="icon-loading-small hidden"></span>' +
-						'<input type="radio" name="publicUpload" value="{{publicUploadRWValue}}" id="sharingDialogAllowPublicUpload-rw-{{cid}}" class="radio publicUploadRadio" {{{publicUploadRWChecked}}} />' +
-						'<label for="sharingDialogAllowPublicUpload-rw-{{cid}}">{{publicUploadRWLabel}}</label>' +
-					'</span></li>' +
-					'<li><span class="shareOption menuitem">' +
-						'<span class="icon-loading-small hidden"></span>' +
-						'<input type="radio" name="publicUpload" value="{{publicUploadWValue}}" id="sharingDialogAllowPublicUpload-w-{{cid}}" class="radio publicUploadRadio" {{{publicUploadWChecked}}} />' +
-						'<label for="sharingDialogAllowPublicUpload-w-{{cid}}">{{publicUploadWLabel}}</label>' +
-					'</span></li>' +
-				'{{/if}}' +
-				'{{#if publicEditing}}' +
-				'	<li id="allowPublicEditingWrapper"><span class="shareOption menuitem">' +
-				'		<span class="icon-loading-small hidden"></span>' +
-				'		<input type="checkbox" name="allowPublicEditing" id="sharingDialogAllowPublicEditing-{{cid}}" class="checkbox publicEditingCheckbox" {{{publicEditingChecked}}} />' +
-				'		<label for="sharingDialogAllowPublicEditing-{{cid}}">{{publicEditingLabel}}</label>' +
-				'	</span></li>' +
-				'{{/if}}' +
-				'{{#if showPasswordCheckBox}}' +
-				'	<li><span class="shareOption menuitem">' +
-				'		<input type="checkbox" name="showPassword" id="showPassword-{{cid}}" class="checkbox showPasswordCheckbox"' +
-				'			{{#if isPasswordSet}}checked="checked"{{/if}} {{#if isPasswordEnforced}}disabled="disabled"{{/if}} value="1" />' +
-				'		<label for="showPassword-{{cid}}">{{enablePasswordLabel}}</label>' +
-				'	</span></li>' +
-				'	<li class="{{#unless isPasswordSet}}hidden{{/unless}} linkPassMenu"><span class="shareOption menuitem icon-share-pass">' +
-				'    	<input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" autocomplete="new-password" />' +
-				'    <span class="icon icon-loading-small hidden"></span>' +
-				'	</span></li>' +
-				'{{/if}}' +
-				'<li>' +
-				'	<span class="shareOption menuitem">' +
-				'		<input id="expireDate-{{cid}}" type="checkbox" name="expirationDate" class="expireDate checkbox"' +
-				'			{{#if hasExpireDate}}checked="checked"{{/if}} {{#if isExpirationEnforced}}disabled="disabled"{{/if}}" />' +
-				'		<label for="expireDate-{{cid}}">{{expireDateLabel}}</label>' +
-				'	</span>' +
-				'</li>' +
-				'<li class="{{#unless hasExpireDate}}hidden{{/unless}}">' +
-				'	<span class="menuitem icon-expiredate expirationDateContainer-{{cid}}">' +
-				'    	<label for="expirationDatePicker-{{cid}}" class="hidden-visually" value="{{expirationDate}}">{{expirationLabel}}</label>' +
-				'    	<input id="expirationDatePicker-{{cid}}" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{#if hasExpireDate}}{{expireDate}}{{else}}{{defaultExpireDate}}{{/if}}" />' +
-				'	</span>' +
-				'</li>' +
-				'<li>' +
-					'<a href="#" class="share-add"><span class="icon-loading-small hidden"></span>' +
-					'	<span class="icon icon-edit"></span>' +
-					'	<span>{{addNoteLabel}}</span>' +
-					'	<input type="button" class="share-note-delete icon-delete">' +
-					'</a>' +
-				'</li>' +
-				'<li class="share-note-form share-note-link hidden">' +
-					'<span class="menuitem icon-note">' +
-					'	<textarea class="share-note">{{shareNote}}</textarea>' +
-					'	<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" />' +
-					'</span>' +
-				'</li>' +
-				'{{#each social}}' +
-					'<li>' +
-						'<a href="#" class="shareOption menuitem pop-up" data-url="{{url}}" data-window="{{newWindow}}">' +
-							'<span class="icon {{iconClass}}"' +
-								'></span><span>{{label}}' +
-							'</span>' +
-						'</a>' +
-					'</li>' +
-				'{{/each}}' +
-			'</ul>' +
-		'</div>';
-
-	// popovermenu waiting for password or expiration date before saving the share
-	var TEMPLATE_POPOVER_MENU_PENDING =
-		'<div class="popovermenu pendingpopover menu">' +
-			'<ul>' +
-				'{{#if isPasswordEnforced}}' +
-				'	<li><span class="shareOption menuitem">' +
-				'		<input type="checkbox" name="showPassword" id="showPassword-{{cid}}" checked="checked" disabled class="checkbox showPasswordCheckbox" value="1" />' +
-				'		<label for="showPassword-{{cid}}">{{enablePasswordLabel}}</label>' +
-				'	</span></li>' +
-				'	<li class="linkPassMenu"><span class="shareOption menuitem icon-share-pass">' +
-				'    	<input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" autocomplete="new-password" />' +
-				'    <span class="icon icon-loading-small hidden"></span>' +
-				'	</span></li>' +
-				'{{/if}}' +
-			'</ul>' +
-		'</div>';
-
 	/**
 	 * @class OCA.Share.ShareDialogLinkShareView
 	 * @member {OC.Share.ShareItemModel} model
@@ -168,15 +36,6 @@
 		/** @type {OC.Share.ShareConfigModel} **/
 		configModel: undefined,
 
-		/** @type {Function} **/
-		_template: undefined,
-
-		/** @type {Function} **/
-		_popoverMenuTemplate: undefined,
-
-		/** @type {Function} **/
-		_pendingPopoverMenuTemplate: undefined,
-
 		/** @type {boolean} **/
 		showLink: true,
 
@@ -684,10 +543,7 @@
 		 * @private
 		 */
 		template: function () {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
-			return this._template;
+			return OC.Share.Templates['sharedialoglinkshareview'];
 		},
 
 		/**
@@ -697,10 +553,7 @@
 		 * @returns {string}
 		 */
 		popoverMenuTemplate: function(data) {
-			if(!this._popoverMenuTemplate) {
-				this._popoverMenuTemplate = Handlebars.compile(TEMPLATE_POPOVER_MENU);
-			}
-			return this._popoverMenuTemplate(data);
+			return OC.Share.Templates['sharedialoglinkshareview_popover_menu'](data);
 		},
 
 		/**
@@ -710,10 +563,7 @@
 		 * @returns {string}
 		 */
 		pendingPopoverMenuTemplate: function(data) {
-			if(!this._pendingPopoverMenuTemplate) {
-				this._pendingPopoverMenuTemplate = Handlebars.compile(TEMPLATE_POPOVER_MENU_PENDING);
-			}
-			return this._pendingPopoverMenuTemplate(data);
+			return OC.Share.Templates['sharedialoglinkshareview_popover_menu_pending'](data);
 		},
 
 		onPopUpClick: function(event) {
diff --git a/core/js/sharedialogresharerinfoview.js b/core/js/sharedialogresharerinfoview.js
index b2d5a093990a571d156f476342ddc94c108ecd35..f55f2bcc5277094fd7406db3e014418a5c352cc3 100644
--- a/core/js/sharedialogresharerinfoview.js
+++ b/core/js/sharedialogresharerinfoview.js
@@ -15,14 +15,6 @@
 		OC.Share = {};
 	}
 
-	var TEMPLATE =
-		'<span class="reshare">' +
-		'    <div class="avatar" data-userName="{{reshareOwner}}"></div>' +
-		'    {{sharedByText}}' +
-		'</span>' +
-		'{{#if hasShareNote}}<div class="share-note">{{shareNote}}</div>{{/if}}'
-		;
-
 	/**
 	 * @class OCA.Share.ShareDialogView
 	 * @member {OC.Share.ShareItemModel} model
@@ -159,10 +151,7 @@
 		 * @private
 		 */
 		template: function () {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
-			return this._template;
+			return OC.Share.Templates['sharedialogresharerinfoview'];
 		}
 
 	});
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index 2627d5fa662567ab825f64696cfb584693cea20d..39e79f19eb1f5b6d732c696287442812f33bf953 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -21,146 +21,6 @@
 		OC.Share = {};
 	}
 
-	var TEMPLATE =
-			'<ul id="shareWithList" class="shareWithList">' +
-			'{{#each sharees}}' +
-				'<li data-share-id="{{shareId}}" data-share-type="{{shareType}}" data-share-with="{{shareWith}}">' +
-					'<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" data-avatar="{{shareWithAvatar}}" data-displayname="{{shareWithDisplayName}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' +
-					'<span class="username" title="{{shareWithTitle}}">{{shareWithDisplayName}}</span>' +
-					'<span class="sharingOptionsGroup">' +
-						'{{#if editPermissionPossible}}' +
-						'<span class="shareOption">' +
-							'<input id="canEdit-{{cid}}-{{shareId}}" type="checkbox" name="edit" class="permissions checkbox" />' +
-							'<label for="canEdit-{{cid}}-{{shareId}}">{{canEditLabel}}</label>' +
-						'</span>' +
-						'{{/if}}' +
-						'<div tabindex="0" class="share-menu"><span class="icon icon-more"></span>' +
-							'{{{popoverMenu}}}' +
-						'</div>' +
-					'</span>' +
-				'</li>' +
-			'{{/each}}' +
-			'{{#each linkReshares}}' +
-				'<li data-share-id="{{shareId}}" data-share-type="{{shareType}}">' +
-					'<div class="avatar" data-username="{{shareInitiator}}"></div>' +
-					'<span class="has-tooltip username" title="{{shareInitiator}}">' + t('core', '{{shareInitiatorDisplayName}} shared via link') + '</span>' +
-
-					'<span class="sharingOptionsGroup">' +
-						'<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">{{unshareLabel}}</span></a>' +
-					'</span>' +
-				'</li>' +
-			'{{/each}}' +
-			'</ul>'
-		;
-
-	var TEMPLATE_POPOVER_MENU =
-		'<div class="popovermenu bubble hidden menu">' +
-			'<ul>' +
-				'{{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isMailShare}}' +
-				'<li>' +
-					'<span class="shareOption menuitem">' +
-						'<input id="canShare-{{cid}}-{{shareId}}" type="checkbox" name="share" class="permissions checkbox" {{#if hasSharePermission}}checked="checked"{{/if}} data-permissions="{{sharePermission}}" />' +
-						'<label for="canShare-{{cid}}-{{shareId}}">{{canShareLabel}}</label>' +
-					'</span>' +
-				'</li>' +
-				'{{/unless}} {{/if}} {{/if}}' +
-				'{{#if isFolder}}' +
-					'{{#if createPermissionPossible}}{{#unless isMailShare}}' +
-					'<li>' +
-						'<span class="shareOption menuitem">' +
-							'<input id="canCreate-{{cid}}-{{shareId}}" type="checkbox" name="create" class="permissions checkbox" {{#if hasCreatePermission}}checked="checked"{{/if}} data-permissions="{{createPermission}}"/>' +
-							'<label for="canCreate-{{cid}}-{{shareId}}">{{createPermissionLabel}}</label>' +
-						'</span>' +
-					'</li>' +
-					'{{/unless}}{{/if}}' +
-					'{{#if updatePermissionPossible}}{{#unless isMailShare}}' +
-					'<li>' +
-						'<span class="shareOption menuitem">' +
-							'<input id="canUpdate-{{cid}}-{{shareId}}" type="checkbox" name="update" class="permissions checkbox" {{#if hasUpdatePermission}}checked="checked"{{/if}} data-permissions="{{updatePermission}}"/>' +
-							'<label for="canUpdate-{{cid}}-{{shareId}}">{{updatePermissionLabel}}</label>' +
-						'</span>' +
-					'</li>' +
-					'{{/unless}}{{/if}}' +
-					'{{#if deletePermissionPossible}}{{#unless isMailShare}}' +
-					'<li>' +
-						'<span class="shareOption menuitem">' +
-							'<input id="canDelete-{{cid}}-{{shareId}}" type="checkbox" name="delete" class="permissions checkbox" {{#if hasDeletePermission}}checked="checked"{{/if}} data-permissions="{{deletePermission}}"/>' +
-							'<label for="canDelete-{{cid}}-{{shareId}}">{{deletePermissionLabel}}</label>' +
-						'</span>' +
-					'</li>' +
-					'{{/unless}}{{/if}}' +
-				'{{/if}}' +
-				'{{#if isMailShare}}' +
-					'{{#if hasCreatePermission}}' +
-						'<li>' +
-							'<span class="shareOption menuitem">' +
-								'<input id="secureDrop-{{cid}}-{{shareId}}" type="checkbox" name="secureDrop" class="checkbox secureDrop" {{#if secureDropMode}}checked="checked"{{/if}} data-permissions="{{readPermission}}"/>' +
-								'<label for="secureDrop-{{cid}}-{{shareId}}">{{secureDropLabel}}</label>' +
-							'</span>' +
-						'</li>' +
-					'{{/if}}' +
-					'<li>' +
-						'<span class="shareOption menuitem">' +
-							'<input id="password-{{cid}}-{{shareId}}" type="checkbox" name="password" class="password checkbox" {{#if isPasswordSet}}checked="checked"{{/if}}{{#if isPasswordSet}}{{#if isPasswordForMailSharesRequired}}disabled=""{{/if}}{{/if}}" />' +
-							'<label for="password-{{cid}}-{{shareId}}">{{passwordLabel}}</label>' +
-						'</span>' +
-					'</li>' +
-					'<li class="passwordMenu-{{cid}}-{{shareId}} {{#unless isPasswordSet}}hidden{{/unless}}">' +
-						'<span class="passwordContainer-{{cid}}-{{shareId}} icon-passwordmail menuitem">' +
-						'    <label for="passwordField-{{cid}}-{{shareId}}" class="hidden-visually" value="{{password}}">{{passwordLabel}}</label>' +
-						'    <input id="passwordField-{{cid}}-{{shareId}}" class="passwordField" type="password" placeholder="{{passwordPlaceholder}}" value="{{passwordValue}}" autocomplete="new-password" />' +
-						'    <span class="icon-loading-small hidden"></span>' +
-						'</span>' +
-					'</li>' +
-					'{{#if isTalkEnabled}}' +
-					'<li>' +
-						'<span class="shareOption menuitem">' +
-							'<input id="passwordByTalk-{{cid}}-{{shareId}}" type="checkbox" name="passwordByTalk" class="passwordByTalk checkbox" {{#if isPasswordByTalkSet}}checked="checked"{{/if}} />' +
-							'<label for="passwordByTalk-{{cid}}-{{shareId}}">{{passwordByTalkLabel}}</label>' +
-						'</span>' +
-					'</li>' +
-					'<li class="passwordByTalkMenu-{{cid}}-{{shareId}} {{#unless isPasswordByTalkSet}}hidden{{/unless}}">' +
-						'<span class="passwordByTalkContainer-{{cid}}-{{shareId}} icon-passwordtalk menuitem">' +
-						'    <label for="passwordByTalkField-{{cid}}-{{shareId}}" class="hidden-visually" value="{{password}}">{{passwordByTalkLabel}}</label>' +
-						'    <input id="passwordByTalkField-{{cid}}-{{shareId}}" class="passwordField" type="password" placeholder="{{passwordByTalkPlaceholder}}" value="{{passwordValue}}" autocomplete="new-password" />' +
-						'    <span class="icon-loading-small hidden"></span>' +
-						'</span>' +
-					'</li>' +
-					'{{/if}}' +
-				'{{/if}}' +
-				'<li>' +
-					'<span class="shareOption menuitem">' +
-						'<input id="expireDate-{{cid}}-{{shareId}}" type="checkbox" name="expirationDate" class="expireDate checkbox" {{#if hasExpireDate}}checked="checked"{{/if}}" />' +
-						'<label for="expireDate-{{cid}}-{{shareId}}">{{expireDateLabel}}</label>' +
-					'</span>' +
-				'</li>' +
-				'<li class="expirationDateMenu-{{cid}}-{{shareId}} {{#unless hasExpireDate}}hidden{{/unless}}">' +
-					'<span class="expirationDateContainer-{{cid}}-{{shareId}} icon-expiredate menuitem">' +
-					'    <label for="expirationDatePicker-{{cid}}-{{shareId}}" class="hidden-visually" value="{{expirationDate}}">{{expirationLabel}}</label>' +
-					'    <input id="expirationDatePicker-{{cid}}-{{shareId}}" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{#if hasExpireDate}}{{expireDate}}{{else}}{{defaultExpireDate}}{{/if}}" />' +
-					'</span>' +
-				'</li>' +
-				'{{#if isNoteAvailable}}' +
-				'<li>' +
-					'<a href="#" class="share-add"><span class="icon-loading-small hidden"></span>' +
-					'	<span class="icon icon-edit"></span>' +
-					'	<span>{{addNoteLabel}}</span>' +
-					'	<input type="button" class="share-note-delete icon-delete">' +
-					'</a>' +
-				'</li>' +
-				'<li class="share-note-form hidden">' +
-					'<span class="menuitem icon-note">' +
-					'	<textarea class="share-note">{{shareNote}}</textarea>' +
-					'	<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" />' +
-					'</span>' +
-				'</li>' +
-				'{{/if}}' +
-				'<li>' +
-					'<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span>{{unshareLabel}}</span></a>' +
-				'</li>' +
-			'</ul>' +
-		'</div>';
-
 	/**
 	 * @class OCA.Share.ShareDialogShareeListView
 	 * @member {OC.Share.ShareItemModel} model
@@ -178,12 +38,6 @@
 		/** @type {OC.Share.ShareConfigModel} **/
 		configModel: undefined,
 
-		/** @type {Function} **/
-		_template: undefined,
-
-		/** @type {Function} **/
-		_popoverMenuTemplate: undefined,
-
 		_menuOpen: false,
 
 		/** @type {boolean|number} **/
@@ -503,16 +357,13 @@
 		 * @private
 		 */
 		template: function (data) {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
 			var sharees = data.sharees;
 			if(_.isArray(sharees)) {
 				for (var i = 0; i < sharees.length; i++) {
 					data.sharees[i].popoverMenu = this.popoverMenuTemplate(sharees[i]);
 				}
 			}
-			return this._template(data);
+			return OC.Share.Templates['sharedialogshareelistview'](data);
 		},
 
 		/**
@@ -522,10 +373,7 @@
 		 * @returns {string}
 		 */
 		popoverMenuTemplate: function(data) {
-			if(!this._popoverMenuTemplate) {
-				this._popoverMenuTemplate = Handlebars.compile(TEMPLATE_POPOVER_MENU);
-			}
-			return this._popoverMenuTemplate(data);
+			return OC.Share.Templates['sharedialogshareelistview_popover_menu'](data);
 		},
 
 		showNoteForm: function(event) {
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index f5b876c37be9e27d907db036bd386717466ea491..9c648357e61cf6f215298b0ccd07b8fb532a199f 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -15,20 +15,6 @@
 		OC.Share = {};
 	}
 
-	var TEMPLATE_BASE =
-		'<div class="resharerInfoView subView"></div>' +
-		'{{#if isSharingAllowed}}' +
-		'<label for="shareWith-{{cid}}" class="hidden-visually">{{shareLabel}}</label>' +
-		'<div class="oneline">' +
-		'    <input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{sharePlaceholder}}" />' +
-		'    <span class="shareWithLoading icon-loading-small hidden"></span>'+
-		'    <span class="shareWithConfirm icon icon-confirm"></span>' +
-		'</div>' +
-		'{{/if}}' +
-		'<div class="linkShareView subView"></div>' +
-		'<div class="shareeListView subView"></div>' +
-		'<div class="loading hidden" style="height: 50px"></div>';
-
 	/**
 	 * @class OCA.Share.ShareDialogView
 	 * @member {OC.Share.ShareItemModel} model
@@ -663,7 +649,7 @@
 
 		render: function() {
 			var self = this;
-			var baseTemplate = this._getTemplate('base', TEMPLATE_BASE);
+			var baseTemplate = OC.Share.Templates['sharedialogview'];
 
 			this.$el.html(baseTemplate({
 				cid: this.cid,
@@ -739,20 +725,6 @@
 			return 	t('core', 'Name...');
 		},
 
-		/**
-		 *
-		 * @param {string} key - an identifier for the template
-		 * @param {string} template - the HTML to be compiled by Handlebars
-		 * @returns {Function} from Handlebars
-		 * @private
-		 */
-		_getTemplate: function (key, template) {
-			if (!this._templates[key]) {
-				this._templates[key] = Handlebars.compile(template);
-			}
-			return this._templates[key];
-		},
-
 	});
 
 	OC.Share.ShareDialogView = ShareDialogView;
diff --git a/core/js/sharetemplates.js b/core/js/sharetemplates.js
new file mode 100644
index 0000000000000000000000000000000000000000..94700e1a06c3cbdfcfc9bf628d8ba6b132a71e12
--- /dev/null
+++ b/core/js/sharetemplates.js
@@ -0,0 +1,629 @@
+(function() {
+  var template = Handlebars.template, templates = OC.Share.Templates = OC.Share.Templates || {};
+templates['sharedialoglinkshareview'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<ul id=\"shareLink\" class=\"shareWithList\">\n	<li data-share-id=\""
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">\n		<div class=\"avatar icon-public-white\"></div><span class=\"username\" title=\""
+    + alias4(((helper = (helper = helpers.linkShareLabel || (depth0 != null ? depth0.linkShareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"linkShareLabel","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.linkShareLabel || (depth0 != null ? depth0.linkShareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"linkShareLabel","hash":{},"data":data}) : helper)))
+    + "</span>\n		<span class=\"sharingOptionsGroup\">\n			<span class=\"shareOption\">\n				<span class=\"icon-loading-small hidden\"></span>\n				<input id=\"linkCheckbox-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLinkShare : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " type=\"checkbox\" name=\"linkCheckbox\" class=\"linkCheckbox permissions checkbox\">\n				<label for=\"linkCheckbox-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.linkShareEnableLabel || (depth0 != null ? depth0.linkShareEnableLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"linkShareEnableLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n			</span>\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showMenu : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "		</span>\n	</li>\n</ul>\n";
+},"2":function(container,depth0,helpers,partials,data) {
+    return "checked=\"checked\"";
+},"4":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return "				<div class=\"share-menu\" tabindex=\"0\"><span class=\"icon icon-more\"></span>\n"
+    + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.showPending : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "")
+    + "				</div>\n";
+},"5":function(container,depth0,helpers,partials,data) {
+    var stack1, helper;
+
+  return "						"
+    + ((stack1 = ((helper = (helper = helpers.pendingPopoverMenu || (depth0 != null ? depth0.pendingPopoverMenu : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"pendingPopoverMenu","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + "\n";
+},"7":function(container,depth0,helpers,partials,data) {
+    var stack1, helper;
+
+  return "						"
+    + ((stack1 = ((helper = (helper = helpers.popoverMenu || (depth0 != null ? depth0.popoverMenu : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popoverMenu","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + "\n";
+},"9":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.noSharingPlaceholder : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\n";
+},"10":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<input id=\"shareWith-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"shareWithField\" type=\"text\" placeholder=\""
+    + alias4(((helper = (helper = helpers.noSharingPlaceholder || (depth0 != null ? depth0.noSharingPlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"noSharingPlaceholder","hash":{},"data":data}) : helper)))
+    + "\" disabled=\"disabled\"/>";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.shareAllowed : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : "")
+    + "'\n";
+},"useData":true});
+templates['sharedialoglinkshareview_popover_menu'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "			<li>\n				<span class=\"shareOption menuitem\">\n					<span class=\"icon-loading-small hidden\"></span>\n					<input type=\"radio\" name=\"publicUpload\" value=\""
+    + alias4(((helper = (helper = helpers.publicUploadRValue || (depth0 != null ? depth0.publicUploadRValue : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRValue","hash":{},"data":data}) : helper)))
+    + "\" id=\"sharingDialogAllowPublicUpload-r-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"radio publicUploadRadio\" "
+    + ((stack1 = ((helper = (helper = helpers.publicUploadRChecked || (depth0 != null ? depth0.publicUploadRChecked : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRChecked","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + " />\n					<label for=\"sharingDialogAllowPublicUpload-r-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.publicUploadRLabel || (depth0 != null ? depth0.publicUploadRLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				</span>\n			</li>\n			<li>\n				<span class=\"shareOption menuitem\">\n					<span class=\"icon-loading-small hidden\"></span>\n					<input type=\"radio\" name=\"publicUpload\" value=\""
+    + alias4(((helper = (helper = helpers.publicUploadRWValue || (depth0 != null ? depth0.publicUploadRWValue : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRWValue","hash":{},"data":data}) : helper)))
+    + "\" id=\"sharingDialogAllowPublicUpload-rw-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"radio publicUploadRadio\" "
+    + ((stack1 = ((helper = (helper = helpers.publicUploadRWChecked || (depth0 != null ? depth0.publicUploadRWChecked : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRWChecked","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + " />\n					<label for=\"sharingDialogAllowPublicUpload-rw-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.publicUploadRWLabel || (depth0 != null ? depth0.publicUploadRWLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRWLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				</span></li>\n			<li>\n				<span class=\"shareOption menuitem\">\n					<span class=\"icon-loading-small hidden\"></span>\n					<input type=\"radio\" name=\"publicUpload\" value=\""
+    + alias4(((helper = (helper = helpers.publicUploadWValue || (depth0 != null ? depth0.publicUploadWValue : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadWValue","hash":{},"data":data}) : helper)))
+    + "\" id=\"sharingDialogAllowPublicUpload-w-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"radio publicUploadRadio\" "
+    + ((stack1 = ((helper = (helper = helpers.publicUploadWChecked || (depth0 != null ? depth0.publicUploadWChecked : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadWChecked","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + " />\n					<label for=\"sharingDialogAllowPublicUpload-w-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.publicUploadWLabel || (depth0 != null ? depth0.publicUploadWLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadWLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				</span>\n			</li>\n";
+},"3":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "			<li id=\"allowPublicEditingWrapper\">\n				<span class=\"shareOption menuitem\">\n					<span class=\"icon-loading-small hidden\"></span>\n					<input type=\"checkbox\" name=\"allowPublicEditing\" id=\"sharingDialogAllowPublicEditing-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"checkbox publicEditingCheckbox\" "
+    + ((stack1 = ((helper = (helper = helpers.publicEditingChecked || (depth0 != null ? depth0.publicEditingChecked : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicEditingChecked","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + " />\n					<label for=\"sharingDialogAllowPublicEditing-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.publicEditingLabel || (depth0 != null ? depth0.publicEditingLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicEditingLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				</span>\n			</li>\n";
+},"5":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "			<li>\n				<span class=\"shareOption menuitem\">\n					<input type=\"checkbox\" name=\"showPassword\" id=\"showPassword-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"checkbox showPasswordCheckbox\"\n					"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordSet : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordEnforced : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " value=\"1\" />\n					<label for=\"showPassword-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.enablePasswordLabel || (depth0 != null ? depth0.enablePasswordLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"enablePasswordLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				</span>\n			</li>\n			<li class=\""
+    + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.isPasswordSet : depth0),{"name":"unless","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " linkPassMenu\">\n				<span class=\"shareOption menuitem icon-share-pass\">\n					<input id=\"linkPassText-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"linkPassText\" type=\"password\" placeholder=\""
+    + alias4(((helper = (helper = helpers.passwordPlaceholder || (depth0 != null ? depth0.passwordPlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordPlaceholder","hash":{},"data":data}) : helper)))
+    + "\" autocomplete=\"new-password\" />\n					<span class=\"icon icon-loading-small hidden\"></span>\n				</span>\n			</li>\n";
+},"6":function(container,depth0,helpers,partials,data) {
+    return "checked=\"checked\"";
+},"8":function(container,depth0,helpers,partials,data) {
+    return "disabled=\"disabled\"";
+},"10":function(container,depth0,helpers,partials,data) {
+    return "hidden";
+},"12":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"expireDate","hash":{},"data":data}) : helper)));
+},"14":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper)));
+},"16":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "			<li>\n				<a href=\"#\" class=\"shareOption menuitem pop-up\" data-url=\""
+    + alias4(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"url","hash":{},"data":data}) : helper)))
+    + "\" data-window=\""
+    + alias4(((helper = (helper = helpers.newWindow || (depth0 != null ? depth0.newWindow : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"newWindow","hash":{},"data":data}) : helper)))
+    + "\">\n					<span class=\"icon "
+    + alias4(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"iconClass","hash":{},"data":data}) : helper)))
+    + "\"></span>\n					<span>"
+    + alias4(((helper = (helper = helpers.label || (depth0 != null ? depth0.label : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"label","hash":{},"data":data}) : helper)))
+    + "</span>\n				</a>\n			</li>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<div class=\"popovermenu menu\">\n	<ul>\n		<li>\n			<a href=\"#\" class=\"menuitem clipboardButton\" data-clipboard-text=\""
+    + alias4(((helper = (helper = helpers.shareLinkURL || (depth0 != null ? depth0.shareLinkURL : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareLinkURL","hash":{},"data":data}) : helper)))
+    + "\">\n				<span class=\"icon icon-clippy\" ></span>\n				<span>"
+    + alias4(((helper = (helper = helpers.copyLabel || (depth0 != null ? depth0.copyLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"copyLabel","hash":{},"data":data}) : helper)))
+    + "</span>\n			</a>\n		</li>\n		<li class=\"hidden linkTextMenu\">\n			<span class=\"menuitem icon-link-text\">\n				<input id=\"linkText-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"linkText\" type=\"text\" readonly=\"readonly\" value=\""
+    + alias4(((helper = (helper = helpers.shareLinkURL || (depth0 != null ? depth0.shareLinkURL : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareLinkURL","hash":{},"data":data}) : helper)))
+    + "\" />\n			</span>\n		</li>\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.publicUpload : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.publicEditing : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showPasswordCheckBox : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "		<li>\n			<span class=\"shareOption menuitem\">\n				<input id=\"expireDate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"expirationDate\" class=\"expireDate checkbox\"\n				"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasExpireDate : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isExpirationEnforced : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\" />\n				<label for=\"expireDate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.expireDateLabel || (depth0 != null ? depth0.expireDateLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expireDateLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n			</span>\n		</li>\n		<li class=\""
+    + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasExpireDate : depth0),{"name":"unless","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\">\n			<span class=\"menuitem icon-expiredate expirationDateContainer-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">\n				<label for=\"expirationDatePicker-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"hidden-visually\" value=\""
+    + alias4(((helper = (helper = helpers.expirationDate || (depth0 != null ? depth0.expirationDate : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expirationDate","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.expirationLabel || (depth0 != null ? depth0.expirationLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expirationLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				<input id=\"expirationDatePicker-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"datepicker\" type=\"text\" placeholder=\""
+    + alias4(((helper = (helper = helpers.expirationDatePlaceholder || (depth0 != null ? depth0.expirationDatePlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expirationDatePlaceholder","hash":{},"data":data}) : helper)))
+    + "\" value=\""
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasExpireDate : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.program(14, data, 0),"data":data})) != null ? stack1 : "")
+    + "\" />\n			</span>\n			</li>\n		<li>\n			<a href=\"#\" class=\"share-add\">\n				<span class=\"icon-loading-small hidden\"></span>\n				<span class=\"icon icon-edit\"></span>\n				<span>"
+    + alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper)))
+    + "</span>\n				<input type=\"button\" class=\"share-note-delete icon-delete\">\n			</a>\n		</li>\n		<li class=\"share-note-form share-note-link hidden\">\n			<span class=\"menuitem icon-note\">\n				<textarea class=\"share-note\">"
+    + alias4(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareNote","hash":{},"data":data}) : helper)))
+    + "</textarea>\n				<input type=\"submit\" class=\"icon-confirm share-note-submit\" value=\"\" id=\"add-note-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" />\n				</span>\n		</li>\n"
+    + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.social : depth0),{"name":"each","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "	</ul>\n</div>\n";
+},"useData":true});
+templates['sharedialoglinkshareview_popover_menu_pending'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "			<li><span class=\"shareOption menuitem\">\n				<input type=\"checkbox\" name=\"showPassword\" id=\"showPassword-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" checked=\"checked\" disabled class=\"checkbox showPasswordCheckbox\" value=\"1\" />\n				<label for=\"showPassword-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.enablePasswordLabel || (depth0 != null ? depth0.enablePasswordLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"enablePasswordLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n			</span></li>\n			<li class=\"linkPassMenu\"><span class=\"shareOption menuitem icon-share-pass\">\n				<input id=\"linkPassText-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"linkPassText\" type=\"password\" placeholder=\""
+    + alias4(((helper = (helper = helpers.passwordPlaceholder || (depth0 != null ? depth0.passwordPlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordPlaceholder","hash":{},"data":data}) : helper)))
+    + "\" autocomplete=\"new-password\" />\n				<span class=\"icon icon-loading-small hidden\"></span>\n			</span></li>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return "<div class=\"popovermenu pendingpopover menu\">\n	<ul>\n"
+    + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isPasswordEnforced : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "	</ul>\n</div>\n";
+},"useData":true});
+templates['sharedialogresharerinfoview'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "<div class=\"share-note\">"
+    + container.escapeExpression(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"shareNote","hash":{},"data":data}) : helper)))
+    + "</div>";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<span class=\"reshare\">\n	<div class=\"avatar\" data-userName=\""
+    + alias4(((helper = (helper = helpers.reshareOwner || (depth0 != null ? depth0.reshareOwner : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"reshareOwner","hash":{},"data":data}) : helper)))
+    + "\"></div>\n	"
+    + alias4(((helper = (helper = helpers.sharedByText || (depth0 != null ? depth0.sharedByText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"sharedByText","hash":{},"data":data}) : helper)))
+    + "\n</span>' +\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasShareNote : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\n";
+},"useData":true});
+templates['sharedialogshareelistview'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "		<li data-share-id=\""
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" data-share-type=\""
+    + alias4(((helper = (helper = helpers.shareType || (depth0 != null ? depth0.shareType : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareType","hash":{},"data":data}) : helper)))
+    + "\" data-share-with=\""
+    + alias4(((helper = (helper = helpers.shareWith || (depth0 != null ? depth0.shareWith : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWith","hash":{},"data":data}) : helper)))
+    + "\">\n			<div class=\"avatar "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.modSeed : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\" data-username=\""
+    + alias4(((helper = (helper = helpers.shareWith || (depth0 != null ? depth0.shareWith : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWith","hash":{},"data":data}) : helper)))
+    + "\" data-avatar=\""
+    + alias4(((helper = (helper = helpers.shareWithAvatar || (depth0 != null ? depth0.shareWithAvatar : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWithAvatar","hash":{},"data":data}) : helper)))
+    + "\" data-displayname=\""
+    + alias4(((helper = (helper = helpers.shareWithDisplayName || (depth0 != null ? depth0.shareWithDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWithDisplayName","hash":{},"data":data}) : helper)))
+    + "\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.modSeed : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "></div>\n			<span class=\"username\" title=\""
+    + alias4(((helper = (helper = helpers.shareWithTitle || (depth0 != null ? depth0.shareWithTitle : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWithTitle","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.shareWithDisplayName || (depth0 != null ? depth0.shareWithDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWithDisplayName","hash":{},"data":data}) : helper)))
+    + "</span>\n			<span class=\"sharingOptionsGroup\">\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.editPermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "				<div tabindex=\"0\" class=\"share-menu\"><span class=\"icon icon-more\"></span>\n					"
+    + ((stack1 = ((helper = (helper = helpers.popoverMenu || (depth0 != null ? depth0.popoverMenu : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popoverMenu","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + "\n				</div>\n			</span>\n		</li>\n";
+},"2":function(container,depth0,helpers,partials,data) {
+    return "imageplaceholderseed";
+},"4":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "data-seed=\""
+    + alias4(((helper = (helper = helpers.shareWith || (depth0 != null ? depth0.shareWith : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWith","hash":{},"data":data}) : helper)))
+    + " "
+    + alias4(((helper = (helper = helpers.shareType || (depth0 != null ? depth0.shareType : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareType","hash":{},"data":data}) : helper)))
+    + "\"";
+},"6":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "					<span class=\"shareOption\">\n						<input id=\"canEdit-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"edit\" class=\"permissions checkbox\" />\n						<label for=\"canEdit-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.canEditLabel || (depth0 != null ? depth0.canEditLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"canEditLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n					</span>\n";
+},"8":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "		<li data-share-id=\""
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" data-share-type=\""
+    + alias4(((helper = (helper = helpers.shareType || (depth0 != null ? depth0.shareType : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareType","hash":{},"data":data}) : helper)))
+    + "\">\n			<div class=\"avatar\" data-username=\""
+    + alias4(((helper = (helper = helpers.shareInitiator || (depth0 != null ? depth0.shareInitiator : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareInitiator","hash":{},"data":data}) : helper)))
+    + "\"></div>\n			<span class=\"has-tooltip username\" title=\""
+    + alias4(((helper = (helper = helpers.shareInitiator || (depth0 != null ? depth0.shareInitiator : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareInitiator","hash":{},"data":data}) : helper)))
+    + "\"> t('core', '"
+    + alias4(((helper = (helper = helpers.shareInitiatorDisplayName || (depth0 != null ? depth0.shareInitiatorDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareInitiatorDisplayName","hash":{},"data":data}) : helper)))
+    + " shared via link') + '</span>\n			<span class=\"sharingOptionsGroup\">\n				<a href=\"#\" class=\"unshare\"><span class=\"icon-loading-small hidden\"></span><span class=\"icon icon-delete\"></span><span class=\"hidden-visually\">"
+    + alias4(((helper = (helper = helpers.unshareLabel || (depth0 != null ? depth0.unshareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"unshareLabel","hash":{},"data":data}) : helper)))
+    + "</span></a>\n			</span>\n		</li>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});
+
+  return "<ul id=\"shareWithList\" class=\"shareWithList\">\n"
+    + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.sharees : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.linkReshares : depth0),{"name":"each","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "</ul>\n";
+},"useData":true});
+templates['sharedialogshareelistview_popover_menu'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return " "
+    + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.sharePermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " ";
+},"2":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return " "
+    + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " ";
+},"3":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "\n			<li>\n				<span class=\"shareOption menuitem\">\n					<input id=\"canShare-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"share\" class=\"permissions checkbox\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasSharePermission : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " data-permissions=\""
+    + alias4(((helper = (helper = helpers.sharePermission || (depth0 != null ? depth0.sharePermission : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"sharePermission","hash":{},"data":data}) : helper)))
+    + "\" />\n					<label for=\"canShare-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.canShareLabel || (depth0 != null ? depth0.canShareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"canShareLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				</span>\n				</li>\n			";
+},"4":function(container,depth0,helpers,partials,data) {
+    return "checked=\"checked\"";
+},"6":function(container,depth0,helpers,partials,data) {
+    var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});
+
+  return "			"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.createPermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\n			"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.updatePermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\n			"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.deletePermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\n";
+},"7":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"8":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "\n				<li>\n					<span class=\"shareOption menuitem\">\n						<input id=\"canCreate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"create\" class=\"permissions checkbox\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasCreatePermission : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " data-permissions=\""
+    + alias4(((helper = (helper = helpers.createPermission || (depth0 != null ? depth0.createPermission : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"createPermission","hash":{},"data":data}) : helper)))
+    + "\"/>\n						<label for=\"canCreate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.createPermissionLabel || (depth0 != null ? depth0.createPermissionLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"createPermissionLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n					</span>\n				</li>\n			";
+},"10":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"11":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "\n				<li>\n					<span class=\"shareOption menuitem\">\n						<input id=\"canUpdate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"update\" class=\"permissions checkbox\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasUpdatePermission : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " data-permissions=\""
+    + alias4(((helper = (helper = helpers.updatePermission || (depth0 != null ? depth0.updatePermission : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"updatePermission","hash":{},"data":data}) : helper)))
+    + "\"/>\n						<label for=\"canUpdate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.updatePermissionLabel || (depth0 != null ? depth0.updatePermissionLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"updatePermissionLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n					</span>\n				</li>\n				";
+},"13":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(14, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"14":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "\n				<li>\n					<span class=\"shareOption menuitem\">\n						<input id=\"canDelete-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"delete\" class=\"permissions checkbox\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasDeletePermission : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " data-permissions=\""
+    + alias4(((helper = (helper = helpers.deletePermission || (depth0 != null ? depth0.deletePermission : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"deletePermission","hash":{},"data":data}) : helper)))
+    + "\"/>\n						<label for=\"canDelete-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.deletePermissionLabel || (depth0 != null ? depth0.deletePermissionLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"deletePermissionLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n					</span>\n				</li>\n				";
+},"16":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasCreatePermission : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "			<li>\n				<span class=\"shareOption menuitem\">\n					<input id=\"password-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"password\" class=\"password checkbox\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordSet : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordSet : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\" />\n					<label for=\"password-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.passwordLabel || (depth0 != null ? depth0.passwordLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				</span>\n			</li>\n			<li class=\"passwordMenu-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + " "
+    + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.isPasswordSet : depth0),{"name":"unless","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\">\n				<span class=\"passwordContainer-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + " icon-passwordmail menuitem\">\n					<label for=\"passwordField-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" class=\"hidden-visually\" value=\""
+    + alias4(((helper = (helper = helpers.password || (depth0 != null ? depth0.password : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"password","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.passwordLabel || (depth0 != null ? depth0.passwordLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n					<input id=\"passwordField-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" class=\"passwordField\" type=\"password\" placeholder=\""
+    + alias4(((helper = (helper = helpers.passwordPlaceholder || (depth0 != null ? depth0.passwordPlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordPlaceholder","hash":{},"data":data}) : helper)))
+    + "\" value=\""
+    + alias4(((helper = (helper = helpers.passwordValue || (depth0 != null ? depth0.passwordValue : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordValue","hash":{},"data":data}) : helper)))
+    + "\" autocomplete=\"new-password\" />\n					<span class=\"icon-loading-small hidden\"></span>\n				</span>\n			</li>\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isTalkEnabled : depth0),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"17":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "				<li>\n					<span class=\"shareOption menuitem\">\n						<input id=\"secureDrop-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"secureDrop\" class=\"checkbox secureDrop\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.secureDropMode : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " data-permissions=\""
+    + alias4(((helper = (helper = helpers.readPermission || (depth0 != null ? depth0.readPermission : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"readPermission","hash":{},"data":data}) : helper)))
+    + "\"/>\n						<label for=\"secureDrop-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.secureDropLabel || (depth0 != null ? depth0.secureDropLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secureDropLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n					</span>\n				</li>\n";
+},"19":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isPasswordForMailSharesRequired : depth0),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"20":function(container,depth0,helpers,partials,data) {
+    return "disabled=\"\"";
+},"22":function(container,depth0,helpers,partials,data) {
+    return "hidden";
+},"24":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "				<li>\n					<span class=\"shareOption menuitem\">\n						<input id=\"passwordByTalk-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"passwordByTalk\" class=\"passwordByTalk checkbox\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordByTalkSet : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + " />\n						<label for=\"passwordByTalk-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.passwordByTalkLabel || (depth0 != null ? depth0.passwordByTalkLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordByTalkLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n					</span>\n				</li>\n				<li class=\"passwordByTalkMenu-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + " "
+    + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.isPasswordByTalkSet : depth0),{"name":"unless","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\">\n					<span class=\"passwordByTalkContainer-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + " icon-passwordtalk menuitem\">\n						<label for=\"passwordByTalkField-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" class=\"hidden-visually\" value=\""
+    + alias4(((helper = (helper = helpers.password || (depth0 != null ? depth0.password : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"password","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.passwordByTalkLabel || (depth0 != null ? depth0.passwordByTalkLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordByTalkLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n						<input id=\"passwordByTalkField-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" class=\"passwordField\" type=\"password\" placeholder=\""
+    + alias4(((helper = (helper = helpers.passwordByTalkPlaceholder || (depth0 != null ? depth0.passwordByTalkPlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordByTalkPlaceholder","hash":{},"data":data}) : helper)))
+    + "\" value=\""
+    + alias4(((helper = (helper = helpers.passwordValue || (depth0 != null ? depth0.passwordValue : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordValue","hash":{},"data":data}) : helper)))
+    + "\" autocomplete=\"new-password\" />\n						<span class=\"icon-loading-small hidden\"></span>\n					</span>\n				</li>\n";
+},"26":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"expireDate","hash":{},"data":data}) : helper)));
+},"28":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper)));
+},"30":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "			<li>\n				<a href=\"#\" class=\"share-add\"><span class=\"icon-loading-small hidden\"></span>\n					<span class=\"icon icon-edit\"></span>\n					<span>"
+    + alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper)))
+    + "</span>\n					<input type=\"button\" class=\"share-note-delete icon-delete\">\n				</a>\n			</li>\n			<li class=\"share-note-form hidden\">\n				<span class=\"menuitem icon-note\">\n					<textarea class=\"share-note\">"
+    + alias4(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareNote","hash":{},"data":data}) : helper)))
+    + "</textarea>\n					<input type=\"submit\" class=\"icon-confirm share-note-submit\" value=\"\" id=\"add-note-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" />\n				</span>\n			</li>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<div class=\"popovermenu bubble hidden menu\">\n	<ul>\n		"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isResharingAllowed : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isFolder : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isMailShare : depth0),{"name":"if","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "		<li>\n			<span class=\"shareOption menuitem\">\n				<input id=\"expireDate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" type=\"checkbox\" name=\"expirationDate\" class=\"expireDate checkbox\" "
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasExpireDate : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\" />\n				<label for=\"expireDate-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.expireDateLabel || (depth0 != null ? depth0.expireDateLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expireDateLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n			</span>\n		</li>\n		<li class=\"expirationDateMenu-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + " "
+    + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasExpireDate : depth0),{"name":"unless","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\">\n			<span class=\"expirationDateContainer-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + " icon-expiredate menuitem\">\n				<label for=\"expirationDatePicker-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" class=\"hidden-visually\" value=\""
+    + alias4(((helper = (helper = helpers.expirationDate || (depth0 != null ? depth0.expirationDate : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expirationDate","hash":{},"data":data}) : helper)))
+    + "\">"
+    + alias4(((helper = (helper = helpers.expirationLabel || (depth0 != null ? depth0.expirationLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expirationLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n				<input id=\"expirationDatePicker-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-"
+    + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+    + "\" class=\"datepicker\" type=\"text\" placeholder=\""
+    + alias4(((helper = (helper = helpers.expirationDatePlaceholder || (depth0 != null ? depth0.expirationDatePlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expirationDatePlaceholder","hash":{},"data":data}) : helper)))
+    + "\" value=\""
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasExpireDate : depth0),{"name":"if","hash":{},"fn":container.program(26, data, 0),"inverse":container.program(28, data, 0),"data":data})) != null ? stack1 : "")
+    + "\" />\n			</span>\n		</li>\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isNoteAvailable : depth0),{"name":"if","hash":{},"fn":container.program(30, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "		<li>\n			<a href=\"#\" class=\"unshare\"><span class=\"icon-loading-small hidden\"></span><span class=\"icon icon-delete\"></span><span>"
+    + alias4(((helper = (helper = helpers.unshareLabel || (depth0 != null ? depth0.unshareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"unshareLabel","hash":{},"data":data}) : helper)))
+    + "</span></a>\n		</li>\n	</ul>\n</div>\n";
+},"useData":true});
+templates['sharedialogview'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "	<label for=\"shareWith-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"hidden-visually\">"
+    + alias4(((helper = (helper = helpers.shareLabel || (depth0 != null ? depth0.shareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n	<div class=\"oneline\">\n		<input id=\"shareWith-"
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "\" class=\"shareWithField\" type=\"text\" placeholder=\""
+    + alias4(((helper = (helper = helpers.sharePlaceholder || (depth0 != null ? depth0.sharePlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"sharePlaceholder","hash":{},"data":data}) : helper)))
+    + "\" />\n		<span class=\"shareWithLoading icon-loading-small hidden\"></span>'+\n		<span class=\"shareWithConfirm icon icon-confirm\"></span>\n	</div>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return "<div class=\"resharerInfoView subView\"></div>\n"
+    + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isSharingAllowed : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "<div class=\"linkShareView subView\"></div>\n<div class=\"shareeListView subView\"></div>\n<div class=\"loading hidden\" style=\"height: 50px\"></div>';\n";
+},"useData":true});
+})();
\ No newline at end of file
diff --git a/core/js/systemtags/merged.json b/core/js/systemtags/merged.json
index 846ba967ed5b92a794bb06600d46f15c116a5d5c..641858ee2ed092b42e07ea4852766eb8dc031b0c 100644
--- a/core/js/systemtags/merged.json
+++ b/core/js/systemtags/merged.json
@@ -1,5 +1,6 @@
 [
   "systemtags.js",
+  "templates.js",
   "systemtagmodel.js",
   "systemtagsmappingcollection.js",
   "systemtagscollection.js",
diff --git a/core/js/systemtags/systemtagsinputfield.js b/core/js/systemtags/systemtagsinputfield.js
index ba72d4862047002a197a38ef44a794dc2484397b..82fd659c72e3d95d57b151377e6c64b774f752b2 100644
--- a/core/js/systemtags/systemtagsinputfield.js
+++ b/core/js/systemtags/systemtagsinputfield.js
@@ -11,39 +11,6 @@
 /* global Handlebars */
 
 (function(OC) {
-	var TEMPLATE =
-		'<input class="systemTagsInputField" type="hidden" name="tags" value=""/>';
-
-	var RESULT_TEMPLATE =
-		'<span class="systemtags-item{{#if isNew}} new-item{{/if}}" data-id="{{id}}">' +
-		'    <span class="checkmark icon icon-checkmark"></span>' +
-		'{{#if isAdmin}}' +
-		'    <span class="label">{{{tagMarkup}}}</span>' +
-		'{{else}}' +
-		'    <span class="label">{{name}}</span>' +
-		'{{/if}}' +
-		'{{#allowActions}}' +
-		'    <span class="systemtags-actions">' +
-		'        <a href="#" class="rename icon icon-rename" title="{{renameTooltip}}"></a>' +
-		'    </span>' +
-		'{{/allowActions}}' +
-		'</span>';
-
-	var SELECTION_TEMPLATE =
-		'{{#if isAdmin}}' +
-		'    <span class="label">{{{tagMarkup}}}</span>' +
-		'{{else}}' +
-		'    <span class="label">{{name}}</span>' +
-		'{{/if}}';
-
-	var RENAME_FORM_TEMPLATE =
-		'<form class="systemtags-rename-form">' +
-		'    <label class="hidden-visually" for="{{cid}}-rename-input">{{renameLabel}}</label>' +
-		'    <input id="{{cid}}-rename-input" type="text" value="{{name}}">' +
-		'    {{#if isAdmin}}' +
-		'      <a href="#" class="delete icon icon-delete" title="{{deleteTooltip}}"></a>' +
-		'    {{/if}}' +
-		'</form>';
 
 	/**
 	 * @class OC.SystemTags.SystemTagsInputField
@@ -64,10 +31,7 @@
 		className: 'systemTagsInputFieldContainer',
 
 		template: function(data) {
-			if (!this._template) {
-				this._template = Handlebars.compile(TEMPLATE);
-			}
-			return this._template(data);
+			return '<input class="systemTagsInputField" type="hidden" name="tags" value=""/>';
 		},
 
 		/**
@@ -141,12 +105,9 @@
 			var $item = $(ev.target).closest('.systemtags-item');
 			var tagId = $item.attr('data-id');
 			var tagModel = this.collection.get(tagId);
-			if (!this._renameFormTemplate) {
-				this._renameFormTemplate = Handlebars.compile(RENAME_FORM_TEMPLATE);
-			}
 
 			var oldName = tagModel.get('name');
-			var $renameForm = $(this._renameFormTemplate({
+			var $renameForm = $(OC.SystemTags.Templates['result_form']({
 				cid: this.cid,
 				name: oldName,
 				deleteTooltip: t('core', 'Delete'),
@@ -310,10 +271,7 @@
 		 * @return {string} HTML markup
 		 */
 		_formatDropDownResult: function(data) {
-			if (!this._resultTemplate) {
-				this._resultTemplate = Handlebars.compile(RESULT_TEMPLATE);
-			}
-			return this._resultTemplate(_.extend({
+			return OC.SystemTags.Templates['result'](_.extend({
 				renameTooltip: t('core', 'Rename'),
 				allowActions: this._allowActions,
 				tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
@@ -328,10 +286,7 @@
 		 * @return {string} HTML markup
 		 */
 		_formatSelection: function(data) {
-			if (!this._selectionTemplate) {
-				this._selectionTemplate = Handlebars.compile(SELECTION_TEMPLATE);
-			}
-			return this._selectionTemplate(_.extend({
+			return OC.SystemTags.Templates['selection'](_.extend({
 				tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
 				isAdmin: this._isAdmin
 			}, data));
diff --git a/core/js/systemtags/templates.js b/core/js/systemtags/templates.js
new file mode 100644
index 0000000000000000000000000000000000000000..0894d646829169c068c0ddc7b1065424c291990c
--- /dev/null
+++ b/core/js/systemtags/templates.js
@@ -0,0 +1,74 @@
+(function() {
+  var template = Handlebars.template, templates = OC.SystemTags.Templates = OC.SystemTags.Templates || {};
+templates['result'] = template({"1":function(container,depth0,helpers,partials,data) {
+    return " new-item";
+},"3":function(container,depth0,helpers,partials,data) {
+    var stack1, helper;
+
+  return "		<span class=\"label\">"
+    + ((stack1 = ((helper = (helper = helpers.tagMarkup || (depth0 != null ? depth0.tagMarkup : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tagMarkup","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + "</span>\n";
+},"5":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "		<span class=\"label\">"
+    + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data}) : helper)))
+    + "</span>\n";
+},"7":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "		<span class=\"systemtags-actions\">\n			<a href=\"#\" class=\"rename icon icon-rename\" title=\""
+    + container.escapeExpression(((helper = (helper = helpers.renameTooltip || (depth0 != null ? depth0.renameTooltip : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"renameTooltip","hash":{},"data":data}) : helper)))
+    + "\"></a>\n		</span>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", buffer = 
+  "<span class=\"systemtags-item"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isNew : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "\" data-id=\""
+    + container.escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data}) : helper)))
+    + "\">\n<span class=\"checkmark icon icon-checkmark\"></span>\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isAdmin : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(5, data, 0),"data":data})) != null ? stack1 : "");
+  stack1 = ((helper = (helper = helpers.allowActions || (depth0 != null ? depth0.allowActions : depth0)) != null ? helper : alias2),(options={"name":"allowActions","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
+  if (!helpers.allowActions) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
+  if (stack1 != null) { buffer += stack1; }
+  return buffer + "</span>';\n";
+},"useData":true});
+templates['result_form'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "		<a href=\"#\" class=\"delete icon icon-delete\" title=\""
+    + container.escapeExpression(((helper = (helper = helpers.deleteTooltip || (depth0 != null ? depth0.deleteTooltip : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"deleteTooltip","hash":{},"data":data}) : helper)))
+    + "\"></a>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+  return "<form class=\"systemtags-rename-form\">\n	 <label class=\"hidden-visually\" for=\""
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-rename-input\">"
+    + alias4(((helper = (helper = helpers.renameLabel || (depth0 != null ? depth0.renameLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"renameLabel","hash":{},"data":data}) : helper)))
+    + "</label>\n	<input id=\""
+    + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper)))
+    + "-rename-input\" type=\"text\" value=\""
+    + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+    + "\">\n"
+    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isAdmin : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+    + "</form>\n";
+},"useData":true});
+templates['selection'] = template({"1":function(container,depth0,helpers,partials,data) {
+    var stack1, helper;
+
+  return "	<span class=\"label\">"
+    + ((stack1 = ((helper = (helper = helpers.tagMarkup || (depth0 != null ? depth0.tagMarkup : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tagMarkup","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+    + "</span>\n";
+},"3":function(container,depth0,helpers,partials,data) {
+    var helper;
+
+  return "	<span class=\"label\">"
+    + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data}) : helper)))
+    + "</span>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+    var stack1;
+
+  return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isAdmin : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "");
+},"useData":true});
+})();
\ No newline at end of file
diff --git a/core/js/systemtags/templates/result.handlebars b/core/js/systemtags/templates/result.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..ce69c8a21ff188d971e619007b26439316a93be8
--- /dev/null
+++ b/core/js/systemtags/templates/result.handlebars
@@ -0,0 +1,13 @@
+<span class="systemtags-item{{#if isNew}} new-item{{/if}}" data-id="{{id}}">
+<span class="checkmark icon icon-checkmark"></span>
+	{{#if isAdmin}}
+		<span class="label">{{{tagMarkup}}}</span>
+	{{else}}
+		<span class="label">{{name}}</span>
+	{{/if}}
+	{{#allowActions}}
+		<span class="systemtags-actions">
+			<a href="#" class="rename icon icon-rename" title="{{renameTooltip}}"></a>
+		</span>
+	{{/allowActions}}
+</span>';
diff --git a/core/js/systemtags/templates/result_form.handlebars b/core/js/systemtags/templates/result_form.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..28fe8c56fe242523c9e697d9b1e44ee4d97ce09c
--- /dev/null
+++ b/core/js/systemtags/templates/result_form.handlebars
@@ -0,0 +1,7 @@
+<form class="systemtags-rename-form">
+	 <label class="hidden-visually" for="{{cid}}-rename-input">{{renameLabel}}</label>
+	<input id="{{cid}}-rename-input" type="text" value="{{name}}">
+	{{#if isAdmin}}
+		<a href="#" class="delete icon icon-delete" title="{{deleteTooltip}}"></a>
+	{{/if}}
+</form>
diff --git a/core/js/systemtags/templates/selection.handlebars b/core/js/systemtags/templates/selection.handlebars
new file mode 100644
index 0000000000000000000000000000000000000000..b006b1297483f93ee041f64099861b5df62b687b
--- /dev/null
+++ b/core/js/systemtags/templates/selection.handlebars
@@ -0,0 +1,5 @@
+{{#if isAdmin}}
+	<span class="label">{{{tagMarkup}}}</span>
+{{else}}
+	<span class="label">{{name}}</span>
+{{/if}}
diff --git a/tests/karma.config.js b/tests/karma.config.js
index 0fd9b7b8019cc918b663edf6d812e0714d733828..83392851163ca0801899fe830069ff41ade2ea42 100644
--- a/tests/karma.config.js
+++ b/tests/karma.config.js
@@ -77,6 +77,7 @@ module.exports = function(config) {
 				srcFiles: [
 					// need to enforce loading order...
 					'apps/files_versions/js/versionmodel.js',
+					'apps/files_versions/js/templates.js',
 					'apps/files_versions/js/versioncollection.js',
 					'apps/files_versions/js/versionstabview.js'
 				],
@@ -87,6 +88,7 @@ module.exports = function(config) {
 				srcFiles: [
 					// need to enforce loading order...
 					'apps/comments/js/app.js',
+					'apps/comments/js/templates.js',
 					'apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js',
 					'apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js',
 					'apps/comments/js/commentmodel.js',