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 {
if (this.get('read')) {
result += ' seen';
} else {
result += ' unseen';
}
}
return result;
}.property('read', 'topic.last_read_post_number', 'bookmarked'),
// Custom tooltips for the bookmark icons
bookmarkTooltip: (function() {
bookmarkTooltip: function() {
var topic;
if (this.get('bookmarked')) return Em.String.i18n('bookmarks.created');
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.not_bookmarked');
}).property('read', 'topic.last_read_post_number', 'bookmarked'),
}.property('read', 'topic.last_read_post_number', 'bookmarked'),
bookmarkedChanged: function() {
var post = this;

View file

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

View file

@ -38,7 +38,7 @@ Discourse.PostMenuView = Discourse.View.extend({
// Trigger re-rendering
needsToRender: function() {
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
renderReplies: function(post, buffer) {
@ -152,13 +152,9 @@ Discourse.PostMenuView = Discourse.View.extend({
renderBookmark: function(post, buffer) {
if (!Discourse.User.current()) return;
var icon = 'bookmark';
if (!this.get('post.bookmarked')) {
icon += '-empty';
}
buffer.push("<button title=\"" +
(Em.String.i18n("post.controls.bookmark")) +
"\" data-action=\"bookmark\" class='bookmark'><i class=\"icon-" + icon + "\"></i></button>");
buffer.push("<button title=\"" + this.get('post.bookmarkTooltip') +
"\" data-action=\"bookmark\" class='bookmark'><div class='" + this.get('post.bookmarkClass') +
"'></div></button>");
},
clickBookmark: function() {

View file

@ -74,11 +74,6 @@
.gutter {
width: 100px;
}
article.boxed {
.read-icon {
left: 750px !important;
}
}
}
}
@ -202,13 +197,6 @@
}
}
@include hover {
.read-icon {
i {
&:before {
font-size: 25px;
}
}
}
section.post-menu-area {
display: block;
}
@ -282,6 +270,25 @@
&.like, &.edit, &.flag, &.delete, &.share, &.bookmark, &.create {
float: right;
}
.read-icon {
&:before {
font-family: "FontAwesome";
content: "\f02e";
}
&.unseen {
&:before {
content: "\f097";
}
}
&.last-read {
color: $red;
}
&.bookmarked {
&:before {
color: $bookmarkColor;
}
}
}
}
button.create {
color: $attention_fg;
@ -484,11 +491,6 @@
position: relative;
font-size: 16px;
line-height: 20px;
@include small-width {
.read-icon {
right: 365px !important;
}
}
.post-select {
@include border-radius-all(4px);
background-color: $light_gray;
@ -504,36 +506,6 @@
padding: 2px 5px;
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 {
max-width: 100%;
}

View file

@ -789,7 +789,6 @@ cs:
delete: "smazat příspěvek"
undelete: "obnovit 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"
actions:

View file

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

View file

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

View file

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

View file

@ -649,7 +649,6 @@ es:
delete: "elimina esta publicación"
undelete: "deshace la eliminación de 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"
actions:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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