Remove bookmark from top right of post; move its functionality to the post menu button

This commit is contained in:
Neil Lalonde 2013-06-18 14:34:28 -04:00
parent 87024c8676
commit c9556b4bb8
20 changed files with 27 additions and 75 deletions

View File

@ -64,13 +64,15 @@ Discourse.Post = Discourse.Model.extend({
} else { } else {
if (this.get('read')) { if (this.get('read')) {
result += ' seen'; result += ' seen';
} else {
result += ' unseen';
} }
} }
return result; return result;
}.property('read', 'topic.last_read_post_number', 'bookmarked'), }.property('read', 'topic.last_read_post_number', 'bookmarked'),
// Custom tooltips for the bookmark icons // Custom tooltips for the bookmark icons
bookmarkTooltip: (function() { bookmarkTooltip: function() {
var topic; var topic;
if (this.get('bookmarked')) return Em.String.i18n('bookmarks.created'); if (this.get('bookmarked')) return Em.String.i18n('bookmarks.created');
if (!this.get('read')) return ""; if (!this.get('read')) return "";
@ -79,7 +81,7 @@ Discourse.Post = Discourse.Model.extend({
return Em.String.i18n('bookmarks.last_read'); return Em.String.i18n('bookmarks.last_read');
} }
return Em.String.i18n('bookmarks.not_bookmarked'); return Em.String.i18n('bookmarks.not_bookmarked');
}).property('read', 'topic.last_read_post_number', 'bookmarked'), }.property('read', 'topic.last_read_post_number', 'bookmarked'),
bookmarkedChanged: function() { bookmarkedChanged: function() {
var post = this; var post = this;

View File

@ -10,8 +10,6 @@
<div class='row'> <div class='row'>
{{#if controller.multiSelect}} {{#if controller.multiSelect}}
<button class='post-select' {{action selectPost this}}>{{view.selectText}}</button> <button class='post-select' {{action selectPost this}}>{{view.selectText}}</button>
{{else}}
<div {{bindAttr class="bookmarkClass"}} {{bindAttr title="bookmarkTooltip"}} {{action toggleBookmark this}}></div>
{{/if}} {{/if}}
{{#if showUserReplyTab}} {{#if showUserReplyTab}}

View File

@ -38,7 +38,7 @@ Discourse.PostMenuView = Discourse.View.extend({
// Trigger re-rendering // Trigger re-rendering
needsToRender: function() { needsToRender: function() {
this.rerender(); this.rerender();
}.observes('post.deleted_at', 'post.flagsAvailable.@each', 'post.url', 'post.bookmarked', 'post.reply_count', 'post.showRepliesBelow', 'post.can_delete'), }.observes('post.deleted_at', 'post.flagsAvailable.@each', 'post.url', 'post.bookmarked', 'post.reply_count', 'post.showRepliesBelow', 'post.can_delete', 'post.read', 'post.topic.last_read_post_number'),
// Replies Button // Replies Button
renderReplies: function(post, buffer) { renderReplies: function(post, buffer) {
@ -152,13 +152,9 @@ Discourse.PostMenuView = Discourse.View.extend({
renderBookmark: function(post, buffer) { renderBookmark: function(post, buffer) {
if (!Discourse.User.current()) return; if (!Discourse.User.current()) return;
var icon = 'bookmark'; buffer.push("<button title=\"" + this.get('post.bookmarkTooltip') +
if (!this.get('post.bookmarked')) { "\" data-action=\"bookmark\" class='bookmark'><div class='" + this.get('post.bookmarkClass') +
icon += '-empty'; "'></div></button>");
}
buffer.push("<button title=\"" +
(Em.String.i18n("post.controls.bookmark")) +
"\" data-action=\"bookmark\" class='bookmark'><i class=\"icon-" + icon + "\"></i></button>");
}, },
clickBookmark: function() { clickBookmark: function() {

View File

@ -74,11 +74,6 @@
.gutter { .gutter {
width: 100px; width: 100px;
} }
article.boxed {
.read-icon {
left: 750px !important;
}
}
} }
} }
@ -202,13 +197,6 @@
} }
} }
@include hover { @include hover {
.read-icon {
i {
&:before {
font-size: 25px;
}
}
}
section.post-menu-area { section.post-menu-area {
display: block; display: block;
} }
@ -282,6 +270,25 @@
&.like, &.edit, &.flag, &.delete, &.share, &.bookmark, &.create { &.like, &.edit, &.flag, &.delete, &.share, &.bookmark, &.create {
float: right; float: right;
} }
.read-icon {
&:before {
font-family: "FontAwesome";
content: "\f02e";
}
&.unseen {
&:before {
content: "\f097";
}
}
&.last-read {
color: $red;
}
&.bookmarked {
&:before {
color: $bookmarkColor;
}
}
}
} }
button.create { button.create {
color: $attention_fg; color: $attention_fg;
@ -484,11 +491,6 @@
position: relative; position: relative;
font-size: 16px; font-size: 16px;
line-height: 20px; line-height: 20px;
@include small-width {
.read-icon {
right: 365px !important;
}
}
.post-select { .post-select {
@include border-radius-all(4px); @include border-radius-all(4px);
background-color: $light_gray; background-color: $light_gray;
@ -504,36 +506,6 @@
padding: 2px 5px; padding: 2px 5px;
z-index: 490; z-index: 490;
} }
.read-icon {
@include transition(opacity 1s);
opacity: 0;
position: absolute;
top: -3px;
left: 800px;
width: 16px;
height: 22px;
z-index: 490;
font-size: 20px;
cursor: pointer;
&:before {
font-family: "FontAwesome";
content: "\f02e";
}
&.seen {
color: $gray;
opacity: 1;
}
&.last-read {
color: $red;
opacity: 1;
}
&.bookmarked {
&:before {
color: $bookmarkColor;
}
opacity: 1;
}
}
img { img {
max-width: 100%; max-width: 100%;
} }

View File

@ -789,7 +789,6 @@ cs:
delete: "smazat příspěvek" delete: "smazat příspěvek"
undelete: "obnovit příspěvek" undelete: "obnovit příspěvek"
share: "sdílet odkaz na tento příspěvek" share: "sdílet odkaz na tento příspěvek"
bookmark: "přidat záložku na tento příspěvek na vaši uživatelskou stránku"
more: "Více" more: "Více"
actions: actions:

View File

@ -553,7 +553,6 @@ da:
delete: "slet dette indlæg" delete: "slet dette indlæg"
undelete: "annulér sletning" undelete: "annulér sletning"
share: "del et link til dette indlæg" share: "del et link til dette indlæg"
bookmark: "bogmærk dette indlæg til din brugerside"
more: "Mere" more: "Mere"
actions: actions:

View File

@ -760,7 +760,6 @@ de:
delete: "Diesen Beitrag löschen" delete: "Diesen Beitrag löschen"
undelete: "Diesen Beitrag wiederherstellen" undelete: "Diesen Beitrag wiederherstellen"
share: "Link zu diesem Beitrag teilen" share: "Link zu diesem Beitrag teilen"
bookmark: "Lesezeichen zu diesem Beitrag auf meiner Nutzerseite setzen"
more: "Mehr" more: "Mehr"
actions: actions:

View File

@ -762,7 +762,6 @@ en:
delete: "delete this post" delete: "delete this post"
undelete: "undelete this post" undelete: "undelete this post"
share: "share a link to this post" share: "share a link to this post"
bookmark: "bookmark this post to your user page"
more: "More" more: "More"
actions: actions:

View File

@ -649,7 +649,6 @@ es:
delete: "elimina esta publicación" delete: "elimina esta publicación"
undelete: "deshace la eliminación de esta publicación" undelete: "deshace la eliminación de esta publicación"
share: "comparte un enlace a esta publicación" share: "comparte un enlace a esta publicación"
bookmark: "marca esta publicación como favorita en tu página de usuario"
more: "Más" more: "Más"
actions: actions:

View File

@ -686,7 +686,6 @@ fr:
delete: "Supprimer ce message" delete: "Supprimer ce message"
undelete: "Annuler la suppression de ce message" undelete: "Annuler la suppression de ce message"
share: "Partager un lien vers ce message" share: "Partager un lien vers ce message"
bookmark: "Ajouter ce message à ma page utilisateur"
more: "Plus" more: "Plus"
actions: actions:

View File

@ -509,7 +509,6 @@ id:
delete: "delete this post" delete: "delete this post"
undelete: "undelete this post" undelete: "undelete this post"
share: "share a link to this post" share: "share a link to this post"
bookmark: "bookmark this post to your user page"
more: "More" more: "More"
actions: actions:

View File

@ -668,7 +668,6 @@ it:
delete: "elimina post" delete: "elimina post"
undelete: "annulla eliminazione post" undelete: "annulla eliminazione post"
share: "condividi questo post" share: "condividi questo post"
bookmark: "aggiungilo ai tuoi segnalibri"
more: "Di più" more: "Di più"
actions: actions:

View File

@ -688,7 +688,6 @@ nb_NO:
delete: "delete this post" delete: "delete this post"
undelete: "undelete this post" undelete: "undelete this post"
share: "share a link to this post" share: "share a link to this post"
bookmark: "bookmark this post to your user page"
more: "More" more: "More"
actions: actions:

View File

@ -764,7 +764,6 @@ nl:
delete: verwijder dit bericht delete: verwijder dit bericht
undelete: herstel dit bericht undelete: herstel dit bericht
share: deel een link naar dit bericht share: deel een link naar dit bericht
bookmark: voeg dit bericht toe aan de bladwijzers op je gebruikerspagina
more: Meer more: Meer
actions: actions:

View File

@ -647,7 +647,6 @@ pseudo:
delete: '[[ ďéłéťé ťĥíš ƿóšť ]]' delete: '[[ ďéłéťé ťĥíš ƿóšť ]]'
undelete: '[[ ůɳďéłéťé ťĥíš ƿóšť ]]' undelete: '[[ ůɳďéłéťé ťĥíš ƿóšť ]]'
share: '[[ šĥářé á łíɳǩ ťó ťĥíš ƿóšť ]]' share: '[[ šĥářé á łíɳǩ ťó ťĥíš ƿóšť ]]'
bookmark: '[[ ƀóóǩɱářǩ ťĥíš ƿóšť ťó ýóůř ůšéř ƿáǧé ]]'
more: '[[ Ϻóřé ]]' more: '[[ Ϻóřé ]]'
actions: actions:
flag: '[[ Ƒłáǧ ]]' flag: '[[ Ƒłáǧ ]]'

View File

@ -477,7 +477,6 @@ pt:
delete: "apagar este post" delete: "apagar este post"
undelete: "desapagar este post" undelete: "desapagar este post"
share: "partilhar um link para este post" share: "partilhar um link para este post"
bookmark: "marcar este post na tua página de utilizador"
more: "Mais" more: "Mais"
actions: actions:

View File

@ -733,7 +733,6 @@ ru:
delete: удалить сообщение delete: удалить сообщение
undelete: отменить удаление undelete: отменить удаление
share: поделиться ссылкой на сообщение share: поделиться ссылкой на сообщение
bookmark: добавить сообщение в закладки
more: Ещё more: Ещё
actions: actions:
flag: Жалоба flag: Жалоба

View File

@ -586,7 +586,6 @@ sv:
delete: "radera detta inlägg" delete: "radera detta inlägg"
undelete: "återställ detta inlägg" undelete: "återställ detta inlägg"
share: "dela en länk till detta inlägg" share: "dela en länk till detta inlägg"
bookmark: "bokmärk detta inlägg till din användarsida"
more: "Mer" more: "Mer"
actions: actions:

View File

@ -727,7 +727,6 @@ zh_CN:
delete: "删除本帖" delete: "删除本帖"
undelete: "恢复本帖" undelete: "恢复本帖"
share: "分享一个到本帖的链接" share: "分享一个到本帖的链接"
bookmark: "给本帖做书签到你的用户页"
more: "更多" more: "更多"
actions: actions:

View File

@ -668,7 +668,6 @@ zh_TW:
delete: "刪除本帖" delete: "刪除本帖"
undelete: "恢複本帖" undelete: "恢複本帖"
share: "分享一個到本帖的鏈接" share: "分享一個到本帖的鏈接"
bookmark: "給本帖做書簽到你的用戶頁"
more: "更多" more: "更多"
actions: actions: