summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--api/api.go4
-rw-r--r--api/context.go2
-rw-r--r--api/file.go13
-rw-r--r--api/post.go4
-rw-r--r--api/team.go6
-rw-r--r--api/templates/email_change_body.html6
-rw-r--r--api/templates/find_teams_body.html4
-rw-r--r--api/templates/invite_body.html4
-rw-r--r--api/templates/password_change_body.html6
-rw-r--r--api/templates/post_body.html4
-rw-r--r--api/templates/reset_body.html4
-rw-r--r--api/templates/signup_team_body.html4
-rw-r--r--api/templates/verify_body.html4
-rw-r--r--api/templates/welcome_body.html6
-rw-r--r--api/user.go35
-rw-r--r--config/config.json4
-rw-r--r--config/config_docker.json4
-rw-r--r--scripts/README_DEV.md106
-rw-r--r--store/sql_post_store.go2
-rw-r--r--store/sql_post_store_test.go5
-rw-r--r--web/react/components/channel_loader.jsx3
-rw-r--r--web/react/components/create_post.jsx91
-rw-r--r--web/react/components/file_attachment.jsx11
-rw-r--r--web/react/components/member_list.jsx2
-rw-r--r--web/react/components/post.jsx2
-rw-r--r--web/react/components/post_list.jsx13
-rw-r--r--web/react/stores/post_store.jsx17
-rw-r--r--web/react/utils/async_client.jsx12
-rw-r--r--web/react/utils/constants.jsx4
-rw-r--r--web/react/utils/utils.jsx2
-rw-r--r--web/sass-files/sass/partials/_files.scss7
-rw-r--r--web/sass-files/sass/partials/_post.scss6
33 files changed, 179 insertions, 220 deletions
diff --git a/README.md b/README.md
index 55be7bbaf..55d1383a8 100644
--- a/README.md
+++ b/README.md
@@ -131,5 +131,5 @@ To contribute to this open source project please review the Mattermost Contribut
License
-------
-Mattermost is licensed under an "Apache-wrapped AGPL" model, which means you can run and link to the system using Configuration Files and Admin Tools licensed under Apache, version 2.0, as described in the LICENSE file, as an explicit exception to the terms of the GNU Affero General Public License (AGPL) that applies to most of the remaining source files. See individual files for details.
+Mattermost is licensed under an "Apache-wrapped AGPL" model inspired by MongoDB. Similar to MongoDB, you can run and link to the system using Configuration Files and Admin Tools licensed under Apache, version 2.0, as described in the LICENSE file, as an explicit exception to the terms of the GNU Affero General Public License (AGPL) that applies to most of the remaining source files. See individual files for details.
diff --git a/api/api.go b/api/api.go
index 25f3376c6..2ea27ed9f 100644
--- a/api/api.go
+++ b/api/api.go
@@ -16,10 +16,10 @@ var ServerTemplates *template.Template
type ServerTemplatePage Page
-func NewServerTemplatePage(templateName, teamURL string) *ServerTemplatePage {
+func NewServerTemplatePage(templateName, siteURL string) *ServerTemplatePage {
props := make(map[string]string)
props["AnalyticsUrl"] = utils.Cfg.ServiceSettings.AnalyticsUrl
- return &ServerTemplatePage{TemplateName: templateName, SiteName: utils.Cfg.ServiceSettings.SiteName, FeedbackEmail: utils.Cfg.EmailSettings.FeedbackEmail, TeamURL: teamURL, Props: props}
+ return &ServerTemplatePage{TemplateName: templateName, SiteName: utils.Cfg.ServiceSettings.SiteName, FeedbackEmail: utils.Cfg.EmailSettings.FeedbackEmail, SiteURL: siteURL, Props: props}
}
func (me *ServerTemplatePage) Render() string {
diff --git a/api/context.go b/api/context.go
index 16da0a6eb..e3f279e90 100644
--- a/api/context.go
+++ b/api/context.go
@@ -32,7 +32,7 @@ type Page struct {
Title string
SiteName string
FeedbackEmail string
- TeamURL string
+ SiteURL string
Props map[string]string
}
diff --git a/api/file.go b/api/file.go
index 219cf6103..4ec421eb9 100644
--- a/api/file.go
+++ b/api/file.go
@@ -140,11 +140,18 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch
// Create thumbnail
go func() {
+ thumbWidth := float64(utils.Cfg.ImageSettings.ThumbnailWidth)
+ thumbHeight := float64(utils.Cfg.ImageSettings.ThumbnailHeight)
+ imgWidth := float64(imgConfig.Width)
+ imgHeight := float64(imgConfig.Height)
+
var thumbnail image.Image
- if imgConfig.Width > int(utils.Cfg.ImageSettings.ThumbnailWidth) {
- thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.Lanczos3)
- } else {
+ if imgHeight < thumbHeight && imgWidth < thumbWidth {
thumbnail = img
+ } else if imgHeight/imgWidth < thumbHeight/thumbWidth {
+ thumbnail = resize.Resize(0, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.Lanczos3)
+ } else {
+ thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, 0, img, resize.Lanczos3)
}
buf := new(bytes.Buffer)
diff --git a/api/post.go b/api/post.go
index f96320639..f6699d181 100644
--- a/api/post.go
+++ b/api/post.go
@@ -377,7 +377,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, siteURL string) {
location, _ := time.LoadLocation("UTC")
tm := time.Unix(post.CreateAt/1000, 0).In(location)
- subjectPage := NewServerTemplatePage("post_subject", teamURL)
+ subjectPage := NewServerTemplatePage("post_subject", siteURL)
subjectPage.Props["TeamDisplayName"] = teamDisplayName
subjectPage.Props["SubjectText"] = subjectText
subjectPage.Props["Month"] = tm.Month().String()[:3]
@@ -395,7 +395,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, siteURL string) {
continue
}
- bodyPage := NewServerTemplatePage("post_body", teamURL)
+ bodyPage := NewServerTemplatePage("post_body", siteURL)
bodyPage.Props["Nickname"] = profileMap[id].FirstName
bodyPage.Props["TeamDisplayName"] = teamDisplayName
bodyPage.Props["ChannelName"] = channelName
diff --git a/api/team.go b/api/team.go
index 01c8e50b6..e6b8f4e14 100644
--- a/api/team.go
+++ b/api/team.go
@@ -344,8 +344,6 @@ func inviteMembers(c *Context, w http.ResponseWriter, r *http.Request) {
func InviteMembers(c *Context, team *model.Team, user *model.User, invites []string) {
for _, invite := range invites {
if len(invite) > 0 {
- teamURL := ""
- teamURL = c.GetTeamURLFromTeam(team)
sender := user.GetDisplayName()
@@ -356,10 +354,10 @@ func InviteMembers(c *Context, team *model.Team, user *model.User, invites []str
senderRole = "member"
}
- subjectPage := NewServerTemplatePage("invite_subject", teamURL)
+ subjectPage := NewServerTemplatePage("invite_subject", c.GetSiteURL())
subjectPage.Props["SenderName"] = sender
subjectPage.Props["TeamDisplayName"] = team.DisplayName
- bodyPage := NewServerTemplatePage("invite_body", teamURL)
+ bodyPage := NewServerTemplatePage("invite_body", c.GetSiteURL())
bodyPage.Props["TeamDisplayName"] = team.DisplayName
bodyPage.Props["SenderName"] = sender
bodyPage.Props["SenderStatus"] = senderRole
diff --git a/api/templates/email_change_body.html b/api/templates/email_change_body.html
index 439fffd5b..c4e1cf39d 100644
--- a/api/templates/email_change_body.html
+++ b/api/templates/email_change_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -18,7 +18,7 @@
<tr>
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
<h2 style="font-weight: normal; margin-top: 10px;">You updated your email</h2>
- <p>You updated your email for {{.Props.TeamDisplayName}} on {{ .TeamURL }}<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
+ <p>You updated your email for {{.Props.TeamDisplayName}} on {{ .Props.TeamURL }}<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
</td>
</tr>
<tr>
@@ -34,7 +34,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/find_teams_body.html b/api/templates/find_teams_body.html
index a73ed0ad4..bd151a819 100644
--- a/api/templates/find_teams_body.html
+++ b/api/templates/find_teams_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -42,7 +42,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/invite_body.html b/api/templates/invite_body.html
index ad0658e3d..568a0d893 100644
--- a/api/templates/invite_body.html
+++ b/api/templates/invite_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -37,7 +37,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/password_change_body.html b/api/templates/password_change_body.html
index 1d4a6e1c8..6fc9f2822 100644
--- a/api/templates/password_change_body.html
+++ b/api/templates/password_change_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -18,7 +18,7 @@
<tr>
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
<h2 style="font-weight: normal; margin-top: 10px;">You updated your password</h2>
- <p>You updated your password for {{.Props.TeamDisplayName}} on {{ .TeamURL }} by {{.Props.Method}}.<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
+ <p>You updated your password for {{.Props.TeamDisplayName}} on {{ .Props.TeamURL }} by {{.Props.Method}}.<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
</td>
</tr>
<tr>
@@ -34,7 +34,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/post_body.html b/api/templates/post_body.html
index 0aa913db5..a1df5b4c9 100644
--- a/api/templates/post_body.html
+++ b/api/templates/post_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -37,7 +37,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/reset_body.html b/api/templates/reset_body.html
index 4c2fec1e7..a6e6269c0 100644
--- a/api/templates/reset_body.html
+++ b/api/templates/reset_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -37,7 +37,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/signup_team_body.html b/api/templates/signup_team_body.html
index 5e60a042b..71df0b9c8 100644
--- a/api/templates/signup_team_body.html
+++ b/api/templates/signup_team_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -40,7 +40,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/verify_body.html b/api/templates/verify_body.html
index 1a68c16f5..6ba11d845 100644
--- a/api/templates/verify_body.html
+++ b/api/templates/verify_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -37,7 +37,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/templates/welcome_body.html b/api/templates/welcome_body.html
index cc4d95fb1..f16f50e14 100644
--- a/api/templates/welcome_body.html
+++ b/api/templates/welcome_body.html
@@ -9,7 +9,7 @@
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td style="padding: 20px 20px 10px; text-align:left;">
- <img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
+ <img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
</td>
</tr>
<tr>
@@ -18,7 +18,7 @@
<tr>
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
<h2 style="font-weight: normal; margin-top: 10px;">You joined the {{.Props.TeamDisplayName}} team at {{.SiteName}}!</h2>
- <p>Please let me know if you have any questions.<br>Enjoy your stay at <a href="{{.TeamURL}}">{{.SiteName}}</a>.</p>
+ <p>Please let me know if you have any questions.<br>Enjoy your stay at <a href="{{.Props.TeamURL}}">{{.SiteName}}</a>.</p>
</td>
</tr>
<tr>
@@ -34,7 +34,7 @@
<tr>
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
<p style="margin: 25px 0;">
- <img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
+ <img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
</p>
<p style="padding: 0 50px;">
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
diff --git a/api/user.go b/api/user.go
index 66527ca1a..54337e207 100644
--- a/api/user.go
+++ b/api/user.go
@@ -209,14 +209,15 @@ func CreateUser(c *Context, team *model.Team, user *model.User) *model.User {
}
}
-func fireAndForgetWelcomeEmail(name, email, teamDisplayName, link string) {
+func fireAndForgetWelcomeEmail(name, email, teamDisplayName, link, siteURL string) {
go func() {
- subjectPage := NewServerTemplatePage("welcome_subject", link)
- bodyPage := NewServerTemplatePage("welcome_body", link)
+ subjectPage := NewServerTemplatePage("welcome_subject", siteURL)
+ bodyPage := NewServerTemplatePage("welcome_body", siteURL)
bodyPage.Props["Nickname"] = name
bodyPage.Props["TeamDisplayName"] = teamDisplayName
bodyPage.Props["FeedbackName"] = utils.Cfg.EmailSettings.FeedbackName
+ bodyPage.Props["TeamURL"] = link
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
l4g.Error("Failed to send welcome email successfully err=%v", err)
@@ -230,9 +231,9 @@ func FireAndForgetVerifyEmail(userId, userEmail, teamName, teamDisplayName, site
link := fmt.Sprintf("%s/verify_email?uid=%s&hid=%s&teamname=%s&email=%s", siteURL, userId, model.HashPassword(userId), teamName, userEmail)
- subjectPage := NewServerTemplatePage("verify_subject", teamURL)
+ subjectPage := NewServerTemplatePage("verify_subject", siteURL)
subjectPage.Props["TeamDisplayName"] = teamDisplayName
- bodyPage := NewServerTemplatePage("verify_body", teamURL)
+ bodyPage := NewServerTemplatePage("verify_body", siteURL)
bodyPage.Props["TeamDisplayName"] = teamDisplayName
bodyPage.Props["VerifyUrl"] = link
@@ -800,7 +801,7 @@ func updateUser(c *Context, w http.ResponseWriter, r *http.Request) {
l4g.Error(tresult.Err.Message)
} else {
team := tresult.Data.(*model.Team)
- fireAndForgetEmailChangeEmail(rusers[1].Email, team.DisplayName, c.GetTeamURLFromTeam(team))
+ fireAndForgetEmailChangeEmail(rusers[1].Email, team.DisplayName, c.GetTeamURLFromTeam(team), c.GetSiteURL())
}
}
@@ -879,7 +880,7 @@ func updatePassword(c *Context, w http.ResponseWriter, r *http.Request) {
l4g.Error(tresult.Err.Message)
} else {
team := tresult.Data.(*model.Team)
- fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), "using the settings menu")
+ fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), c.GetSiteURL(), "using the settings menu")
}
data := make(map[string]string)
@@ -1069,8 +1070,8 @@ func sendPasswordReset(c *Context, w http.ResponseWriter, r *http.Request) {
link := fmt.Sprintf("%s/reset_password?d=%s&h=%s", c.GetTeamURLFromTeam(team), url.QueryEscape(data), url.QueryEscape(hash))
- subjectPage := NewServerTemplatePage("reset_subject", c.GetTeamURLFromTeam(team))
- bodyPage := NewServerTemplatePage("reset_body", c.GetTeamURLFromTeam(team))
+ subjectPage := NewServerTemplatePage("reset_subject", c.GetSiteURL())
+ bodyPage := NewServerTemplatePage("reset_body", c.GetSiteURL())
bodyPage.Props["ResetUrl"] = link
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
@@ -1160,19 +1161,20 @@ func resetPassword(c *Context, w http.ResponseWriter, r *http.Request) {
c.LogAuditWithUserId(userId, "success")
}
- fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), "using a reset password link")
+ fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), c.GetSiteURL(), "using a reset password link")
props["new_password"] = ""
w.Write([]byte(model.MapToJson(props)))
}
-func fireAndForgetPasswordChangeEmail(email, teamDisplayName, teamURL, method string) {
+func fireAndForgetPasswordChangeEmail(email, teamDisplayName, teamURL, siteURL, method string) {
go func() {
- subjectPage := NewServerTemplatePage("password_change_subject", teamURL)
+ subjectPage := NewServerTemplatePage("password_change_subject", siteURL)
subjectPage.Props["TeamDisplayName"] = teamDisplayName
- bodyPage := NewServerTemplatePage("password_change_body", teamURL)
+ bodyPage := NewServerTemplatePage("password_change_body", siteURL)
bodyPage.Props["TeamDisplayName"] = teamDisplayName
+ bodyPage.Props["TeamURL"] = teamURL
bodyPage.Props["Method"] = method
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
@@ -1182,13 +1184,14 @@ func fireAndForgetPasswordChangeEmail(email, teamDisplayName, teamURL, method st
}()
}
-func fireAndForgetEmailChangeEmail(email, teamDisplayName, teamURL string) {
+func fireAndForgetEmailChangeEmail(email, teamDisplayName, teamURL, siteURL string) {
go func() {
- subjectPage := NewServerTemplatePage("email_change_subject", teamURL)
+ subjectPage := NewServerTemplatePage("email_change_subject", siteURL)
subjectPage.Props["TeamDisplayName"] = teamDisplayName
- bodyPage := NewServerTemplatePage("email_change_body", teamURL)
+ bodyPage := NewServerTemplatePage("email_change_body", siteURL)
bodyPage.Props["TeamDisplayName"] = teamDisplayName
+ bodyPage.Props["TeamURL"] = teamURL
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
l4g.Error("Failed to send update password email successfully err=%v", err)
diff --git a/config/config.json b/config/config.json
index a1e73eb03..10a8b6553 100644
--- a/config/config.json
+++ b/config/config.json
@@ -49,8 +49,8 @@
"S3Region": ""
},
"ImageSettings": {
- "ThumbnailWidth": 200,
- "ThumbnailHeight": 0,
+ "ThumbnailWidth": 120,
+ "ThumbnailHeight": 100,
"PreviewWidth": 1024,
"PreviewHeight": 0,
"ProfileWidth": 128,
diff --git a/config/config_docker.json b/config/config_docker.json
index 6d220f919..c9fa5931a 100644
--- a/config/config_docker.json
+++ b/config/config_docker.json
@@ -49,8 +49,8 @@
"S3Region": ""
},
"ImageSettings": {
- "ThumbnailWidth": 200,
- "ThumbnailHeight": 0,
+ "ThumbnailWidth": 120,
+ "ThumbnailHeight": 100,
"PreviewWidth": 1024,
"PreviewHeight": 0,
"ProfileWidth": 128,
diff --git a/scripts/README_DEV.md b/scripts/README_DEV.md
index be24daad9..a088bbbc2 100644
--- a/scripts/README_DEV.md
+++ b/scripts/README_DEV.md
@@ -1,42 +1,82 @@
-Developer Machine Setup (Mac)
+Developer Machine Setup
-----------------------------
-DOCKER SETUP
+### Mac OS X ###
-1. Follow the instructions at http://docs.docker.com/installation/mac/
- 1. Use the Boot2Docker command-line utility
- 2. If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”`
-2. Get your Docker IP address with `boot2docker ip`
-3. Add a line to your /etc/hosts that goes `<Docker IP> dockerhost`
-4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile
+1. Download and set up Boot2Docker
+ 1. Follow the instructions at http://docs.docker.com/installation/mac/
+ 1. Use the Boot2Docker command-line utility
+ 2. If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”`
+ 2. Get your Docker IP address with `boot2docker ip`
+ 3. Add a line to your /etc/hosts that goes `<Docker IP> dockerhost`
+ 4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile
+2. Download Go from http://golang.org/dl/
+3. Set up your Go workspace
+ 1. `mkdir ~/go`
+ 2. Add the following to your ~/.bash_profile
+ `export GOPATH=$HOME/go`
+ `export PATH=$PATH:$GOPATH/bin`
+ 3. Reload your bash profile
+ `source ~/.bash_profile`
+4. Install Node.js using Homebrew
+ 1. Download Homebrew from http://brew.sh/
+ 2. `brew install node`
+5. Install Compass
+ 1. Make sure you have the latest verison of Ruby
+ 2. `gem install compass`
+6. Download Mattermost
+ `cd ~/go`
+ `mkdir -p src/github.com/mattermost`
+ `cd src/github.com/mattermost`
+ `git clone github.com/mattermost/platform.git`
+ `cd platform`
+7. Run unit tests on Mattermost using `make test` to make sure the installation was successful
+8. If tests passed, you can now run Mattermost using `make run`
Any issues? Please let us know on our forums at: http://forum.mattermost.org
-GO SETUP
+### Ubuntu ###
-1. Download Go from http://golang.org/dl/
-
-NODE.JS SETUP
-
-1. Install homebrew from http://brew.sh
-2. `brew install node`
-
-COMPASS SETUP
-
-1. Make sure you have the latest version of Ruby
-2. `gem install compass`
-
-MATTERMOST SETUP
-
-1. Make a project directory for Mattermost, which we'll call **$PROJECT** for the rest of these instructions
-2. Make a `go` directory in your $PROJECT directory
-3. Open or create your ~/.bash_profile and add the following lines:
- `export GOPATH=$PROJECT/go`
- `export PATH=$PATH:$GOPATH/bin`
- then refresh your bash profile with `source ~/.bash_profile`
-4. Then use `cd $GOPATH` and `mkdir -p src/github.com/mattermost` then cd into this directory and run `git clone github.com/mattermost/platform.git`
-5. If you do not have Mercurial, download it with: `brew install mercurial`
-6. Then do `cd platform` and `make test`. Provided the test runs fine, you now have a complete build environment.
-7. Use `make run` to run your code
+1. Download Docker
+ 1. Follow the instructions at https://docs.docker.com/installation/ubuntulinux/ or use the summary below:
+ `sudo apt-get update`
+ `sudo apt-get install wget`
+ `wget -qO- https://get.docker.com/ | sh`
+ `sudo usermod -aG docker <username>`
+ `sudo service docker start`
+ `newgrp docker`
+2. Set up your dockerhost address
+ 1. Edit your /etc/hosts file to include the following line
+ `127.0.0.1 dockerhost`
+3. Install build essentials
+ 1. `apt-get install build-essential`
+4. Download Go from http://golang.org/dl/
+5. Set up your Go workspace and add Go to the PATH
+ 1. `mkdir ~/go`
+ 2. Add the following to your ~/.bashrc
+ `export GOPATH=$HOME/go`
+ `export GOROOT=/usr/local/go`
+ `export PATH=$PATH:$GOROOT/bin`
+ 3. Reload your bashrc
+ `source ~/.bashrc`
+6. Install Node.js
+ 1. Download the newest version of the Node.js sources from https://nodejs.org/download/
+ 2. Extract the contents of the package and cd into the extracted files
+ 3. Compile and install Node.js
+ `./configure`
+ `make`
+ `make install`
+7. Install Ruby and Compass
+ `apt-get install ruby`
+ `apt-get install ruby-dev`
+ `gem install compass`
+8. Download Mattermost
+ `cd ~/go`
+ `mkdir -p src/github.com/mattermost`
+ `cd src/github.com/mattermost`
+ `git clone github.com/mattermost/platform.git`
+ `cd platform`
+9. Run unit tests on Mattermost using `make test` to make sure the installation was successful
+10. If tests passed, you can now run Mattermost using `make run`
Any issues? Please let us know on our forums at: http://forum.mattermost.org
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index ede69d125..479caf838 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -401,7 +401,7 @@ func (s SqlPostStore) Search(teamId string, userId string, terms string, isHasht
Id = ChannelId AND TeamId = $1
AND UserId = $2
AND DeleteAt = 0)
- AND %s @@ plainto_tsquery($3)
+ AND %s @@ to_tsquery($3)
ORDER BY CreateAt DESC
LIMIT 100`, searchType)
diff --git a/store/sql_post_store_test.go b/store/sql_post_store_test.go
index d1639aa03..336a20d98 100644
--- a/store/sql_post_store_test.go
+++ b/store/sql_post_store_test.go
@@ -483,4 +483,9 @@ func TestPostStoreSearch(t *testing.T) {
if len(r8.Order) != 0 {
t.Fatal("returned wrong serach result")
}
+
+ r9 := (<-store.Post().Search(teamId, userId, "mattermost jersey", false)).Data.(*model.PostList)
+ if len(r9.Order) != 2 {
+ t.Fatal("returned wrong search result")
+ }
}
diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx
index b7cb248db..6b80f6012 100644
--- a/web/react/components/channel_loader.jsx
+++ b/web/react/components/channel_loader.jsx
@@ -8,6 +8,7 @@
var BrowserStore = require('../stores/browser_store.jsx');
var AsyncClient = require('../utils/async_client.jsx');
var SocketStore = require('../stores/socket_store.jsx');
+var ChannelStore = require('../stores/channel_store.jsx');
var Constants = require('../utils/constants.jsx');
module.exports = React.createClass({
@@ -15,7 +16,7 @@ module.exports = React.createClass({
/* Start initial aysnc loads */
AsyncClient.getMe();
- AsyncClient.getPosts(true);
+ AsyncClient.getPosts(true, ChannelStore.getCurrentId(), Constants.POST_CHUNK_SIZE);
AsyncClient.getChannels(true, true);
AsyncClient.getChannelExtraInfo(true);
AsyncClient.findTeams();
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index 327520210..76286eb88 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -31,11 +31,6 @@ module.exports = React.createClass({
post.message = this.state.messageText;
- // if this is a reply, trim off any carets from the beginning of a message
- if (this.state.rootId && post.message[0] === "^") {
- post.message = post.message.replace(/^\^+\s*/g, "");
- }
-
if (post.message.trim().length === 0 && this.state.previews.length === 0) {
return;
}
@@ -73,9 +68,6 @@ module.exports = React.createClass({
post.channel_id = this.state.channel_id;
post.filenames = this.state.previews;
- post.root_id = this.state.rootId;
- post.parent_id = this.state.parentId;
-
client.createPost(post, ChannelStore.getCurrent(),
function(data) {
PostStore.storeDraft(data.channel_id, null);
@@ -92,12 +84,7 @@ module.exports = React.createClass({
}.bind(this),
function(err) {
var state = {}
-
- if (err.message === "Invalid RootId parameter") {
- if ($('#post_deleted').length > 0) $('#post_deleted').modal('show');
- } else {
- state.server_error = err.message;
- }
+ state.server_error = err.message;
state.submitting = false;
this.setState(state);
@@ -106,17 +93,6 @@ module.exports = React.createClass({
}
$(".post-list-holder-by-time").perfectScrollbar('update');
-
- if (this.state.rootId || this.state.parentId) {
- this.setState({rootId: "", parentId: "", caretCount: 0});
-
- // clear the active thread since we've now sent our message
- AppDispatcher.handleViewAction({
- type: ActionTypes.RECEIVED_ACTIVE_THREAD_CHANGED,
- root_id: "",
- parent_id: ""
- });
- }
},
componentDidUpdate: function() {
this.resizePostHolder();
@@ -138,62 +114,6 @@ module.exports = React.createClass({
this.resizePostHolder();
this.setState({messageText: messageText});
- // look to see if the message begins with any carets to indicate that it's a reply
- var replyMatch = messageText.match(/^\^+/g);
- if (replyMatch) {
- // the number of carets indicates how many message threads back we're replying to
- var caretCount = replyMatch[0].length;
-
- // note that if someone else replies to this thread while a user is typing a reply, the message to which they're replying
- // won't change unless they change the number of carets. this is probably the desired behaviour since we don't want the
- // active message thread to change without the user noticing
- if (caretCount != this.state.caretCount) {
- this.setState({caretCount: caretCount});
-
- var posts = PostStore.getCurrentPosts();
-
- var rootId = "";
-
- // find the nth most recent post that isn't a comment on another (ie it has no parent) where n is caretCount
- for (var i = 0; i < posts.order.length; i++) {
- var postId = posts.order[i];
-
- if (posts.posts[postId].parent_id === "") {
- caretCount -= 1;
-
- if (caretCount < 1) {
- rootId = postId;
- break;
- }
- }
- }
-
- // only dispatch an event if something changed
- if (rootId != this.state.rootId) {
- // set the parent id to match the root id so that we're replying to the first post in the thread
- var parentId = rootId;
-
- // alert the post list so that it can display the active thread
- AppDispatcher.handleViewAction({
- type: ActionTypes.RECEIVED_ACTIVE_THREAD_CHANGED,
- root_id: rootId,
- parent_id: parentId
- });
- }
- }
- } else {
- if (this.state.caretCount > 0) {
- this.setState({caretCount: 0});
-
- // clear the active thread since there no longer is one
- AppDispatcher.handleViewAction({
- type: ActionTypes.RECEIVED_ACTIVE_THREAD_CHANGED,
- root_id: "",
- parent_id: ""
- });
- }
- }
-
var draft = PostStore.getCurrentDraft();
if (!draft) {
draft = {}
@@ -256,12 +176,10 @@ module.exports = React.createClass({
},
componentDidMount: function() {
ChannelStore.addChangeListener(this._onChange);
- PostStore.addActiveThreadChangedListener(this._onActiveThreadChanged);
this.resizePostHolder();
},
componentWillUnmount: function() {
ChannelStore.removeChangeListener(this._onChange);
- PostStore.removeActiveThreadChangedListener(this._onActiveThreadChanged);
},
_onChange: function() {
var channel_id = ChannelStore.getCurrentId();
@@ -278,11 +196,6 @@ module.exports = React.createClass({
this.setState({ channel_id: channel_id, messageText: messageText, initialText: messageText, submitting: false, limit_error: null, server_error: null, post_error: null, previews: previews, uploadsInProgress: uploadsInProgress });
}
},
- _onActiveThreadChanged: function(rootId, parentId) {
- // note that we register for our own events and set the state from there so we don't need to manually set
- // our state and dispatch an event each time the active thread changes
- this.setState({"rootId": rootId, "parentId": parentId});
- },
getInitialState: function() {
PostStore.clearDraftUploads();
@@ -293,7 +206,7 @@ module.exports = React.createClass({
previews = draft['previews'];
messageText = draft['message'];
}
- return { channel_id: ChannelStore.getCurrentId(), messageText: messageText, uploadsInProgress: 0, previews: previews, submitting: false, initialText: messageText, caretCount: 0 };
+ return { channel_id: ChannelStore.getCurrentId(), messageText: messageText, uploadsInProgress: 0, previews: previews, submitting: false, initialText: messageText };
},
setUploads: function(val) {
var oldInProgress = this.state.uploadsInProgress
diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx
index 3cd791887..b7ea5734f 100644
--- a/web/react/components/file_attachment.jsx
+++ b/web/react/components/file_attachment.jsx
@@ -2,6 +2,7 @@
// See License.txt for license information.
var utils = require('../utils/utils.jsx');
+var Constants = require('../utils/constants.jsx');
module.exports = React.createClass({
displayName: "FileAttachment",
@@ -44,6 +45,16 @@ module.exports = React.createClass({
$(imgDiv).removeClass('post__load');
$(imgDiv).addClass('post__image');
+ var width = this.width || $(this).width();
+ var height = this.height || $(this).height();
+
+ if (width < Constants.THUMBNAIL_WIDTH
+ && height < Constants.THUMBNAIL_HEIGHT) {
+ $(imgDiv).addClass('small');
+ } else {
+ $(imgDiv).addClass('normal');
+ }
+
var re1 = new RegExp(' ', 'g');
var re2 = new RegExp('\\(', 'g');
var re3 = new RegExp('\\)', 'g');
diff --git a/web/react/components/member_list.jsx b/web/react/components/member_list.jsx
index a37392f96..69da5cfc3 100644
--- a/web/react/components/member_list.jsx
+++ b/web/react/components/member_list.jsx
@@ -13,7 +13,7 @@ module.exports = React.createClass({
var message = "";
if (members.length === 0)
- message = <span>No users to add or manage.</span>;
+ message = <span>No users to add.</span>;
return (
<div className="member-list-holder">
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index e3586ecde..e72a2d001 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -83,7 +83,7 @@ module.exports = React.createClass({
<img className="post-profile-img" src={"/api/v1/users/" + post.user_id + "/image?time=" + timestamp} height="36" width="36" />
</div>
: null }
- <div className={"post__content" + (this.props.isActiveThread ? " active-thread__content" : "")}>
+ <div className="post__content">
<PostHeader ref="header" post={post} sameRoot={this.props.sameRoot} commentCount={commentCount} handleCommentClick={this.handleCommentClick} isLastComment={this.props.isLastComment} />
<PostBody post={post} sameRoot={this.props.sameRoot} parentPost={parentPost} posts={posts} handleCommentClick={this.handleCommentClick} />
<PostInfo ref="info" post={post} sameRoot={this.props.sameRoot} commentCount={commentCount} handleCommentClick={this.handleCommentClick} allowReply="true" />
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 46f77660d..3f59d5843 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -22,8 +22,7 @@ function getStateFromStores() {
return {
post_list: PostStore.getCurrentPosts(),
- channel: channel,
- activeThreadRootId: ""
+ channel: channel
};
}
@@ -52,7 +51,6 @@ module.exports = React.createClass({
ChannelStore.addChangeListener(this._onChange);
UserStore.addStatusesChangeListener(this._onTimeChange);
SocketStore.addChangeListener(this._onSocketChange);
- PostStore.addActiveThreadChangedListener(this._onActiveThreadChanged);
$(".post-list-holder-by-time").perfectScrollbar();
@@ -133,7 +131,6 @@ module.exports = React.createClass({
ChannelStore.removeChangeListener(this._onChange);
UserStore.removeStatusesChangeListener(this._onTimeChange);
SocketStore.removeChangeListener(this._onSocketChange);
- PostStore.removeActiveThreadChangedListener(this._onActiveThreadChanged);
$('body').off('click.userpopover');
},
resize: function() {
@@ -232,9 +229,6 @@ module.exports = React.createClass({
this.refs[id].forceUpdateInfo();
}
},
- _onActiveThreadChanged: function(rootId, parentId) {
- this.setState({"activeThreadRootId": rootId});
- },
getMorePosts: function(e) {
e.preventDefault();
@@ -429,12 +423,9 @@ module.exports = React.createClass({
// it is the last comment if it is last post in the channel or the next post has a different root post
var isLastComment = utils.isComment(post) && (i === 0 || posts[order[i-1]].root_id != post.root_id);
- // check if this is part of the thread that we're currently replying to
- var isActiveThread = this.state.activeThreadRootId && (post.id === this.state.activeThreadRootId || post.root_id === this.state.activeThreadRootId);
-
var postCtl = (
<Post ref={post.id} sameUser={sameUser} sameRoot={sameRoot} post={post} parentPost={parentPost} key={post.id}
- posts={posts} hideProfilePic={hideProfilePic} isLastComment={isLastComment} isActiveThread={isActiveThread}
+ posts={posts} hideProfilePic={hideProfilePic} isLastComment={isLastComment}
/>
);
diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx
index 0745fcdc3..ecf54ede6 100644
--- a/web/react/stores/post_store.jsx
+++ b/web/react/stores/post_store.jsx
@@ -18,7 +18,6 @@ var SEARCH_TERM_CHANGE_EVENT = 'search_term_change';
var SELECTED_POST_CHANGE_EVENT = 'selected_post_change';
var MENTION_DATA_CHANGE_EVENT = 'mention_data_change';
var ADD_MENTION_EVENT = 'add_mention';
-var ACTIVE_THREAD_CHANGED_EVENT = 'active_thread_changed';
var PostStore = assign({}, EventEmitter.prototype, {
@@ -94,18 +93,6 @@ var PostStore = assign({}, EventEmitter.prototype, {
this.removeListener(ADD_MENTION_EVENT, callback);
},
- emitActiveThreadChanged: function(rootId, parentId) {
- this.emit(ACTIVE_THREAD_CHANGED_EVENT, rootId, parentId);
- },
-
- addActiveThreadChangedListener: function(callback) {
- this.on(ACTIVE_THREAD_CHANGED_EVENT, callback);
- },
-
- removeActiveThreadChangedListener: function(callback) {
- this.removeListener(ACTIVE_THREAD_CHANGED_EVENT, callback);
- },
-
getCurrentPosts: function() {
var currentId = ChannelStore.getCurrentId();
@@ -211,10 +198,6 @@ PostStore.dispatchToken = AppDispatcher.register(function(payload) {
case ActionTypes.RECIEVED_ADD_MENTION:
PostStore.emitAddMention(action.id, action.username);
break;
- case ActionTypes.RECEIVED_ACTIVE_THREAD_CHANGED:
- PostStore.emitActiveThreadChanged(action.root_id, action.parent_id);
- break;
-
default:
}
});
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 00bd83ed1..dc4fc1096 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -272,17 +272,23 @@ module.exports.search = function(terms) {
);
}
-module.exports.getPosts = function(force, id) {
+module.exports.getPosts = function(force, id, maxPosts) {
if (PostStore.getCurrentPosts() == null || force) {
var channelId = id ? id : ChannelStore.getCurrentId();
if (isCallInProgress("getPosts_"+channelId)) return;
var post_list = PostStore.getCurrentPosts();
+
+ if (!maxPosts) { maxPosts = Constants.POST_CHUNK_SIZE * Constants.MAX_POST_CHUNKS };
+
// if we already have more than POST_CHUNK_SIZE posts,
// let's get the amount we have but rounded up to next multiple of POST_CHUNK_SIZE,
- // with a max at 180
- var numPosts = post_list && post_list.order.length > 0 ? Math.min(180, Constants.POST_CHUNK_SIZE * Math.ceil(post_list.order.length / Constants.POST_CHUNK_SIZE)) : Constants.POST_CHUNK_SIZE;
+ // with a max at maxPosts
+ var numPosts = Math.min(maxPosts, Constants.POST_CHUNK_SIZE);
+ if (post_list && post_list.order.length > 0) {
+ numPosts = Math.min(maxPosts, Constants.POST_CHUNK_SIZE * Math.ceil(post_list.order.length / Constants.POST_CHUNK_SIZE));
+ }
if (channelId != null) {
callTracker["getPosts_"+channelId] = utils.getTimestamp();
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index 77ce19530..2b0976afd 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -18,7 +18,6 @@ module.exports = {
RECIEVED_POST_SELECTED: null,
RECIEVED_MENTION_DATA: null,
RECIEVED_ADD_MENTION: null,
- RECEIVED_ACTIVE_THREAD_CHANGED: null,
RECIEVED_PROFILES: null,
RECIEVED_ME: null,
@@ -52,9 +51,12 @@ module.exports = {
MAX_DISPLAY_FILES: 5,
MAX_UPLOAD_FILES: 5,
MAX_FILE_SIZE: 50000000, // 50 MB
+ THUMBNAIL_WIDTH: 128,
+ THUMBNAIL_HEIGHT: 100,
DEFAULT_CHANNEL: 'town-square',
OFFTOPIC_CHANNEL: 'off-topic',
POST_CHUNK_SIZE: 60,
+ MAX_POST_CHUNKS: 3,
RESERVED_TEAM_NAMES: [
"www",
"web",
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 09240bf06..a759cc579 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -750,7 +750,7 @@ module.exports.switchChannel = function(channel, teammate_name) {
AsyncClient.getChannels(true, true, true);
AsyncClient.getChannelExtraInfo(true);
- AsyncClient.getPosts(true, channel.id);
+ AsyncClient.getPosts(true, channel.id, Constants.POST_CHUNK_SIZE);
$('.inner__wrap').removeClass('move--right');
$('.sidebar--left').removeClass('move--right');
diff --git a/web/sass-files/sass/partials/_files.scss b/web/sass-files/sass/partials/_files.scss
index ea7548267..ddc5e98bb 100644
--- a/web/sass-files/sass/partials/_files.scss
+++ b/web/sass-files/sass/partials/_files.scss
@@ -129,7 +129,12 @@
height: 100%;
background-color: #FFF;
background-repeat: no-repeat;
- background-position: top left;
+ &.small {
+ background-position: center;
+ }
+ &.normal {
+ background-position: top left;
+ }
}
.post-image__thumbnail {
width: 50%;
diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss
index df565d763..98b17120d 100644
--- a/web/sass-files/sass/partials/_post.scss
+++ b/web/sass-files/sass/partials/_post.scss
@@ -319,12 +319,6 @@ body.ios {
max-width: 100%;
@include legacy-pie-clearfix;
}
- &.active-thread__content {
- // this still needs a final style applied to it
- & .post-body {
- font-weight: bold;
- }
- }
}
.post-image__columns {
@include legacy-pie-clearfix;