Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert remaining email templates to Soy
Building on a change that converted templates used by subclasses of ReplyToChangeSender, convert the remaining email templates. Add a new Soy template datum for abbreviated change subjects, replicating a string manipulation that was formerly implemented inside the ChangeSubject.vm template. Feature: Issue 4345 Change-Id: I1bc5574a45ea60bf74c945a5ed81fe2ea7536e7d
- Loading branch information
1 parent
93ccc93
commit 42639e4
Showing
17 changed files
with
312 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
gerrit-server/src/main/resources/com/google/gerrit/server/mail/AddKey.soy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* Copyright (C) 2016 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
{namespace com.google.gerrit.server.mail.template} | ||
|
||
/** | ||
* The .AddKey template will determine the contents of the email related to | ||
* adding a new SSH or GPG key to an account. | ||
* @param email | ||
*/ | ||
{template .AddKey autoescape="strict" kind="text"} | ||
One or more new {$email.keyType} keys have been added to Gerrit Code Review at | ||
{sp}{$email.gerritHost}: | ||
|
||
{\n} | ||
{\n} | ||
|
||
{if $email.sshKey} | ||
{$email.sshKey} | ||
{elseif $email.gpgKeys} | ||
{$email.gpgKeys} | ||
{/if} | ||
|
||
{\n} | ||
{\n} | ||
|
||
If this is not expected, please contact your Gerrit Administrators | ||
immediately. | ||
|
||
{\n} | ||
{\n} | ||
|
||
You can also manage your {$email.keyType} keys by visiting | ||
{\n} | ||
{if $email.sshKey} | ||
{$email.gerritUrl}#/settings/ssh-keys | ||
{elseif $email.gpgKeys} | ||
{$email.gerritUrl}#/settings/gpg-keys | ||
{/if} | ||
{\n} | ||
{if $email.userNameEmail} | ||
(while signed in as {$email.userNameEmail}) | ||
{else} | ||
(while signed in as {$email.email}) | ||
{/if} | ||
|
||
{\n} | ||
{\n} | ||
|
||
If clicking the link above does not work, copy and paste the URL in a new | ||
browser window instead. | ||
|
||
{\n} | ||
{\n} | ||
|
||
This is a send-only email address. Replies to this message will not be read | ||
or answered. | ||
{/template} |
61 changes: 0 additions & 61 deletions
61
gerrit-server/src/main/resources/com/google/gerrit/server/mail/AddKey.vm
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
gerrit-server/src/main/resources/com/google/gerrit/server/mail/ChangeFooter.soy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright (C) 2016 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
{namespace com.google.gerrit.server.mail.template} | ||
|
||
/** | ||
* The .ChangeFooter template will determine the contents of the footer text | ||
* that will be appended to ALL emails related to changes. | ||
* @param branch | ||
* @param change | ||
* @param changeId | ||
* @param email | ||
* @param messageClass | ||
* @param patchSet | ||
* @param projectName | ||
*/ | ||
{template .ChangeFooter autoescape="strict" kind="text"} | ||
--{sp} | ||
{\n} | ||
|
||
{if $email.changeUrl} | ||
To view, visit {$email.changeUrl}{\n} | ||
{/if} | ||
|
||
{if $email.settingsUrl} | ||
To unsubscribe, visit {$email.settingsUrl}{\n} | ||
{/if} | ||
|
||
{if $email.changeUrl or $email.settingsUrl} | ||
{\n} | ||
{/if} | ||
|
||
Gerrit-MessageType: {$messageClass}{\n} | ||
Gerrit-Change-Id: {$changeId}{\n} | ||
Gerrit-PatchSet: {$patchSet.patchSetId}{\n} | ||
Gerrit-Project: {$projectName}{\n} | ||
Gerrit-Branch: {$branch.shortName}{\n} | ||
Gerrit-Owner: {$change.ownerEmail}{\n} | ||
{/template} |
52 changes: 0 additions & 52 deletions
52
gerrit-server/src/main/resources/com/google/gerrit/server/mail/ChangeFooter.vm
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
gerrit-server/src/main/resources/com/google/gerrit/server/mail/ChangeSubject.soy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright (C) 2016 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
{namespace com.google.gerrit.server.mail.template} | ||
|
||
/** | ||
* The .ChangeSubject template will determine the contents of the email subject | ||
* line for ALL emails related to changes. | ||
* @param branch | ||
* @param change | ||
* @param shortProjectName | ||
*/ | ||
{template .ChangeSubject autoescape="strict" kind="text"} | ||
Change in {$shortProjectName}[{$branch.shortName}]: {$change.shortSubject} | ||
{/template} |
Oops, something went wrong.