Skip to content
Snippets Groups Projects
Commit 8e554e4a authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Final touches

parent 17136926
No related branches found
No related tags found
No related merge requests found
Showing with 43 additions and 28 deletions
.custom-scroll(@background, @thumb, @width: 8px) {
.custom-scroll(@background, @thumb, @width: 8px, @height: 8px) {
&::-webkit-scrollbar {
height: @height;
width: @width;
background: @background;
}
......
......@@ -2,7 +2,7 @@ Meteor.startup ->
RocketChat.MessageAction.addButton
id: 'star-message'
icon: 'icon-star-empty'
i18nLabel: 'rocketchat-message-star:Star_Message'
i18nLabel: 'Star_Message'
action: (event, instance) ->
message = @_arguments[1]
message.starred = Meteor.userId()
......@@ -16,7 +16,7 @@ Meteor.startup ->
RocketChat.MessageAction.addButton
id: 'unstar-message'
icon: 'icon-star'
i18nLabel: 'rocketchat-message-star:Unstar_Message'
i18nLabel: 'Unstar_Message'
action: (event, instance) ->
message = @_arguments[1]
message.starred = false
......
Meteor.startup ->
RocketChat.callbacks.add 'enter-room', ->
console.log 'adding tabbar'
RocketChat.TabBar.addButton({ id: 'starred-messages', i18nTitle: 'rocketchat-message-star:Starred_Messages', icon: 'icon-star', template: 'starredMessages', order: 3 })
RocketChat.TabBar.addButton({ id: 'starred-messages', i18nTitle: 'Starred_Messages', icon: 'icon-star', template: 'starredMessages', order: 3 })
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-star'
Template.starredMessages.helpers
hasMessages: ->
return StarredMessage.find({ rid: Session.get 'openedRoom' }, { sort: { ts: -1 } }).count() > 0
messages: ->
return StarredMessage.find { rid: Session.get 'openedRoom' }, { sort: { ts: -1 } }
......
......@@ -6,9 +6,15 @@
</div>
<ul class="starred-messages-list scrollable">
{{#if Template.subscriptionsReady}}
{{#each messages}}
{{#nrr nrrargs 'message' .}}{{/nrr}}
{{/each}}
{{#if hasMessages}}
{{#each messages}}
{{#nrr nrrargs 'message' .}}{{/nrr}}
{{/each}}
{{else}}
<li class="empty">
{{_ "No_starred_messages"}}
</li>
{{/if}}
{{else}}
{{> loading}}
{{/if}}
......
.starred-messages-list {
margin-top: 30px;
padding: 30px 0;
.message-cog, .starred-messages-list .message-dropdown {
display: none;
......@@ -15,4 +15,10 @@
display: none;
}
}
li.empty {
color: #7f7f7f;
text-align: center;
margin-top: 60px;
}
}
......@@ -2,5 +2,6 @@
"Message_AllowStarring" : "Allow Message Starring",
"Star_Message": "Star Message",
"Unstar_Message": "Remove Star",
"Starred_Messages": "Starred Messages"
}
\ No newline at end of file
"Starred_Messages": "Starred Messages",
"No_starred_messages": "No starred messages"
}
......@@ -2,5 +2,6 @@
"Message_AllowStarring" : "Permitir Mensagens Favoritas",
"Star_Message": "Favoritar Message",
"Unstar_Message": "Remover Favorito",
"Stars": "Mensagens Favoritas"
}
\ No newline at end of file
"No_starred_messages": "Não há mensagens favoritas",
"Starred_Messages": "Mensagens Favoritas"
}
......@@ -10,23 +10,10 @@ Package.onUse(function(api) {
api.use([
'coffeescript',
'less',
'less@2.5.0',
'rocketchat:lib@0.0.1'
]);
// TAPi18n
api.use('templating', 'client');
var _ = Npm.require('underscore');
var fs = Npm.require('fs');
tapi18nFiles = _.compact(_.map(fs.readdirSync('packages/rocketchat-message-star/i18n'), function(filename) {
if (fs.statSync('packages/rocketchat-message-star/i18n/' + filename).size > 16) {
return 'i18n/' + filename;
}
}));
api.use(["tap:i18n@1.5.1"], ["client", "server"]);
api.imply('tap:i18n');
api.addFiles("package-tap.i18n", ["client", "server"]);
api.addFiles([
'client/lib/StarredMessage.coffee',
'client/actionButton.coffee',
......@@ -44,7 +31,17 @@ Package.onUse(function(api) {
'server/startup/indexes.coffee'
], 'server');
// TAPi18n -- needs to be added last
// TAPi18n
api.use('templating', 'client');
var _ = Npm.require('underscore');
var fs = Npm.require('fs');
tapi18nFiles = _.compact(_.map(fs.readdirSync('packages/rocketchat-message-star/i18n'), function(filename) {
if (fs.statSync('packages/rocketchat-message-star/i18n/' + filename).size > 16) {
return 'i18n/' + filename;
}
}));
api.use(["tap:i18n@1.5.1"], ["client", "server"]);
api.imply('tap:i18n');
api.addFiles(tapi18nFiles, ["client", "server"]);
});
......
Meteor.startup ->
RocketChat.settings.add 'Message_AllowStarring', true, { type: 'boolean', group: 'Message', public: true, i18nLabel: "rocketchat-message-star:Message_AllowStarring" }
\ No newline at end of file
RocketChat.settings.add 'Message_AllowStarring', true, { type: 'boolean', group: 'Message', public: true }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment