Skip to content

Commit ad55a0d

Browse files
Added DFP customizations to Frappe, all related to aef_site
1 parent f1a3903 commit ad55a0d

File tree

8 files changed

+75
-57
lines changed

8 files changed

+75
-57
lines changed

frappe/public/css/email.css

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,175 @@
11
/* csslint ignore:start */
22
/* palette colors*/
3-
body {
3+
.frappe body {
44
line-height: 1.5;
55
color: #36414c;
66
}
7-
p {
7+
.frappe p {
88
margin: 1em 0 !important;
99
}
10-
hr {
10+
.frappe hr {
1111
border-top: 1px solid #d1d8dd;
1212
}
13-
.body-table {
13+
.frappe .body-table {
1414
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
1515
}
16-
.body-table td {
16+
.frappe .body-table td {
1717
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
1818
}
19-
.email-header,
20-
.email-body,
21-
.email-footer {
19+
.frappe .email-header,
20+
.frappe .email-body,
21+
.frappe .email-footer {
2222
width: 100% !important;
2323
min-width: 100% !important;
2424
}
25-
.email-body {
25+
.frappe .email-body {
2626
font-size: 14px;
2727
}
28-
.email-footer {
28+
.frappe .email-footer {
2929
border-top: 1px solid #d1d8dd;
3030
font-size: 12px;
3131
}
32-
.email-header {
32+
.frappe .email-header {
3333
border: 1px solid #d1d8dd;
3434
border-radius: 4px 4px 0 0;
3535
}
36-
.email-header .brand-image {
36+
.frappe .email-header .brand-image {
3737
width: 24px;
3838
height: 24px;
3939
display: block;
4040
}
41-
.email-header-title {
41+
.frappe .email-header-title {
4242
font-weight: bold;
4343
}
44-
.body-table.has-header .email-body {
44+
.frappe .body-table.has-header .email-body {
4545
border: 1px solid #d1d8dd;
4646
border-radius: 0 0 4px 4px;
4747
border-top: none;
4848
}
49-
.body-table.has-header .email-footer {
49+
.frappe .body-table.has-header .email-footer {
5050
border-top: none;
5151
}
52-
.email-footer-container {
52+
.frappe .email-footer-container {
5353
margin-top: 30px;
5454
}
55-
.email-footer-container > div:not(:last-child) {
55+
.frappe .email-footer-container > div:not(:last-child) {
5656
margin-bottom: 5px;
5757
}
58-
.email-unsubscribe a {
58+
.frappe .email-unsubscribe a {
5959
color: #8d99a6;
6060
text-decoration: underline;
6161
}
62-
.btn {
62+
.frappe .btn {
6363
text-decoration: none;
6464
padding: 7px 10px;
6565
font-size: 12px;
6666
border: 1px solid;
6767
border-radius: 3px;
6868
}
69-
.btn.btn-default {
69+
.frappe .btn.btn-default {
7070
color: #fff;
7171
background-color: #f0f4f7;
7272
border-color: transparent;
7373
}
74-
.btn.btn-primary {
74+
.frappe .btn.btn-primary {
7575
color: #fff;
7676
background-color: #5e64ff;
7777
border-color: #444bff;
7878
}
79-
.table {
79+
.frappe .table {
8080
width: 100%;
8181
border-collapse: collapse;
8282
}
83-
.table td,
84-
.table th {
83+
.frappe .table td,
84+
.frappe .table th {
8585
padding: 8px;
8686
line-height: 1.42857143;
8787
vertical-align: top;
8888
border-top: 1px solid #d1d8dd;
8989
text-align: left;
9090
}
91-
.table th {
91+
.frappe .table th {
9292
font-weight: bold;
9393
}
94-
.table > thead > tr > th {
94+
.frappe .table > thead > tr > th {
9595
vertical-align: middle;
9696
border-bottom: 2px solid #d1d8dd;
9797
}
98-
.table > thead:first-child > tr:first-child > th {
98+
.frappe .table > thead:first-child > tr:first-child > th {
9999
border-top: none;
100100
}
101-
.table.table-bordered {
101+
.frappe .table.table-bordered {
102102
border: 1px solid #d1d8dd;
103103
}
104-
.table.table-bordered td,
105-
.table.table-bordered th {
104+
.frappe .table.table-bordered td,
105+
.frappe .table.table-bordered th {
106106
border: 1px solid #d1d8dd;
107107
}
108-
.more-info {
108+
.frappe .more-info {
109109
font-size: 80% !important;
110110
color: #8d99a6 !important;
111111
border-top: 1px solid #ebeff2;
112112
padding-top: 10px;
113113
}
114-
.text-right {
114+
.frappe .text-right {
115115
text-align: right !important;
116116
}
117-
.text-center {
117+
.frappe .text-center {
118118
text-align: center !important;
119119
}
120-
.text-muted {
120+
.frappe .text-muted {
121121
color: #8d99a6 !important;
122122
}
123-
.text-extra-muted {
123+
.frappe .text-extra-muted {
124124
color: #d1d8dd !important;
125125
}
126-
.text-regular {
126+
.frappe .text-regular {
127127
font-size: 14px;
128128
}
129-
.text-medium {
129+
.frappe .text-medium {
130130
font-size: 12px;
131131
}
132-
.text-small {
132+
.frappe .text-small {
133133
font-size: 10px;
134134
}
135-
.text-bold {
135+
.frappe .text-bold {
136136
font-weight: bold;
137137
}
138-
.indicator {
138+
.frappe .indicator {
139139
width: 8px;
140140
height: 8px;
141141
border-radius: 8px;
142142
background-color: #b8c2cc;
143143
display: inline-block;
144144
margin-right: 5px;
145145
}
146-
.indicator.indicator-blue {
146+
.frappe .indicator.indicator-blue {
147147
background-color: #5e64ff;
148148
}
149-
.indicator.indicator-green {
149+
.frappe .indicator.indicator-green {
150150
background-color: #98d85b;
151151
}
152-
.indicator.indicator-orange {
152+
.frappe .indicator.indicator-orange {
153153
background-color: #ffa00a;
154154
}
155-
.indicator.indicator-red {
155+
.frappe .indicator.indicator-red {
156156
background-color: #ff5858;
157157
}
158-
.indicator.indicator-yellow {
158+
.frappe .indicator.indicator-yellow {
159159
background-color: #feef72;
160160
}
161-
.screenshot {
161+
.frappe .screenshot {
162162
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
163163
border: 1px solid #d1d8dd;
164164
margin: 8px 0;
165165
max-width: 100%;
166166
}
167-
.list-unstyled {
167+
.frappe .list-unstyled {
168168
list-style-type: none;
169169
padding: 0;
170170
}
171171
/* auto email report */
172-
.report-title {
172+
.frappe .report-title {
173173
margin-bottom: 20px;
174174
}
175-
/* csslint ignore:end */
175+
/* csslint ignore:end */

frappe/public/js/frappe/chat.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,9 @@ frappe.chat.emoji = function (fn) {
10441044
resolve(frappe.chat.emojis)
10451045
}
10461046
else
1047-
$.get('https://cdn.rawgit.com/frappe/emoji/master/emoji', (data) => {
1047+
// DFP: replace chat emoji url
1048+
// $.get('https://cdn.rawgit.com/frappe/emoji/master/emoji', (data) => {
1049+
$.get('https://raw.githubusercontent.com/frappe/emoji/master/emoji', (data) => {
10481050
frappe.chat.emojis = JSON.parse(data)
10491051

10501052
if ( fn )

frappe/public/js/frappe/form/controls/base_control.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ frappe.ui.form.Control = Class.extend({
8484
&& this.refresh_input
8585
&& this.refresh_input();
8686

87-
var value = this.get_value();
88-
89-
this.show_translatable_button(value);
87+
// DFP: fix issue with translatable fields
88+
// var value = this.get_value();
89+
// this.show_translatable_button(value);
90+
// DFP: replaced "value"
91+
this.show_translatable_button();
9092
},
9193
show_translatable_button(value) {
9294
// Disable translation non-string fields or special string fields
@@ -95,7 +97,9 @@ frappe.ui.form.Control = Class.extend({
9597
|| !this.doc
9698
|| !this.df.translatable
9799
|| !frappe.model.can_write('Translation')
98-
|| !value) return;
100+
// DFP: fix issue with translatable fields: replace "value"
101+
// || !value) return;
102+
|| !this.value) return;
99103

100104
// Disable translation in website
101105
if (!frappe.views || !frappe.views.TranslationManager) return;
@@ -114,7 +118,9 @@ frappe.ui.form.Control = Class.extend({
114118
if (!this.doc.__islocal) {
115119
new frappe.views.TranslationManager({
116120
'df': this.df,
117-
'source_name': value,
121+
// DFP: fix issue with translatable fields: replace "value"
122+
// 'source_name': value,
123+
'source_name': this.value,
118124
'target_language': this.doc.language,
119125
'doc': this.doc
120126
});

frappe/public/less/email.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* csslint ignore:start */
22
@import "variables.less";
33

4+
// DFP: email styles prefixed
5+
.frappe {
46
body {
57
line-height: 1.5;
68
color: @text-color;
@@ -211,3 +213,4 @@ hr {
211213
margin-bottom: 20px;
212214
}
213215
/* csslint ignore:end */
216+
}

frappe/templates/emails/standard.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
</head>
99

1010
<body>
11-
<table class="body-table {% if header %}has-header{% endif %}" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
11+
{#<!-- ".frappe" class to email body to allow work the .frappe prefixed email styles -->#}
12+
<table class="frappe body-table {% if header %}has-header{% endif %}" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
1213
<tr>
1314
<td align="center" valign="top">
1415
<table class="email-container" border="0" cellpadding="0" cellspacing="0"

frappe/utils/redis_wrapper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def set_value(self, key, val, user=None, expires_in_sec=None):
4343

4444
try:
4545
if expires_in_sec:
46-
self.setex(key, pickle.dumps(val), expires_in_sec)
46+
# DFP: Solves Redis issue (setex - value is not an integer or out of range) related to different Redis classes (Redis/StrictRedis)
47+
# self.setex(key, pickle.dumps(val), expires_in_sec)
48+
self.setex(name=key, time=expires_in_sec, value=pickle.dumps(val))
4749
else:
4850
self.set(key, pickle.dumps(val))
4951

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"vue-router": "^2.0.0"
4646
},
4747
"devDependencies": {
48+
"@rollup/plugin-json": "^4.0.2",
4849
"babel-runtime": "^6.26.0",
4950
"chalk": "^2.3.2",
5051
"cypress": "^3.1.1",

package.json.DFP.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DFP: Added rollup/json plugin to allow import .json files
2+
"devDependencies": {
3+
"@rollup/plugin-json": "^4.0.2",

0 commit comments

Comments
 (0)