@@ -96,7 +96,7 @@ frappe.ui.form.ControlSelect = frappe.ui.form.ControlData.extend({ | |||||
} | } | ||||
}, | }, | ||||
toggle_placeholder: function() { | toggle_placeholder: function() { | ||||
const input_set = Boolean(this.$input.val()); | |||||
const input_set = Boolean(this.$input.find('option:selected').text()); | |||||
this.$wrapper.find('.placeholder').toggle(!input_set); | this.$wrapper.find('.placeholder').toggle(!input_set); | ||||
} | } | ||||
}); | }); | ||||
@@ -357,7 +357,7 @@ frappe.show_alert = function(message, seconds=7, actions={}) { | |||||
'yellow': "solid-warning", | 'yellow': "solid-warning", | ||||
'blue': "solid-success", | 'blue': "solid-success", | ||||
'green': "solid-success", | 'green': "solid-success", | ||||
'red': "solid-red" | |||||
'red': "solid-error" | |||||
}; | }; | ||||
if (typeof message==='string') { | if (typeof message==='string') { | ||||
@@ -537,7 +537,7 @@ frappe.ui.Page = Class.extend({ | |||||
}, | }, | ||||
get_inner_group_button: function(label) { | get_inner_group_button: function(label) { | ||||
return this.inner_toolbar.find(`.inner-group-button[data-label="${encodeURIComponent(label)}"`); | |||||
return this.inner_toolbar.find(`.inner-group-button[data-label="${encodeURIComponent(label)}"]`); | |||||
}, | }, | ||||
set_inner_btn_group_as_primary: function(label) { | set_inner_btn_group_as_primary: function(label) { | ||||
@@ -88,15 +88,15 @@ export default class WebForm extends frappe.ui.FieldGroup { | |||||
setup_delete_button() { | setup_delete_button() { | ||||
this.add_button_to_header( | this.add_button_to_header( | ||||
'<i class="fa fa-trash" aria-hidden="true"></i>', | |||||
"light", | |||||
frappe.utils.icon('delete'), | |||||
"danger", | |||||
() => this.delete() | () => this.delete() | ||||
); | ); | ||||
} | } | ||||
setup_print_button() { | setup_print_button() { | ||||
this.add_button_to_header( | this.add_button_to_header( | ||||
'<i class="fa fa-print" aria-hidden="true"></i>', | |||||
frappe.utils.icon('print'), | |||||
"light", | "light", | ||||
() => this.print() | () => this.print() | ||||
); | ); | ||||
@@ -0,0 +1,29 @@ | |||||
.form-control { | |||||
border: none; | |||||
font-size: var(--text-md); | |||||
position: relative; | |||||
} | |||||
.form-control.bold { | |||||
font-weight: 500; | |||||
} | |||||
.like-disabled-input { | |||||
.for-description { | |||||
font-weight: normal; | |||||
font-size: var(--text-sm); | |||||
} | |||||
min-height: var(--input-height); | |||||
border-radius: $border-radius; | |||||
font-weight: 400; | |||||
padding: 8px 12px; | |||||
cursor: default; | |||||
color: var(--disabled-text-color); | |||||
background-color: var(--disabled-control-bg); | |||||
} | |||||
.head-title { | |||||
font-size: var(--text-lg); | |||||
font-weight: 700; | |||||
color: var(--heading-color); | |||||
} |
@@ -1,8 +1,4 @@ | |||||
.form-control { | |||||
border: none; | |||||
font-size: var(--text-md); | |||||
position: relative; | |||||
} | |||||
@import "../common/form.scss"; | |||||
.form-section, .form-dashboard-section { | .form-section, .form-dashboard-section { | ||||
margin: 0px; | margin: 0px; | ||||
@@ -82,24 +78,6 @@ | |||||
text-align: right; | text-align: right; | ||||
} | } | ||||
.form-control.bold { | |||||
font-weight: 500; | |||||
} | |||||
.like-disabled-input { | |||||
.for-description { | |||||
font-weight: normal; | |||||
font-size: var(--text-sm); | |||||
} | |||||
min-height: var(--input-height); | |||||
border-radius: $border-radius; | |||||
font-weight: 400; | |||||
padding: 8px 12px; | |||||
cursor: default; | |||||
color: var(--disabled-text-color); | |||||
background-color: var(--disabled-control-bg); | |||||
} | |||||
.form-control:disabled, .form-control[readonly] { | .form-control:disabled, .form-control[readonly] { | ||||
cursor: not-allowed; | cursor: not-allowed; | ||||
} | } | ||||
@@ -43,5 +43,5 @@ | |||||
@import "user_profile"; | @import "user_profile"; | ||||
@import "theme_switcher"; | @import "theme_switcher"; | ||||
@import "link_preview"; | @import "link_preview"; | ||||
@import "quill"; | |||||
@import "../common/quill"; | |||||
@import "plyr"; | @import "plyr"; |
@@ -1,5 +1,5 @@ | |||||
// @import "~bootstrap/scss/bootstrap"; | // @import "~bootstrap/scss/bootstrap"; | ||||
@import './desk/quill'; | |||||
@import './common/quill'; | |||||
@import "./desk/css_variables"; | @import "./desk/css_variables"; | ||||
@@ -1,6 +1,4 @@ | |||||
@import '~quill/dist/quill.core'; | |||||
@import '~quill/dist/quill.snow.css'; | |||||
@import '~quill/dist/quill.bubble.css'; | |||||
@import '../common/quill'; | |||||
@import 'variables'; | @import 'variables'; | ||||
@import '~bootstrap/scss/bootstrap'; | @import '~bootstrap/scss/bootstrap'; | ||||
@import "../common/mixins"; | @import "../common/mixins"; | ||||
@@ -15,6 +13,7 @@ | |||||
@import 'multilevel_dropdown'; | @import 'multilevel_dropdown'; | ||||
@import 'website_image'; | @import 'website_image'; | ||||
@import 'website_avatar'; | @import 'website_avatar'; | ||||
@import 'web_form'; | |||||
@import 'page_builder'; | @import 'page_builder'; | ||||
@import 'blog'; | @import 'blog'; | ||||
@import 'markdown'; | @import 'markdown'; | ||||
@@ -0,0 +1,17 @@ | |||||
@import "../common/form"; | |||||
.web-form-wrapper { | |||||
.form-control { | |||||
color: var(--text-color); | |||||
} | |||||
.form-column { | |||||
&:first-child { | |||||
padding-left: 0; | |||||
} | |||||
&:last-child { | |||||
padding-right: 0; | |||||
} | |||||
} | |||||
} |
@@ -18,7 +18,7 @@ | |||||
{{ item }} | {{ item }} | ||||
{% endfor %} | {% endfor %} | ||||
</div> | </div> | ||||
<div class="more-block {% if not show_more -%} hidden {%- endif %}"> | |||||
<div class="more-block mt-6 {% if not show_more -%} hidden {%- endif %}"> | |||||
<button class="btn btn-light btn-more btn-sm">{{ _("More") }}</button> | <button class="btn btn-light btn-more btn-sm">{{ _("More") }}</button> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -62,7 +62,7 @@ data-web-form="{{ name }}" data-web-form-doctype="{{ doc_type }}" data-login-req | |||||
{% endif %} {# attachments #} | {% endif %} {# attachments #} | ||||
{% if allow_comments and not frappe.form_dict.new and not is_list -%} | {% if allow_comments and not frappe.form_dict.new and not is_list -%} | ||||
<div class="comments"> | |||||
<div class="comments mt-6"> | |||||
<h3>{{ _("Comments") }}</h3> | <h3>{{ _("Comments") }}</h3> | ||||
{% include 'templates/includes/comments/comments.html' %} | {% include 'templates/includes/comments/comments.html' %} | ||||
</div> | </div> | ||||
@@ -12,10 +12,10 @@ from frappe import _ | |||||
import frappe.sessions | import frappe.sessions | ||||
def get_context(context): | def get_context(context): | ||||
# if frappe.session.user == "Guest": | |||||
# frappe.throw(_("Log in to access this page."), frappe.PermissionError) | |||||
# elif frappe.db.get_value("User", frappe.session.user, "user_type") == "Website User": | |||||
# frappe.throw(_("You are not permitted to access this page."), frappe.PermissionError) | |||||
if frappe.session.user == "Guest": | |||||
frappe.throw(_("Log in to access this page."), frappe.PermissionError) | |||||
elif frappe.db.get_value("User", frappe.session.user, "user_type") == "Website User": | |||||
frappe.throw(_("You are not permitted to access this page."), frappe.PermissionError) | |||||
hooks = frappe.get_hooks() | hooks = frappe.get_hooks() | ||||
try: | try: | ||||
@@ -85,7 +85,10 @@ | |||||
<div class="login-button-wrapper"> | <div class="login-button-wrapper"> | ||||
<a href="{{ provider.auth_url }}" | <a href="{{ provider.auth_url }}" | ||||
class="btn btn-block btn-default btn-sm btn-login-option btn-{{ provider.name }}"> | class="btn btn-block btn-default btn-sm btn-login-option btn-{{ provider.name }}"> | ||||
{{ provider.icon }} {{ _("Login With") }} {{ provider.provider_name }}</a> | |||||
{% if provider.icon %} | |||||
{{ provider.icon }} | |||||
{% endif %} | |||||
{{ _("Login With {0}").format(provider.provider_name) }}</a> | |||||
</div> | </div> | ||||
{% endfor %} | {% endfor %} | ||||
<p class="text-muted login-divider">{{ _("or") }}</p> | <p class="text-muted login-divider">{{ _("or") }}</p> | ||||
@@ -25,7 +25,7 @@ def get_context(context): | |||||
redirect_to = get_home_page() | redirect_to = get_home_page() | ||||
else: | else: | ||||
redirect_to = "/app" | redirect_to = "/app" | ||||
if redirect_to != 'login': | if redirect_to != 'login': | ||||
frappe.local.flags.redirect_location = redirect_to | frappe.local.flags.redirect_location = redirect_to | ||||
raise frappe.Redirect | raise frappe.Redirect | ||||
@@ -44,11 +44,13 @@ def get_context(context): | |||||
client_secret = get_decrypted_password("Social Login Key", provider, "client_secret") | client_secret = get_decrypted_password("Social Login Key", provider, "client_secret") | ||||
provider_name = frappe.get_value("Social Login Key", provider, "provider_name") | provider_name = frappe.get_value("Social Login Key", provider, "provider_name") | ||||
if provider_name != "Custom": | |||||
icon_url = frappe.get_value("Social Login Key", provider, "icon") | |||||
icon = "<img src='{0}' alt={1}>".format(icon_url, provider_name) | |||||
else: | |||||
icon = get_icon_html(frappe.get_value("Social Login Key", provider, "icon"), small=True) | |||||
icon = None | |||||
icon_url = frappe.get_value("Social Login Key", provider, "icon") | |||||
if icon_url: | |||||
if provider_name != "Custom": | |||||
icon = "<img src='{0}' alt={1}>".format(icon_url, provider_name) | |||||
else: | |||||
icon = get_icon_html(icon_url, small=True) | |||||
if (get_oauth_keys(provider) and client_secret and client_id and base_url): | if (get_oauth_keys(provider) and client_secret and client_id and base_url): | ||||
context.provider_logins.append({ | context.provider_logins.append({ | ||||
@@ -28,7 +28,7 @@ | |||||
"driver.js": "^0.9.8", | "driver.js": "^0.9.8", | ||||
"express": "^4.17.1", | "express": "^4.17.1", | ||||
"fast-deep-equal": "^2.0.1", | "fast-deep-equal": "^2.0.1", | ||||
"frappe-charts": "^2.0.0-rc5", | |||||
"frappe-charts": "^2.0.0-rc10", | |||||
"frappe-datatable": "^1.15.3", | "frappe-datatable": "^1.15.3", | ||||
"frappe-gantt": "^0.5.0", | "frappe-gantt": "^0.5.0", | ||||
"fuse.js": "^3.4.6", | "fuse.js": "^3.4.6", | ||||
@@ -2467,10 +2467,10 @@ fragment-cache@^0.2.1: | |||||
dependencies: | dependencies: | ||||
map-cache "^0.2.2" | map-cache "^0.2.2" | ||||
frappe-charts@^2.0.0-rc5: | |||||
version "2.0.0-rc5" | |||||
resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc5.tgz#16f5c744c3cdb134a41bb4581ea3c816e6b8601f" | |||||
integrity sha512-4wEsSeGVlEBxr3qA2FF/CTrn+XRjf73txdID+vEBhr22Osc+wcJNhY5sJWFtq4wrihz3WHFnNOTGu+uUNdb0lw== | |||||
frappe-charts@^2.0.0-rc10: | |||||
version "2.0.0-rc10" | |||||
resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc10.tgz#6e4cfbb99eb48374f78c0c048e1b04f278a3848a" | |||||
integrity sha512-qj1yFdBF7e0aW6xES/SK7cb4plimcm63ENG/0HOMKprijNj0V938/v9uhe1lSATvuqu65pPkHNbt93zfCLx9gQ== | |||||
frappe-datatable@^1.15.3: | frappe-datatable@^1.15.3: | ||||
version "1.15.3" | version "1.15.3" | ||||