DG DC; visual fixups

This commit is contained in:
danielgrippi 2012-04-04 18:55:52 -07:00
parent 6098890783
commit 39d688044d
14 changed files with 81 additions and 60 deletions

View file

@ -1,6 +1,6 @@
(function(){ (function(){
var textFormatter = function textFormatter(model) { //make it so I take text and mentions rather than the modelapp.helpers.textFormatter(
var text = model.get("text"); var textFormatter = function textFormatter(text, model) {
var mentions = model.get("mentioned_people"); var mentions = model.get("mentioned_people");
return textFormatter.mentionify( return textFormatter.mentionify(

View file

@ -14,7 +14,7 @@ app.views.Comment = app.views.Content.extend({
presenter : function() { presenter : function() {
return _.extend(this.defaultPresenter(), { return _.extend(this.defaultPresenter(), {
canRemove: this.canRemove(), canRemove: this.canRemove(),
text : app.helpers.textFormatter(this.model) text : app.helpers.textFormatter(this.model.get("text"), this.model)
}) })
}, },

View file

@ -8,7 +8,7 @@ app.views.Content = app.views.StreamObject.extend({
presenter : function(){ presenter : function(){
return _.extend(this.defaultPresenter(), { return _.extend(this.defaultPresenter(), {
text : app.helpers.textFormatter(this.model), text : app.helpers.textFormatter(this.model.get("text"), this.model),
o_embed_html : this.embedHTML(), o_embed_html : this.embedHTML(),
largePhoto : this.largePhoto(), largePhoto : this.largePhoto(),
smallPhotos : this.smallPhotos() smallPhotos : this.smallPhotos()

View file

@ -12,8 +12,8 @@ app.views.Post.Mood = app.views.Post.extend({
presenter : function(){ presenter : function(){
var model = this.model var model = this.model
return _.extend(this.defaultPresenter(), { return _.extend(this.defaultPresenter(), {
headline : model.headline(), headline : $(app.helpers.textFormatter(model.headline(), model)).html(),
body : model.body() body : app.helpers.textFormatter(model.body(), model)
}) })
}, },

View file

@ -5,7 +5,7 @@ app.views.Post = app.views.StreamObject.extend({
return _.extend(this.defaultPresenter(), { return _.extend(this.defaultPresenter(), {
authorIsCurrentUser : this.authorIsCurrentUser(), authorIsCurrentUser : this.authorIsCurrentUser(),
showPost : this.showPost(), showPost : this.showPost(),
text : app.helpers.textFormatter(this.model) text : app.helpers.textFormatter(this.model.get("text"), this.model)
}) })
}, },
@ -23,10 +23,10 @@ app.views.Post = app.views.StreamObject.extend({
//translate obsolete template names to the new Moods, should be removed when template picker comes cliente side. //translate obsolete template names to the new Moods, should be removed when template picker comes cliente side.
var map = { var map = {
'status-with-photo-backdrop' : 'Wallpaper', 'status-with-photo-backdrop' : 'Wallpaper', //equivalent
'status' : 'Day', 'status' : 'Day', //equivalent
'note' : 'Newspaper', 'note' : 'Newspaper', //equivalent
'photo-backdrop' : 'Day' 'photo-backdrop' : 'Day' //that theme was bad
} }
frameName = map[frameName] || frameName frameName = map[frameName] || frameName
@ -50,6 +50,7 @@ app.views.Post = app.views.StreamObject.extend({
}); });
app.views.Post.Legacy = app.views.Post.extend({ app.views.Post.Legacy = app.views.Post.extend({
tagName : "article",
initialize : function(options) { initialize : function(options) {
this.templateName = options.templateName || this.templateName this.templateName = options.templateName || this.templateName
} }

View file

@ -7,39 +7,13 @@
.icon-green { background-image: image_url("img/glyphicons-halflings-green.png"); } .icon-green { background-image: image_url("img/glyphicons-halflings-green.png"); }
.icon-blue { background-image: image_url("img/glyphicons-halflings-blue.png"); } .icon-blue { background-image: image_url("img/glyphicons-halflings-blue.png"); }
/* styles */
.multi-photo {
display: table;
p {
@include media-text();
}
.img-bounding-box {
display: table-cell;
text-align: center;
vertical-align: middle;
padding: 20px;
height: 400px;
width: 300px;
}
img {
@include photo-shadow();
max-width: 100%;
max-height: 100%;
}
}
.photoset { .photoset {
@include center(horizontal); @include center(horizontal);
width: 100%; width: 100%;
} }
.rich-media { .rich-media {
z-index : -5000; //so the framer controls don't get lost //z-index : -5000; //so the framer controls don't get lost
position: absolute; position: absolute;
height: 100%; height: 100%;
width: 100%; width: 100%;
@ -181,8 +155,13 @@ article { //mood posts
$big-text-size : 3em; $big-text-size : 3em;
$medium-text-size : 2em; $medium-text-size : 2em;
$small-text-size: 1.5em; $small-text-size: 1.5em;
width: 960px;
margin: 0 auto;
@include centered-frame(); @include centered-frame();
.container {
padding: 70px 0;
}
header, header p{ header, header p{
//big text //big text
@ -191,10 +170,12 @@ article { //mood posts
} }
section.body{ section.body{
font-size: $small-text-size; p { font-size: $small-text-size;}
&.short_body{ &.short_body{
font-size: $medium-text-size; p{
font-size: $medium-text-size;
}
} }
} }
@ -204,17 +185,58 @@ article { //mood posts
} }
&.newspaper { &.newspaper {
text-align: left;
@include newspaper-type(); @include newspaper-type();
width: 960px;
text-align: left;
.container {
width: 600px;
}
.photo_viewer { .photo_viewer {
float: left; float: right;
margin-left: 20px;
max-width: 320px;
}
header {
margin-bottom: 1em;
line-height: 1em;
}
.body p {
@include newspaper-type();
font-size: 1.2em;
line-height: 1.7em;
margin-bottom: 1.2em;
} }
} }
&.wallpaper{ &.wallpaper{
color : #fff; color : #fff;
} }
&.multi-photo {
p {
@include media-text();
}
.img-bounding-box {
display: table-cell;
text-align: center;
vertical-align: middle;
padding: 20px;
height: 400px;
width: 300px;
}
img {
@include photo-shadow();
max-width: 100%;
max-height: 100%;
}
}
} }
.status-with-photo-backdrop { .status-with-photo-backdrop {
@ -284,6 +306,7 @@ $bring-dark-accent-forward-color: #DDD;
.framer-controls { .framer-controls {
@include info-container-base(); @include info-container-base();
z-index: 999;
position: fixed; position: fixed;
width: 100%; width: 100%;

View file

@ -81,8 +81,6 @@ $night-text-color : #999;
@mixin newspaper-type() { @mixin newspaper-type() {
font-family: Palatino, times, georgia, serif; font-family: Palatino, times, georgia, serif;
margin-bottom: 1em;
padding: 0 5%;
} }
@mixin centered-frame(){ @mixin centered-frame(){

View file

@ -1,3 +1,5 @@
<header>{{headline}}</header> <div class="container">
<section class="photo_viewer"></section> <header>{{{headline}}}</header>
<section class="body">{{{body}}}</section> <section class="photo_viewer"></section>
<section class="body">{{{body}}}</section>
</div>

View file

@ -1,6 +1,5 @@
<div class='row'> <div class='row'>
<div class='span8 offset2 new-post-section'> <div class='span8 offset2 new-post-section'>
<div class="new_picture"/> <div class="new_picture"/>
<form class="new-post"> <form class="new-post">
@ -16,8 +15,6 @@
<div class="aspect_selector"></div> <div class="aspect_selector"></div>
<div class="service_selector"></div> <div class="service_selector"></div>
<input type="submit" class="btn-primary" value="Share" />
</fieldset> </fieldset>
</form> </form>
</div> </div>

View file

@ -1,4 +1,9 @@
<div class="framer-controls">
<div class="controls">
<button class="btn-primary next">Next</button>
</div>
</div>
<div class="container"> <div class="container">
<div id="new-post"></div> <div id="new-post"></div>
<button class="btn-primary next">Next</button>
</div> </div>

View file

@ -1,8 +1,8 @@
<div class="photo-fill" data-img-src="{{backgroundUrl}}" style="background-image: url({{backgroundUrl}})"> <div class="photo-fill" data-img-src="{{backgroundUrl}}" style="background-image: url({{backgroundUrl}})">
<div class="darken"> <div class="darken">
<div class="darken-content"> <div class="darken-content">
<header>{{headline}}</header> <header>{{{headline}}}</header>
<section class="body">{{body}}</section> <section class="body">{{{body}}}</section>
</div> </div>
</div> </div>
</div> </div>

View file

@ -11,7 +11,7 @@ describe("app.helpers.textFormatter", function(){
spyOn(app.helpers.textFormatter, "hashtagify") spyOn(app.helpers.textFormatter, "hashtagify")
spyOn(app.helpers.textFormatter, "markdownify") spyOn(app.helpers.textFormatter, "markdownify")
app.helpers.textFormatter(this.statusMessage) app.helpers.textFormatter(this.statusMessage.get("text"), this.statusMessage)
expect(app.helpers.textFormatter.mentionify).toHaveBeenCalled() expect(app.helpers.textFormatter.mentionify).toHaveBeenCalled()
expect(app.helpers.textFormatter.hashtagify).toHaveBeenCalled() expect(app.helpers.textFormatter.hashtagify).toHaveBeenCalled()
expect(app.helpers.textFormatter.markdownify).toHaveBeenCalled() expect(app.helpers.textFormatter.markdownify).toHaveBeenCalled()

View file

@ -26,10 +26,7 @@ describe("app.pages.Framer", function(){
it("navigates on save", function(){ it("navigates on save", function(){
spyOn(app.router, "navigate") spyOn(app.router, "navigate")
this.page.model.set({id : 22})
this.page.model.trigger("sync") this.page.model.trigger("sync")
console.log(app.router.navigate)
expect(app.router.navigate).toHaveBeenCalled() expect(app.router.navigate).toHaveBeenCalled()
}) })
}); });

View file

@ -62,9 +62,7 @@ describe("app.views.AspectsDropdown", function(){
describe("selecting An Aspect", function(){ describe("selecting An Aspect", function(){
beforeEach(function(){ beforeEach(function(){
this.link = this.view.$("a:contains('lovers')") this.link = this.view.$("a:contains('lovers')")
console.log(app.currentUser.get("aspects"), $("a:contains('lovers')", this.view.el))
this.link.click() this.link.click()
}) })