diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index dcdd7f1b5f9..fbcb3db8a32 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -198,6 +198,9 @@
"Has_more" : "Has more",
"Have_your_own_chat" : "Have your own web chat. Developed with Meteor.com, the Rocket.Chat is a great solution for developers looking forward to build and evolve their own chat platform.",
"Hide_room" : "Hide room",
+ "Hide_Room_Warning": "Are you sure you want to hide the room \"%s\"?",
+ "Hide_Group_Warning": "Are you sure you want to hide the group \"%s\"?",
+ "Hide_Private_Warning": "Are you sure you want to hide the discussion with \"%s\"?",
"History" : "History",
"hours" : "hours",
"Incorrect_Password" : "Incorrect Password",
@@ -256,6 +259,9 @@
"Layout_Sidenav_Footer" : "Side Navigation Footer",
"Layout_Sidenav_Footer_description" : "Footer size is 260 x 70px",
"Layout_Terms_of_Service" : "Terms of Service",
+ "Leave_Room_Warning": "Are you sure you want to leave the room \"%s\"?",
+ "Leave_Group_Warning": "Are you sure you want to leave the group \"%s\"?",
+ "Leave_Private_Warning": "Are you sure you want to leave the discussion with \"%s\"?",
"LDAP" : "LDAP",
"LDAP_Bind_Search" : "Bind Search",
"LDAP_Bind_Search_Description" : "A piece of JSON that governs bind and connection info and is of the form {\"filter\": \"(&(objectCategory=person)(objectclass=user)(memberOf=CN=ROCKET_ACCESS,CN=Users,DC=domain,DC=com)(sAMAccountName=#{username}))\", \"scope\": \"sub\", \"userDN\": \"rocket.service@domain.com\", \"password\": \"urpass\"}",
@@ -611,6 +617,8 @@
"Yes" : "Yes",
"Yes_clear_all" : "Yes, clear all!",
"Yes_delete_it" : "Yes, delete it!",
+ "Yes_hide_it": "Yes, hide it!",
+ "Yes_leave_it": "Yes, leave it!",
"Yes_mute_user" : "Yes, mute user!",
"Yes_remove_user" : "Yes, remove user!",
"you_are_in_preview_mode_of" : "You are in preview mode of channel #__room_name__",
diff --git a/packages/rocketchat-theme/assets/stylesheets/base.less b/packages/rocketchat-theme/assets/stylesheets/base.less
index c8137ee15c4..84cd915490e 100644
--- a/packages/rocketchat-theme/assets/stylesheets/base.less
+++ b/packages/rocketchat-theme/assets/stylesheets/base.less
@@ -3079,6 +3079,15 @@ a.github-fork {
float: left;
color: #444;
margin-right: 10px;
+
+ &.file-delete {
+ float: right;
+ padding-top: 10px;
+ &:hover {
+ color: red;
+ cursor: pointer;
+ }
+ }
}
}
}
diff --git a/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.coffee b/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.coffee
index 1f8b59a0cbf..40690a19086 100644
--- a/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.coffee
+++ b/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.coffee
@@ -2,7 +2,7 @@ roomFiles = new Mongo.Collection 'room_files'
Template.uploadedFilesList.helpers
files: ->
- return roomFiles.find({ rid: @rid }, { sort: {uploadedAt : -1} }).fetch()
+ return roomFiles.find({ rid: @rid }, { sort: { uploadedAt: -1 } }).fetch()
hasFiles: ->
return roomFiles.find({ rid: @rid }).count() > 0
@@ -23,11 +23,40 @@ Template.uploadedFilesList.helpers
escapedName: ->
return s.escapeHTML @name
+ canDelete: ->
+ msg = ChatMessage.findOne { file: { _id: @_id } }
+ if msg
+ return RocketChat.authz.hasAtLeastOnePermission('delete-message', msg.rid) or RocketChat.settings.get('Message_AllowDeleting') and msg.u?._id is Meteor.userId()
+
Template.uploadedFilesList.events
'click .room-file-item': (e, t) ->
if $(e.currentTarget).siblings('.icon-picture').length
e.preventDefault()
+ 'click .icon-trash': (e, t) ->
+ self = this
+ swal {
+ title: TAPi18n.__('Are_you_sure')
+ text: TAPi18n.__('You_will_not_be_able_to_recover_file')
+ type: 'warning'
+ showCancelButton: true
+ confirmButtonColor: '#DD6B55'
+ confirmButtonText: TAPi18n.__('Yes_delete_it')
+ cancelButtonText: TAPi18n.__('Cancel')
+ closeOnConfirm: false
+ html: false
+ }, ->
+ swal
+ title: TAPi18n.__('Deleted')
+ text: TAPi18n.__('Your_file_has_been_deleted')
+ type: 'success'
+ timer: 1000
+ showConfirmButton: false
+
+ msg = ChatMessage.findOne { file: { _id: self._id } }
+ fileCollection.remove self._id, () ->
+ chatMessages[Session.get('openedRoom')].deleteMsg(msg);
+
'scroll .content': _.throttle (e, t) ->
if e.target.scrollTop >= e.target.scrollHeight - e.target.clientHeight
t.limit.set(t.limit.get() + 50)
diff --git a/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.html b/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.html
index 2ac19362308..83a194d4669 100644
--- a/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.html
+++ b/packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.html
@@ -7,6 +7,9 @@
{{#each files}}
-
+ {{#if canDelete}}
+
+ {{/if}}
{{name}}
diff --git a/packages/rocketchat-ui-flextab/i18n/ar.i18n.json b/packages/rocketchat-ui-flextab/i18n/ar.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ar.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/cs.i18n.json b/packages/rocketchat-ui-flextab/i18n/cs.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/cs.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/de.i18n.json b/packages/rocketchat-ui-flextab/i18n/de.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/de.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/el.i18n.json b/packages/rocketchat-ui-flextab/i18n/el.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/el.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/en.i18n.json b/packages/rocketchat-ui-flextab/i18n/en.i18n.json
new file mode 100644
index 00000000000..6ebd19c81e9
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/en.i18n.json
@@ -0,0 +1,6 @@
+{
+ "You_will_not_be_able_to_recover_file" : "You will not be able to recover this file!",
+ "Your_file_has_been_deleted" : "Your file has been deleted.",
+ "Deleted": "Deleted"
+}
+
diff --git a/packages/rocketchat-ui-flextab/i18n/es.i18n.json b/packages/rocketchat-ui-flextab/i18n/es.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/es.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/fa.i18n.json b/packages/rocketchat-ui-flextab/i18n/fa.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/fa.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/fi.i18n.json b/packages/rocketchat-ui-flextab/i18n/fi.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/fi.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/fr.i18n.json b/packages/rocketchat-ui-flextab/i18n/fr.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/fr.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/he.i18n.json b/packages/rocketchat-ui-flextab/i18n/he.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/he.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/hr.i18n.json b/packages/rocketchat-ui-flextab/i18n/hr.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/hr.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/hu.i18n.json b/packages/rocketchat-ui-flextab/i18n/hu.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/hu.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/it.i18n.json b/packages/rocketchat-ui-flextab/i18n/it.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/it.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ja.i18n.json b/packages/rocketchat-ui-flextab/i18n/ja.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ja.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/km.i18n.json b/packages/rocketchat-ui-flextab/i18n/km.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/km.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ko.i18n.json b/packages/rocketchat-ui-flextab/i18n/ko.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ko.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ku.i18n.json b/packages/rocketchat-ui-flextab/i18n/ku.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ku.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/lo.i18n.json b/packages/rocketchat-ui-flextab/i18n/lo.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/lo.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ms-MY.i18n.json b/packages/rocketchat-ui-flextab/i18n/ms-MY.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ms-MY.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/nl.i18n.json b/packages/rocketchat-ui-flextab/i18n/nl.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/nl.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/pl.i18n.json b/packages/rocketchat-ui-flextab/i18n/pl.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/pl.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/pt.i18n.json b/packages/rocketchat-ui-flextab/i18n/pt.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/pt.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ro.i18n.json b/packages/rocketchat-ui-flextab/i18n/ro.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ro.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ru.i18n.json b/packages/rocketchat-ui-flextab/i18n/ru.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ru.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/sq.i18n.json b/packages/rocketchat-ui-flextab/i18n/sq.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/sq.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/sr.i18n.json b/packages/rocketchat-ui-flextab/i18n/sr.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/sr.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/sv.i18n.json b/packages/rocketchat-ui-flextab/i18n/sv.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/sv.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ta-IN.i18n.json b/packages/rocketchat-ui-flextab/i18n/ta-IN.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ta-IN.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/tr.i18n.json b/packages/rocketchat-ui-flextab/i18n/tr.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/tr.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/ug.i18n.json b/packages/rocketchat-ui-flextab/i18n/ug.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/ug.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/uk.i18n.json b/packages/rocketchat-ui-flextab/i18n/uk.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/uk.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/i18n/zh.i18n.json b/packages/rocketchat-ui-flextab/i18n/zh.i18n.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/packages/rocketchat-ui-flextab/i18n/zh.i18n.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/rocketchat-ui-flextab/package.js b/packages/rocketchat-ui-flextab/package.js
index 98a1b68a2c0..c0dc863caca 100644
--- a/packages/rocketchat-ui-flextab/package.js
+++ b/packages/rocketchat-ui-flextab/package.js
@@ -36,4 +36,15 @@ Package.onUse(function(api) {
api.addFiles('flex-tab/tabs/uploadedFilesList.coffee', 'client');
api.addFiles('flex-tab/tabs/userInfo.coffee', 'client');
+ // TAPi18n
+ var _ = Npm.require('underscore');
+ var fs = Npm.require('fs');
+ tapi18nFiles = _.compact(_.map(fs.readdirSync('packages/rocketchat-lib/i18n'), function(filename) {
+ if (fs.statSync('packages/rocketchat-lib/i18n/' + filename).size > 16) {
+ return 'i18n/' + filename;
+ }
+ }));
+ api.use('tap:i18n');
+ api.addFiles(tapi18nFiles);
+
});
diff --git a/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.coffee b/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.coffee
index 4db2d7e0494..d102936a742 100644
--- a/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.coffee
+++ b/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.coffee
@@ -47,18 +47,56 @@ Template.chatRoomItem.events
e.stopPropagation()
e.preventDefault()
- if FlowRouter.getRouteName() in ['channel', 'group', 'direct'] and Session.get('openedRoom') is this.rid
- FlowRouter.go 'home'
-
- Meteor.call 'hideRoom', this.rid
+ rid = this.rid
+ name = this.name
+
+ warnText = switch
+ when this.t == 'c' then 'Hide_Room_Warning'
+ when this.t == 'p' then 'Hide_Group_Warning'
+ when this.t == 'd' then 'Hide_Private_Warning'
+
+
+ swal {
+ title: t('Are_you_sure')
+ text: t(warnText, name)
+ type: 'warning'
+ showCancelButton: true
+ confirmButtonColor: '#DD6B55'
+ confirmButtonText: t('Yes_hide_it')
+ cancelButtonText: t('Cancel')
+ closeOnConfirm: true
+ html: false
+ }, ->
+ if FlowRouter.getRouteName() in ['channel', 'group', 'direct'] and Session.get('openedRoom') is rid
+ FlowRouter.go 'home'
+
+ Meteor.call 'hideRoom', rid
'click .leave-room': (e) ->
e.stopPropagation()
e.preventDefault()
- if FlowRouter.getRouteName() in ['channel', 'group', 'direct'] and Session.get('openedRoom') is this.rid
- FlowRouter.go 'home'
-
- RoomManager.close this.rid
-
- Meteor.call 'leaveRoom', this.rid
+ rid = this.rid
+ name = this.name
+
+ warnText = switch
+ when this.t == 'c' then 'Leave_Room_Warning'
+ when this.t == 'p' then 'Leave_Group_Warning'
+ when this.t == 'd' then 'Leave_Private_Warning'
+ swal {
+ title: t('Are_you_sure')
+ text: t(warnText, name)
+ type: 'warning'
+ showCancelButton: true
+ confirmButtonColor: '#DD6B55'
+ confirmButtonText: t('Yes_leave_it')
+ cancelButtonText: t('Cancel')
+ closeOnConfirm: true
+ html: false
+ }, ->
+ if FlowRouter.getRouteName() in ['channel', 'group', 'direct'] and Session.get('openedRoom') is rid
+ FlowRouter.go 'home'
+
+ RoomManager.close rid
+
+ Meteor.call 'leaveRoom', rid
diff --git a/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.html b/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.html
index 4a45dae2fda..276fad3e500 100644
--- a/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.html
+++ b/packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.html
@@ -6,12 +6,14 @@
{{/if}}
{{name}}
-
-
- {{#if canLeave}}
-
- {{/if}}
-
+ {{#if $not unread}}
+
+
+ {{#if canLeave}}
+
+ {{/if}}
+
+ {{/if}}