markdownify text; better folder structure for photo-viewer templates
This commit is contained in:
parent
3d1ac7ed55
commit
f83b82902c
12 changed files with 26 additions and 13 deletions
|
|
@ -17,11 +17,9 @@
|
||||||
= person_link(@post.author, :class => 'author-name')
|
= person_link(@post.author, :class => 'author-name')
|
||||||
|
|
||||||
- if @post.is_a?(Reshare) && @post.root.present?
|
- if @post.is_a?(Reshare) && @post.root.present?
|
||||||
reshared via
|
%i.icon-retweet
|
||||||
= person_link(@post.root.author, :class => "author-name")
|
= person_link(@post.root.author, :class => "author-name")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.post-time
|
.post-time
|
||||||
%i.icon-time
|
%i.icon-time
|
||||||
= time_ago_in_words(@post.created_at) + ' ago'
|
= time_ago_in_words(@post.created_at) + ' ago'
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
var text = model.get("text");
|
var text = model.get("text");
|
||||||
var mentions = model.get("mentioned_people");
|
var mentions = model.get("mentioned_people");
|
||||||
|
|
||||||
return textFormatter.mentionify(
|
return $(textFormatter.mentionify(
|
||||||
textFormatter.hashtagify(
|
textFormatter.hashtagify(
|
||||||
textFormatter.markdownify(text)
|
textFormatter.markdownify(text)
|
||||||
), mentions
|
), mentions
|
||||||
)
|
)).html()
|
||||||
};
|
};
|
||||||
|
|
||||||
textFormatter.markdownify = function markdownify(text){
|
textFormatter.markdownify = function markdownify(text){
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ app.pages.PostViewer = app.views.Base.extend({
|
||||||
return new app.views.Post({
|
return new app.views.Post({
|
||||||
model : this.model,
|
model : this.model,
|
||||||
className : "loaded",
|
className : "loaded",
|
||||||
templateName : this.options.postTemplateName
|
templateName : "post-viewer/content/" + this.options.postTemplateName
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="activity-streams-photo backdrop">
|
||||||
|
<div class="photoset">
|
||||||
|
<div class="img-bounding-box">
|
||||||
|
<img src="{{object_url}}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="multi-photo backdrop">
|
<div class="multi-photo backdrop">
|
||||||
<h3>
|
<h3>
|
||||||
{{text}}
|
{{{text}}}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="photoset">
|
<div class="photoset">
|
||||||
|
|
@ -3,6 +3,6 @@
|
||||||
A HEADING
|
A HEADING
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
{{text}}
|
{{{text}}}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="status photo-backdrop" style="background-image: url({{sizes.large}})">
|
<div class="status photo-backdrop" style="background-image: url({{sizes.large}})">
|
||||||
<div class="darken">
|
<div class="darken">
|
||||||
<h1>
|
<h1>
|
||||||
{{../text}}
|
{{{../text}}}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="status backdrop">
|
<div class="status backdrop">
|
||||||
<h1>
|
<h1>
|
||||||
{{text}}
|
{{{text}}}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -24,6 +24,7 @@ app.views.Post = app.views.StreamObject.extend({
|
||||||
tooltipSelector : ".delete, .block_user, .post_scope",
|
tooltipSelector : ".delete, .block_user, .post_scope",
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
|
console.log(this.model.attributes)
|
||||||
// allow for a custom template name to be passed in via the options hash
|
// allow for a custom template name to be passed in via the options hash
|
||||||
this.templateName = options.templateName || this.templateName
|
this.templateName = options.templateName || this.templateName
|
||||||
|
|
||||||
|
|
@ -54,7 +55,8 @@ app.views.Post = app.views.StreamObject.extend({
|
||||||
presenter : function() {
|
presenter : function() {
|
||||||
return _.extend(this.defaultPresenter(), {
|
return _.extend(this.defaultPresenter(), {
|
||||||
authorIsNotCurrentUser : this.authorIsNotCurrentUser(),
|
authorIsNotCurrentUser : this.authorIsNotCurrentUser(),
|
||||||
showPost : this.showPost()
|
showPost : this.showPost(),
|
||||||
|
text : app.helpers.textFormatter(this.model)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,13 @@ $light-grey: #999;
|
||||||
width: 35px;
|
width: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i.icon-time,
|
||||||
|
i.icon-retweet {
|
||||||
|
@include opacity(0.5);
|
||||||
|
}
|
||||||
|
|
||||||
.author-name {
|
.author-name {
|
||||||
|
text-shadow: 0 0 2px rgba(255,255,255,0.9);
|
||||||
color: inherit;
|
color: inherit;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue