[feature] [customer login] send links in email for portal access of Sales Order, Sales Invoice, Delivery Note and Suppor Ticket
diff --git a/website/templates/pages/sale.html b/website/templates/pages/sale.html
index 669a380..1c03da2 100644
--- a/website/templates/pages/sale.html
+++ b/website/templates/pages/sale.html
@@ -11,6 +11,9 @@
     	<li class="active"><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</li>
     </ul>
 	<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
+	{% if doc.name == "Not Allowed" -%}
+		<script>ask_to_login();</script>
+	{% else %}
 	<hr>
 	<div>
 	<div class="row">
@@ -82,5 +85,6 @@
 		</div>
 	</div>
 	</div>
+	{%- endif %}
 </div>
 {% endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/ticket.html b/website/templates/pages/ticket.html
index eeb485a..6622ed1 100644
--- a/website/templates/pages/ticket.html
+++ b/website/templates/pages/ticket.html
@@ -17,6 +17,9 @@
     	<li class="active"><i class="icon-ticket icon-fixed-width"></i> {{ doc.name }}</li>
     </ul>
 	<h3><i class="icon-ticket icon-fixed-width"></i> {{ doc.name }}</h3>
+	{% if doc.name == "Not Allowed" -%}
+		<script>ask_to_login();</script>
+	{% else %}
 	<hr>
 	{%- if doc.status -%}
 	{% if doc.status == "Waiting for Customer" -%}
@@ -46,6 +49,7 @@
 					<td>
 					<h5 style="text-transform: none">
 						{{ comm.sender }} on {{ utils.formatdate(doc.modified) }}</h5>
+					<hr>
 					<p>{{ webnotes.utils.is_html(comm.content) and comm.content or
 						comm.content.replace("\n", "<br>")}}</p>
 					</td>
@@ -58,5 +62,6 @@
 	<div class="alert">No messages</div>
 	{%- endif -%}
 	{%- endif -%}
+	{% endif -%}
 </div>
 {% endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/transaction_list.html b/website/templates/pages/transaction_list.html
new file mode 100644
index 0000000..967a6a8
--- /dev/null
+++ b/website/templates/pages/transaction_list.html
@@ -0,0 +1,77 @@
+{% extends "app/website/templates/html/page.html" %}
+
+{% block content %}
+<div class="col-md-12">
+    <ul class="breadcrumb">
+    	<li><a href="index">Home</a></li>
+    	<li><a href="account">My Account</a></li>
+    	<li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
+    </ul>
+	<div class="list-group transaction-list">
+		<div class="progress progress-striped active">
+			<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
+		</div>
+	</div>
+	<div class="text-center">
+		<button class="btn btn-default btn-show-more" style="display: none;">More</button></div>
+</div>
+{% endblock %}
+
+{% block javascript %}
+global_number_format = "{{ global_number_format }}";
+currency = "{{ currency }}";
+wn.currency_symbols = {{ currency_symbols }};
+
+$(document).ready(function() {
+	var start = 0;
+	var $list = $(".transaction-list");
+	
+	var $show_more = $(".btn-show-more").on("click", function() {
+		get_transactions(this);
+	});
+	
+	var get_transactions = function(btn) {
+		wn.call({
+			method: "{{ method }}",
+			args: { start: start },
+			btn: btn,
+			callback: function(r) {
+				$list.find(".progress").remove();
+				$show_more.toggle(!(r.message && r.message.length===20));
+				
+				if(!(r.message && r.message.length)) {
+					console.log("empty");
+					if(!$list.html().trim()) {
+						$list.html("<div class='alert alert-warning'>\
+							{{ empty_list_message }}</div>");
+					}
+					return;
+				}
+			
+				start += r.message.length;
+			
+				$.each(r.message, function(i, doc) {
+					render(doc);
+				});
+			}
+		})
+	};
+	
+	var render = function(doc) {
+		doc.grand_total_export = format_currency(doc.grand_total_export, doc.currency);
+		
+		var $row = $(repl('<a href="{{ page }}?name=%(name)s" class="list-group-item">\
+				<div class="row">\
+					<div class="col-md-6">\
+						<div class="row col-md-12">%(name)s</div>\
+						<div class="row col-md-12 text-muted">%(items)s...</div>\
+					</div>\
+					<div class="col-md-3 text-right">%(grand_total_export)s</div>\
+					<div class="col-md-3 text-right text-muted">%(creation)s</div>\
+				</div>\
+			</a>', doc)).appendTo($list);
+	};
+	
+	get_transactions();
+});
+{% endblock %}
\ No newline at end of file