FEATURE: add real date of post in the share dialog when triggered from the post date

This commit is contained in:
Régis Hanol 2014-06-09 21:14:03 +02:00
parent a63ac64931
commit 2abcbcc29b
3 changed files with 23 additions and 11 deletions

View File

@ -1,4 +1,9 @@
<h3>{{view.title}}</h3>
{{#if date}}
<span class="date">{{rawDate date}}</span>
{{/if}}
<div><input type='text' /></div>
{{#each shareLinks}}

View File

@ -57,8 +57,9 @@ Discourse.ShareView = Discourse.View.extend({
$shareLink = $('#share-link');
var url = $currentTarget.data('share-url');
var postNumber = $currentTarget.data('post-number');
// Relative urls
var date = $currentTarget.children().data('time');
// Relative urls
if (url.indexOf("/") === 0) {
url = window.location.protocol + "//" + window.location.host + url;
}
@ -82,8 +83,11 @@ Discourse.ShareView = Discourse.View.extend({
left: "" + x + "px",
top: "" + y + "px"
});
shareView.set('controller.link', url);
shareView.set('controller.postNumber', postNumber);
shareView.set('controller.date', date);
return false;
});
@ -102,5 +106,3 @@ Discourse.ShareView = Discourse.View.extend({
}
});

View File

@ -635,15 +635,20 @@ iframe {
width: 365px;
margin-left: -4px;
h3 {
margin: 5px 0;
}
h3 {
margin: 5px 0;
float: left;
}
input[type=text] {
font-size: 16px;
width: 92%;
margin-bottom: 10px;
}
.date {
float: right;
margin: 5px;
}
input[type=text] {
font-size: 16px;
margin-bottom: 10px;
}
}
.post-select {