diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index 2e54666f5..d8a30340a 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -17,11 +17,9 @@ = person_link(@post.author, :class => 'author-name') - if @post.is_a?(Reshare) && @post.root.present? - reshared via + %i.icon-retweet = person_link(@post.root.author, :class => "author-name") - - .post-time %i.icon-time = time_ago_in_words(@post.created_at) + ' ago' diff --git a/public/javascripts/app/helpers/text_formatter.js b/public/javascripts/app/helpers/text_formatter.js index 51bc72b4a..99115f507 100644 --- a/public/javascripts/app/helpers/text_formatter.js +++ b/public/javascripts/app/helpers/text_formatter.js @@ -3,16 +3,16 @@ var text = model.get("text"); var mentions = model.get("mentioned_people"); - return textFormatter.mentionify( + return $(textFormatter.mentionify( textFormatter.hashtagify( textFormatter.markdownify(text) ), mentions - ) + )).html() }; textFormatter.markdownify = function markdownify(text){ var converter = Markdown.getSanitizingConverter(); - + converter.hooks.chain("postConversion", function (text) { return text.replace(/(\"(?:(?:http|https):\/\/)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(?:\/\S*)?\")(\>)/g, '$1 target="_blank">') }); @@ -33,7 +33,7 @@ var person = _.find(mentions, function(person){ return person.diaspora_id == diasporaId }) - + return person ? "" + fullName + "" : fullName; }) } diff --git a/public/javascripts/app/pages/post-viewer.js b/public/javascripts/app/pages/post-viewer.js index c3871c12e..6ae7947f2 100644 --- a/public/javascripts/app/pages/post-viewer.js +++ b/public/javascripts/app/pages/post-viewer.js @@ -12,7 +12,7 @@ app.pages.PostViewer = app.views.Base.extend({ return new app.views.Post({ model : this.model, className : "loaded", - templateName : this.options.postTemplateName + templateName : "post-viewer/content/" + this.options.postTemplateName }) }, diff --git a/public/javascripts/app/templates/post-viewer/content/activity-streams-photo.handlebars b/public/javascripts/app/templates/post-viewer/content/activity-streams-photo.handlebars new file mode 100644 index 000000000..a773a755f --- /dev/null +++ b/public/javascripts/app/templates/post-viewer/content/activity-streams-photo.handlebars @@ -0,0 +1,7 @@ +
+
+
+ +
+
+
diff --git a/public/javascripts/app/templates/multi-photo.handlebars b/public/javascripts/app/templates/post-viewer/content/multi-photo.handlebars similarity index 93% rename from public/javascripts/app/templates/multi-photo.handlebars rename to public/javascripts/app/templates/post-viewer/content/multi-photo.handlebars index 49a4c781a..fc7b28e82 100644 --- a/public/javascripts/app/templates/multi-photo.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/multi-photo.handlebars @@ -1,6 +1,6 @@

- {{text}} + {{{text}}}

diff --git a/public/javascripts/app/templates/note.handlebars b/public/javascripts/app/templates/post-viewer/content/note.handlebars similarity index 83% rename from public/javascripts/app/templates/note.handlebars rename to public/javascripts/app/templates/post-viewer/content/note.handlebars index 2b2145fff..b03c4b950 100644 --- a/public/javascripts/app/templates/note.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/note.handlebars @@ -3,6 +3,6 @@ A HEADING

- {{text}} + {{{text}}}

diff --git a/public/javascripts/app/templates/photo-backdrop.handlebars b/public/javascripts/app/templates/post-viewer/content/photo-backdrop.handlebars similarity index 100% rename from public/javascripts/app/templates/photo-backdrop.handlebars rename to public/javascripts/app/templates/post-viewer/content/photo-backdrop.handlebars diff --git a/public/javascripts/app/templates/rich-media.handlebars b/public/javascripts/app/templates/post-viewer/content/rich-media.handlebars similarity index 100% rename from public/javascripts/app/templates/rich-media.handlebars rename to public/javascripts/app/templates/post-viewer/content/rich-media.handlebars diff --git a/public/javascripts/app/templates/status-with-photo-backdrop.handlebars b/public/javascripts/app/templates/post-viewer/content/status-with-photo-backdrop.handlebars similarity index 89% rename from public/javascripts/app/templates/status-with-photo-backdrop.handlebars rename to public/javascripts/app/templates/post-viewer/content/status-with-photo-backdrop.handlebars index e43934824..fc1175b58 100644 --- a/public/javascripts/app/templates/status-with-photo-backdrop.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/status-with-photo-backdrop.handlebars @@ -2,7 +2,7 @@

- {{../text}} + {{{../text}}}

diff --git a/public/javascripts/app/templates/status.handlebars b/public/javascripts/app/templates/post-viewer/content/status.handlebars similarity index 77% rename from public/javascripts/app/templates/status.handlebars rename to public/javascripts/app/templates/post-viewer/content/status.handlebars index 59db29d2f..992194ac6 100644 --- a/public/javascripts/app/templates/status.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/status.handlebars @@ -1,5 +1,5 @@

- {{text}} + {{{text}}}

diff --git a/public/javascripts/app/views/post_view.js b/public/javascripts/app/views/post_view.js index 0c5f26005..c3e96e19d 100644 --- a/public/javascripts/app/views/post_view.js +++ b/public/javascripts/app/views/post_view.js @@ -24,6 +24,7 @@ app.views.Post = app.views.StreamObject.extend({ tooltipSelector : ".delete, .block_user, .post_scope", initialize : function(options) { + console.log(this.model.attributes) // allow for a custom template name to be passed in via the options hash this.templateName = options.templateName || this.templateName @@ -54,7 +55,8 @@ app.views.Post = app.views.StreamObject.extend({ presenter : function() { return _.extend(this.defaultPresenter(), { authorIsNotCurrentUser : this.authorIsNotCurrentUser(), - showPost : this.showPost() + showPost : this.showPost(), + text : app.helpers.textFormatter(this.model) }) }, diff --git a/public/stylesheets/sass/new-templates.scss b/public/stylesheets/sass/new-templates.scss index 96e30fd33..bdbcb3383 100644 --- a/public/stylesheets/sass/new-templates.scss +++ b/public/stylesheets/sass/new-templates.scss @@ -198,7 +198,13 @@ $light-grey: #999; width: 35px; } + i.icon-time, + i.icon-retweet { + @include opacity(0.5); + } + .author-name { + text-shadow: 0 0 2px rgba(255,255,255,0.9); color: inherit; font-weight: bold; }