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

Merge branch 'settings' into settings-keep-history

parents e6777421 54390ffb
No related branches found
No related tags found
No related merge requests found
Showing with 150 additions and 71 deletions
......@@ -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")
......
......@@ -24,6 +24,7 @@ Template.message.helpers
when 'uj' then t('User_joined_channel', { user: this.u.username })
when 'wm' then t('Welcome', { user: this.u.username })
when 'rtc' then RocketChat.callbacks.run 'renderRtcMessage', this
when 'rm' then t('Message_removed', { user: this.u.username })
else
this.html = this.msg
if _.trim(this.html) isnt ''
......@@ -33,7 +34,17 @@ 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']
canEdit: ->
return RocketChat.settings.get 'Message_AllowEditing'
canDelete: ->
return RocketChat.settings.get 'Message_AllowDeleting'
showEditedStatus: ->
return RocketChat.settings.get 'Message_ShowEditedStatus'
showDeletedStatus: ->
return RocketChat.settings.get 'Message_ShowDeletedStatus'
Template.message.onViewRendered = (context) ->
......
......@@ -5,10 +5,16 @@
<span class="info">
<span class="time">{{time}}</span>
{{#if ets}}
{{#if showEditedStatus}}
<span class="edited">({{_ "edited"}})</span>
{{/if}}
{{/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}}}
......
......@@ -19,48 +19,48 @@ Template.body.onRendered ->
f.parentNode.insertBefore j, f
metaLanguageComputation = Tracker.autorun ->
if RocketChat.settings.get 'Meta:language'
if RocketChat.settings.get 'Meta_language'
metaLanguageComputation?.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'
metaFBComputation = Tracker.autorun ->
if RocketChat.settings.get 'Meta:fb:app_id'
if RocketChat.settings.get 'Meta_fb_app_id'
metaFBComputation?.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'
metaRobotsComputation = Tracker.autorun ->
if RocketChat.settings.get 'Meta:robots'
if RocketChat.settings.get 'Meta_robots'
metaRobotsComputation?.stop()
Meta.set
name: 'name'
property: 'robots'
content: RocketChat.settings.get 'Meta:robots'
content: RocketChat.settings.get 'Meta_robots'
metaGoogleComputation = Tracker.autorun ->
if RocketChat.settings.get 'Meta:google-site-verification'
if RocketChat.settings.get 'Meta_google-site-verification'
metaGoogleComputation?.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'
metaMSValidateComputation = Tracker.autorun ->
if RocketChat.settings.get 'Meta:msvalidate.01'
if RocketChat.settings.get 'Meta_msvalidate01'
metaMSValidateComputation?.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'
......
......@@ -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",
......@@ -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",
......
......@@ -98,11 +98,11 @@
"Members_List" : "Λίστα μελών",
"Members_placeholder" : "Μέλη",
"Message" : "Μήνυμα",
"Message_Edit" : "Επιτρέπεται επεξεργασία μηνυμάτων",
"Message_Delete" : "Επιτρέπεται διαγραφή μηνυμάτων",
"Message_AllowEditing" : "Επιτρέπεται επεξεργασία μηνυμάτων",
"Message_AllowDeleting" : "Επιτρέπεται διαγραφή μηνυμάτων",
"Message_ShowEditedStatus" : "Εμφάνιση Επεξεργασμένης Κατάστασης",
"Message_ShowDeletedStatus" : "Εμφάνιση Διαγραμμένης Κατάστασης",
"Message_KeepStatusHistory" : "Κρατήστε ιστορικό κατάστασης",
"Message_KeepHistoryOfEdits" : "Κρατήστε ιστορικό κατάστασης",
"Meta_language" : "Γλώσσα",
"Meta_fb_app_id" : "Facebook APP ID",
"Meta_robots" : "Ρομπότ",
......@@ -176,7 +176,6 @@
"SMTP_Host" : "SMTP Host",
"SMTP_Password" : "SMTP Κωδικός",
"SMTP_Port" : "SMTP Θύρα",
"SMTP_Security" : "SMTP Ασφάλεια",
"SMTP_Username" : "SMTP Όνομα χρήστη",
"Start_of_conversation" : "Αρχή της συνομιλίας",
"strike" : "σβήσιμο",
......
......@@ -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",
......@@ -40,18 +40,18 @@
"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",
......@@ -59,8 +59,8 @@
"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",
......@@ -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",
......@@ -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_KeepHistoryOfEdits" : "Keep Status 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",
......@@ -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",
......@@ -176,7 +179,6 @@
"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",
......@@ -195,11 +197,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",
......@@ -215,10 +217,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"
}
\ No newline at end of file
......@@ -98,8 +98,8 @@
"Members_List" : "Jäsenlista",
"Members_placeholder" : "Jäsenet",
"Message" : "Viesti",
"Message_Edit" : "Salli viestin muokkaus",
"Message_Delete" : "Salli viestin poisto",
"Message_AllowEditing" : "Salli viestin muokkaus",
"Message_AllowDeleting" : "Salli viestin poisto",
"Meta_language" : "Kieli",
"Meta_fb_app_id" : "Facebook APP ID",
"More_channels" : "Lisää kanavia",
......@@ -169,7 +169,6 @@
"SMTP_Host" : "SMTP-palvelin",
"SMTP_Password" : "SMTP Salasana",
"SMTP_Port" : "SMTP-portti",
"SMTP_Security" : "SMTP Salaus",
"SMTP_Username" : "SMTP Käyttäjätunnus",
"Start_of_conversation" : "Keskustelun alku",
"strike" : "yliviivaa",
......
......@@ -95,8 +95,8 @@
"Members_List" : "Lista Članova",
"Members_placeholder" : "Članovi",
"Message" : "Poruka",
"Message_Edit" : "Dopusti Uređivanje Poruka",
"Message_Delete" : "Dopusti Brisanje Poruka",
"Message_AllowEditing" : "Dopusti Uređivanje Poruka",
"Message_AllowDeleting" : "Dopusti Brisanje Poruka",
"Message_ShowDeletedStatus" : "Pokaži Izbrisan status",
"Meta_language" : "Jezik",
"Meta_fb_app_id" : "Facebook App-ID",
......@@ -162,7 +162,6 @@
"since_creation" : "%s",
"SMTP_Password" : "SMTP lozinka",
"SMTP_Port" : "SMTP port",
"SMTP_Security" : "SMTP sigurnost",
"SMTP_Username" : "SMTP korisničko ime",
"Start_of_conversation" : "Početak razgovora",
"strike" : "precrtaj",
......
......@@ -96,11 +96,11 @@
"Members_List" : "Lista użytkowników",
"Members_placeholder" : "Członkowie",
"Message" : "Wiadomość",
"Message_Edit" : "Pozwól edytować wiadomość",
"Message_Delete" : "Pozwól usunąć wiadomość",
"Message_AllowEditing" : "Pozwól edytować wiadomość",
"Message_AllowDeleting" : "Pozwól usunąć wiadomość",
"Message_ShowEditedStatus" : "Pokaż zmieniony status",
"Message_ShowDeletedStatus" : "Pokaż usunięty status",
"Message_KeepStatusHistory" : "Zachowaj historię statusu",
"Message_KeepHistoryOfEdits" : "Zachowaj historię statusu",
"More_channels" : "Więcej kanałów",
"Msgs" : "Wiadomości",
"multi" : "multi",
......
......@@ -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")
......
......@@ -24,6 +24,7 @@ Template.message.helpers
when 'nu' then t('User_added', { user_added: this.u.username })
when 'uj' then tr('User_joined_channel', { context: this.u.gender }, { 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
......@@ -35,7 +36,16 @@ 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']
canEdit: ->
return RocketChat.settings.get 'Message_AllowEditing'
canDelete: ->
return RocketChat.settings.get 'Message_AllowDeleting'
showEditedStatus: ->
return RocketChat.settings.get 'Message_ShowEditedStatus'
showDeletedStatus: ->
return RocketChat.settings.get 'Message_ShowDeletedStatus'
Template.message.onViewRendered = (context) ->
......
......@@ -5,10 +5,16 @@
<span class="info">
<span class="time">{{time}}</span>
{{#if ets}}
{{#if showEditedStatus}}
<span class="edited">({{_ "edited"}})</span>
{{/if}}
{{/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}}}
......
......@@ -10,16 +10,15 @@ Meteor.startup ->
RocketChat.settings.addGroup 'SMTP'
RocketChat.settings.add 'SMTP_Host', '', { type: 'string', group: 'SMTP' }
RocketChat.settings.add 'SMTP_Port', '', { type: 'string', group: 'SMTP' }
RocketChat.settings.add 'SMTP_Security', '', { type: 'string', group: 'SMTP' }
RocketChat.settings.add 'SMTP_Username', '', { type: 'string', group: 'SMTP' }
RocketChat.settings.add 'SMTP_Password', '', { type: 'string', group: 'SMTP' }
RocketChat.settings.addGroup 'Message'
RocketChat.settings.add 'Message_Edit', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_Delete', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_ShowEditedStatus', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_ShowDeletedStatus', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_KeepStatusHistory', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_AllowEditing', true, { type: 'boolean', group: 'Message' }
RocketChat.settings.add 'Message_AllowDeleting', true, { type: 'boolean', group: 'Message' }
RocketChat.settings.add 'Message_ShowEditedStatus', true, { type: 'boolean', group: 'Message' }
RocketChat.settings.add 'Message_ShowDeletedStatus', false, { type: 'boolean', group: 'Message' }
RocketChat.settings.add 'Message_KeepHistoryOfEdits', false, { type: 'boolean', group: 'Message' }
RocketChat.settings.add 'Message_MaxAllowedSize', 5000, { type: 'int', group: 'Message', public: true }
RocketChat.settings.addGroup 'Meta'
......@@ -45,3 +44,8 @@ Meteor.startup ->
RocketChat.settings.addGroup 'Layout'
RocketChat.settings.add 'Layout_Home_Title', 'Home', { type: 'string', group: 'Layout', public: true }
RocketChat.settings.add 'Layout_Home_Body', 'Welcome to Rocket.Chat <br> Go to APP SETTINGS -> Layout to customize this intro.', { type: 'string', multiline: true, group: 'Layout', public: true }
if process?.env? and not process.env['MAIL_URL']? and RocketChat.settings.get('SMTP_Host') and RocketChat.settings.get('SMTP_Username') and RocketChat.settings.get('SMTP_Password')
process.env['MAIL_URL'] = encodeURIComponent(RocketChat.settings.get('SMTP_Username')) + ':' + encodeURIComponent(RocketChat.settings.get('SMTP_Password')) + '@' + encodeURIComponent(RocketChat.settings.get('SMTP_Host'))
if RocketChat.settings.get('SMTP_Port')
process.env['MAIL_URL'] += ':' + parseInt(RocketChat.settings.get('SMTP_Port'))
Meteor.startup ->
Migrations.add
version: 14
up: ->
# Remove unused settings
Settings.remove { _id: "API_Piwik_URL" }
Settings.remove { _id: "API_Piwik_ID" }
Settings.remove { _id: "Message_Edit" }
Settings.remove { _id: "Message_Delete" }
Settings.remove { _id: "Message_KeepStatusHistory" }
Settings.update { _id: "Message_ShowEditedStatus" }, { $set: { type: "boolean", value: true } }
Settings.update { _id: "Message_ShowDeletedStatus" }, { $set: { type: "boolean", value: false } }
metaKeys = [
'old': 'Meta:language'
'new': 'Meta_language'
,
'old': 'Meta:fb:app_id'
'new': 'Meta_fb_app_id'
,
'old': 'Meta:robots'
'new': 'Meta_robots'
,
'old': 'Meta:google-site-verification'
'new': 'Meta_google-site-verification'
,
'old': 'Meta:msvalidate.01'
'new': 'Meta_msvalidate01'
]
for oldAndNew in metaKeys
oldValue = Settings.findOne({_id: oldAndNew.old})?.value
newValue = Settings.findOne({_id: oldAndNew.new})?.value
if oldValue? and not newValue?
Settings.update { _id: oldAndNew.new }, { $set: { value: newValue } }
Settings.remove { _id: oldAndNew.old }
Settings.remove { _id: "SMTP_Security" }
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