Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings #495

Merged
merged 7 commits into from
Aug 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/lib/chatMessages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class @ChatMessages
return -1

edit: (element, index) ->
return unless RocketChat.settings.get 'Message_AllowEditing'
return if element.classList.contains("system")
this.clearEditing()
id = element.getAttribute("id")
Expand Down Expand Up @@ -94,7 +95,7 @@ class @ChatMessages
update: (id, rid, input) ->
if _.trim(input.value) isnt ''
msg = input.value
Meteor.call 'updateMessage', { id: id, msg: msg }
Meteor.call 'updateMessage', { _id: id, msg: msg, rid: rid }
this.clearEditing()
this.stopTyping(rid)

Expand Down
2 changes: 1 addition & 1 deletion client/methods/updateMessage.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Meteor.methods
,
$set:
ets: message.ets
msg: message.msg
msg: message.msg
4 changes: 2 additions & 2 deletions client/stylesheets/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -2191,14 +2191,14 @@ a.github-fork {
display: none;
cursor: pointer;
}
&.own:hover .edit-message {
&.own:hover:not(.system) .edit-message {
display: inline-block;
}
.delete-message {
display: none;
cursor: pointer;
}
&.own:hover .delete-message {
&.own:hover:not(.system) .delete-message {
display: inline-block;
}
.user {
Expand Down
14 changes: 11 additions & 3 deletions client/views/app/message.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Template.message.helpers

own: ->
return 'own' if this.u?._id is Meteor.userId()
return 'own' if this.u?._id is Meteor.userId()

time: ->
return moment(this.ts).format('HH:mm')
Expand All @@ -23,6 +23,7 @@ Template.message.helpers
when 'nu' then t('User_added', { user_added: this.u.username })
when 'uj' then t('User_joined_channel', { user: this.u.username })
when 'wm' then t('Welcome', { user: this.u.username })
when 'rm' then t('Message_removed', { user: this.u.username })
when 'rtc' then RocketChat.callbacks.run 'renderRtcMessage', this
else
this.html = this.msg
Expand All @@ -33,8 +34,15 @@ Template.message.helpers
return this.html

system: ->
return 'system' if this.t in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj']

return 'system' if this.t in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj', 'rm']
edited: ->
return @ets and @t not in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj', 'rm']
canEdit: ->
return RocketChat.settings.get 'Message_AllowEditing'
canDelete: ->
return RocketChat.settings.get 'Message_AllowDeleting'
showEditedStatus: ->
return RocketChat.settings.get 'Message_ShowEditedStatus'

Template.message.onViewRendered = (context) ->
view = this
Expand Down
6 changes: 5 additions & 1 deletion client/views/app/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
<a class="user user-card-message" href="#" data-username="{{u.username}}" tabindex="1">{{u.username}}</a>
<span class="info">
<span class="time">{{time}}</span>
{{#if ets}}
{{#if edited}}
<span class="edited">({{_ "edited"}})</span>
{{/if}}
{{#if canEdit}}
<i class="icon-pencil edit-message"></i>
{{/if}}
{{#if canDelete}}
<i class="icon-trash-1 delete-message"></i>
{{/if}}
</span>
<div class="body" dir="auto">
{{{body}}}
Expand Down
27 changes: 16 additions & 11 deletions client/views/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,53 @@ Template.body.onRendered ->
f.parentNode.insertBefore j, f

Tracker.autorun (c) ->
if RocketChat.settings.get 'Meta:language'
if RocketChat.settings.get 'Meta_language'
c.stop()

Meta.set
name: 'http-equiv'
property: 'content-language'
content: RocketChat.settings.get 'Meta:language'
content: RocketChat.settings.get 'Meta_language'
Meta.set
name: 'name'
property: 'language'
content: RocketChat.settings.get 'Meta:language'
content: RocketChat.settings.get 'Meta_language'

Tracker.autorun (c) ->
if RocketChat.settings.get 'Meta:fb:app_id'
if RocketChat.settings.get 'Meta_fb_app_id'
c.stop()

Meta.set
name: 'property'
property: 'fb:app_id'
content: RocketChat.settings.get 'Meta:fb:app_id'
content: RocketChat.settings.get 'Meta_fb_app_id'

Tracker.autorun (c) ->
if RocketChat.settings.get 'Meta:robots'
if RocketChat.settings.get 'Meta_robots'
c.stop()

Meta.set
name: 'name'
property: 'robots'
content: RocketChat.settings.get 'Meta:robots'
content: RocketChat.settings.get 'Meta_robots'

Tracker.autorun (c) ->
if RocketChat.settings.get 'Meta:google-site-verification'
if RocketChat.settings.get 'Meta_google-site-verification'
c.stop()

Meta.set
name: 'name'
property: 'google-site-verification'
content: RocketChat.settings.get 'Meta:google-site-verification'
content: RocketChat.settings.get 'Meta_google-site-verification'

Tracker.autorun (c) ->
if RocketChat.settings.get 'Meta:msvalidate.01'
if RocketChat.settings.get 'Meta_msvalidate01'
c.stop()

Meta.set
name: 'name'
property: 'msvalidate.01'
content: RocketChat.settings.get 'Meta:msvalidate.01'
content: RocketChat.settings.get 'Meta_msvalidate01'

if Meteor.isCordova
$(document.body).addClass 'is-cordova'
Expand Down
4 changes: 2 additions & 2 deletions client/views/settings/settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Template.settings.events

if not _.isEmpty updateSettings
RocketChat.settings.batchSet updateSettings, (err, success) ->
return toastr.error TAPi18next.t 'Error_updating_settings' if err
toastr.success TAPi18next.t 'Settings_updated'
return toastr.error TAPi18next.t 'project:Error_updating_settings' if err
toastr.success TAPi18next.t 'project:Settings_updated'

Template.settings.onRendered ->
Tracker.afterFlush ->
Expand Down
5 changes: 2 additions & 3 deletions i18n/de.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
"Members_List" : "Mitgliederliste",
"Members_placeholder" : "Mitglieder",
"Message" : "Nachricht",
"Message_Edit" : "Erlaube Bearbeitung von Nachrichten",
"Message_Delete" : "Erlaube Nachrichten zu löschen",
"Message_AllowEditing" : "Erlaube Bearbeitung von Nachrichten",
"Message_AllowDeleting" : "Erlaube Nachrichten zu löschen",
"Message_ShowEditedStatus" : "Zeige Bearbeitungsstatus",
"Message_ShowDeletedStatus" : "Zeige Löschstatus",
"Meta_language" : "Sprache",
Expand Down Expand Up @@ -175,7 +175,6 @@
"SMTP_Host" : "SMTP Host",
"SMTP_Password" : "SMTP Passwort",
"SMTP_Port" : "SMTP Port",
"SMTP_Security" : "SMTP Sicherheit",
"SMTP_Username" : "SMTP Benutzername",
"Start_of_conversation" : "Beginn der Konversation",
"strike" : "durchgestrichen",
Expand Down
7 changes: 3 additions & 4 deletions i18n/el.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
"Members_List" : "Λίστα μελών",
"Members_placeholder" : "Μέλη",
"Message" : "Μήνυμα",
"Message_Edit" : "Επιτρέπεται επεξεργασία μηνυμάτων",
"Message_Delete" : "Επιτρέπεται διαγραφή μηνυμάτων",
"Message_AllowEditing" : "Επιτρέπεται επεξεργασία μηνυμάτων",
"Message_AllowDeleting" : "Επιτρέπεται διαγραφή μηνυμάτων",
"Message_ShowEditedStatus" : "Εμφάνιση Επεξεργασμένης Κατάστασης",
"Message_ShowDeletedStatus" : "Εμφάνιση Διαγραμμένης Κατάστασης",
"Message_KeepStatusHistory" : "Κρατήστε ιστορικό κατάστασης",
"Message_KeepHistory" : "Κρατήστε ιστορικό κατάστασης",
"Meta_language" : "Γλώσσα",
"Meta_fb_app_id" : "Facebook APP ID",
"Meta_robots" : "Ρομπότ",
Expand Down Expand Up @@ -176,7 +176,6 @@
"SMTP_Host" : "SMTP Host",
"SMTP_Password" : "SMTP Κωδικός",
"SMTP_Port" : "SMTP Θύρα",
"SMTP_Security" : "SMTP Ασφάλεια",
"SMTP_Username" : "SMTP Όνομα χρήστη",
"Start_of_conversation" : "Αρχή της συνομιλίας",
"strike" : "σβήσιμο",
Expand Down
75 changes: 39 additions & 36 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
"Add_Members" : "Add Members",
"Add_users" : "Add users",
"All_channels" : "All channels",
"and" : "and",
"API_Analytics" : "Analytics",
"API_Embed" : "Embed",
"App_Settings" : "App Settings",
"Avatar_changed_successfully" : "Avatar changed successfully",
"and" : "and",
"are_also_typing" : "are also typing",
"are_typing" : "are typing",
"Are_you_sure" : "Are you sure?",
"Avatar_changed_successfully" : "Avatar changed successfully",
"away" : "away",
"away_male" : "away",
"away_female" : "away",
"Away" : "Away",
"Away_male" : "Away",
"away_female" : "away",
"Away_female" : "Away",
"away_male" : "away",
"Away_male" : "Away",
"Back_to_login" : "Back to login",
"bold" : "bold",
"busy" : "busy",
"busy_male" : "busy",
"busy_female" : "busy",
"Busy" : "Busy",
"Busy_male" : "Busy",
"busy_female" : "busy",
"Busy_female" : "Busy",
"Back_to_login" : "Back to login",
"bold" : "bold",
"busy_male" : "busy",
"Busy_male" : "Busy",
"Cancel" : "Cancel",
"Change_avatar" : "Change avatar",
"Channels" : "Channels",
Expand All @@ -40,27 +40,27 @@
"Conversation" : "Conversation",
"Create_new" : "Create new",
"Create_new_direct_message_room" : "Create a new direct message room",
"Create_new_public_channel" : "Create a new public channel",
"Create_new_private_group" : "Create a new private group",
"Create_new_public_channel" : "Create a new public channel",
"Created_at" : "Created at",
"Direct_Messages" : "Direct Messages",
"Deleted" : "Deleted!",
"Direct_Messages" : "Direct Messages",
"Drop_to_upload_file" : "Drop to upload file",
"Duplicate_private_group_name" : "A Private Group with name '%s' exists",
"Duplicate_channel_name" : "A Channel with name '%s' exists",
"Duplicate_private_group_name" : "A Private Group with name '%s' exists",
"edited" : "edited",
"Email_already_exists" : "Email already exists",
"Email_or_username" : "Email or username",
"Email_verified" : "Email verified",
"Email_already_exists" : "Email already exists",
"Enter_info" : "Enter your information",
"Error_changing_password" : "Password changed",
"False" : "False",
"Favorites" : "Favorites",
"Follow_social_profiles" : "Follow our social profiles, fork us on github and share your thoughts about the rocket.chat app on our trello board.",
"Forgot_password" : "Forgot your password",
"Fork_it_on_github" : "Fork it on github",
"github_no_public_email" : "You don't have any email as public email in your GitHub account",
"Get_to_know_the_team" : "Get to know the Rocket.Team",
"github_no_public_email" : "You don't have any email as public email in your GitHub account",
"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",
"History" : "History",
Expand All @@ -73,18 +73,20 @@
"invisible" : "invisible",
"Invisible" : "Invisible",
"is_also_typing" : "is also typing",
"is_also_typing_male" : "is also typing",
"is_also_typing_female" : "is also typing",
"is_also_typing_male" : "is also typing",
"is_typing" : "is typing",
"is_typing_male" : "is typing",
"is_typing_female" : "is typing",
"is_typing_male" : "is typing",
"italics" : "italics",
"join" : "Join",
"Join_the_Community" : "Join the Community",
"Language" : "Language",
"Language_Version" : "English Version",
"Last_message" : "Last message",
"Last_login" : "Last login",
"Last_message" : "Last message",
"Layout_Home_Body": "Home Body",
"Layout_Home_Title": "Home Title",
"Leave_room" : "Leave room",
"line" : "line",
"Load_more" : "Load more",
Expand All @@ -98,16 +100,17 @@
"Members_List" : "Members List",
"Members_placeholder" : "Members",
"Message" : "Message",
"Message_Edit" : "Allow Message Editing",
"Message_Delete" : "Allow Message Deleting",
"Message_ShowEditedStatus" : "Show Edited Status",
"Message_AllowDeleting" : "Allow Message Deleting",
"Message_AllowEditing" : "Allow Message Editing",
"Message_KeepHistory" : "Keep Message History",
"Message_removed" : "Message removed",
"Message_ShowDeletedStatus" : "Show Deleted Status",
"Message_KeepStatusHistory" : "Keep Status History",
"Meta_language" : "Language",
"Message_ShowEditedStatus" : "Show Edited Status",
"Meta_fb_app_id" : "Facebook APP ID",
"Meta_robots" : "Robots",
"Meta_google-site-verification" : "Google Site Verification",
"Meta_language" : "Language",
"Meta_msvalidate01" : "MSValidate.01",
"Meta_robots" : "Robots",
"More_channels" : "More channels",
"Msgs" : "Msgs",
"multi" : "multi",
Expand Down Expand Up @@ -137,15 +140,15 @@
"Profile" : "Profile",
"Profile_saved_successfully" : "Profile saved successfully",
"Proudly_developed" : "Proudly developed with Meteor",
"Push_apn_cert" : "APN Cert",
"Push_apn_dev_cert" : "APN Dev Cert",
"Push_apn_dev_key" : "APN Dev Key",
"Push_apn_dev_passphrase" : "APN Dev Passphrase",
"Push_apn_key" : "APN Key",
"Push_apn_passphrase" : "APN Passphrase",
"Push_debug" : "Debug",
"Push_enable" : "Enable",
"Push_production" : "Production",
"Push_apn_passphrase" : "APN Passphrase",
"Push_apn_key" : "APN Key",
"Push_apn_cert" : "APN Cert",
"Push_apn_dev_passphrase" : "APN Dev Passphrase",
"Push_apn_dev_key" : "APN Dev Key",
"Push_apn_dev_cert" : "APN Dev Cert",
"Quick_Search" : "Quick Search",
"quote" : "quote",
"Recents" : "Recents",
Expand All @@ -169,14 +172,14 @@
"Send_confirmation_email" : "Send confirmation email",
"Send_Message" : "Send Message",
"Settings" : "Settings",
"Settings_updated" : "Settings updated",
"Showing_online_users" : "Showing <b>__total_online__</b> of __total__ users",
"Showing_results" : "<p>Showing <b>%s</b> results</p>",
"Silence" : "Silence",
"since_creation" : "since %s",
"SMTP_Host" : "SMTP Host",
"SMTP_Password" : "SMTP Password",
"SMTP_Port" : "SMTP Port",
"SMTP_Security" : "SMTP Security",
"SMTP_Username" : "SMTP Username",
"Start_of_conversation" : "Start of conversation",
"strike" : "strike",
Expand All @@ -195,11 +198,11 @@
"User_has_been_activated" : "User has been activated",
"User_has_been_deactivated" : "User has been deactivated",
"User_joined_channel" : "Has joined the channel.",
"User_joined_channel_male" : "Has joined the channel.",
"User_joined_channel_female" : "Has joined the channel.",
"User_joined_channel_male" : "Has joined the channel.",
"User_left" : "User <em>__user_left__</em> left.",
"User_left_male" : "User <em>__user_left__</em> left.",
"User_left_female" : "User <em>__user_left__</em> left.",
"User_left_male" : "User <em>__user_left__</em> left.",
"User_logged_out" : "User is logged out",
"User_removed_by" : "User <em>__user_removed__</em> removed by <em>__user_by__</em>.",
"User_Settings" : "User Settings",
Expand All @@ -215,10 +218,10 @@
"Welcome" : "Welcome <em>%s</em>.",
"Welcome_to_the" : "Welcome to the",
"With_whom" : "With whom",
"Yes_delete_it" : "Yes, delete it!",
"you_are_in_preview_mode_of" : "You are in preview mode of channel #<strong>__room_name__</strong>",
"You_neeed_confirm_email" : "You need to confirm your email to login!",
"Your_Open_Source_solution" : "Your own Open Source chat solution",
"You_will_not_be_able_to_recover" : "You will not be able to recover!",
"Yes_delete_it" : "Yes, delete it!",
"Your_entry_has_been_deleted" : "Your entry has been deleted."
"Your_entry_has_been_deleted" : "Your entry has been deleted.",
"Your_Open_Source_solution" : "Your own Open Source chat solution"
}
Loading