markdownify text; better folder structure for photo-viewer templates

This commit is contained in:
danielgrippi 2012-02-19 19:59:54 -08:00
parent 3d1ac7ed55
commit f83b82902c
12 changed files with 26 additions and 13 deletions

View file

@ -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'

View file

@ -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){

View file

@ -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
}) })
}, },

View file

@ -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>

View file

@ -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">

View file

@ -3,6 +3,6 @@
A HEADING A HEADING
</h1> </h1>
<p> <p>
{{text}} {{{text}}}
</p> </p>
</div> </div>

View file

@ -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>

View file

@ -1,5 +1,5 @@
<div class="status backdrop"> <div class="status backdrop">
<h1> <h1>
{{text}} {{{text}}}
</h1> </h1>
</div> </div>

View file

@ -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)
}) })
}, },

View file

@ -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;
} }