Skip to content

Commit

Permalink
admin styles
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Mar 20, 2024
1 parent 34ed547 commit 88c821a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/forms/decidim/decidim_awesome/admin/intergram_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class IntergramForm < Decidim::Form
attribute :intro_message, String
attribute :auto_response, String
attribute :auto_no_response, String

def color
super || current_organization.colors["secondary"] || "#E91E63"
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#intergramRoot {
bottom: 3.5rem;
right: -0.5rem;
position: fixed;
z-index: 1000;
width: 100%;

> div {
position: absolute !important;
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import "stylesheets/decidim/decidim_awesome/shared/spinner";
@import "stylesheets/decidim/decidim_awesome/admin/intergram_fixes";
@import "stylesheets/decidim/decidim_awesome/forms/custom_fields";
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<%= f.check_box :require_login, label: t("intergram_require_login", scope: "activemodel.attributes.config") %>
<%= f.check_box :use_floating_button, class: "mb-4", label: t("intergram_use_floating_button", scope: "activemodel.attributes.config"), label_options: { class: "block" } %>
<%= f.color_field :color, value: f.object.color || "#E91E63", class: "mb-4 block w-full p-1", label: t("intergram_color", scope: "activemodel.attributes.config") %>
<%= f.color_field :color, class: "mb-4 block w-full p-1", label: t("intergram_color", scope: "activemodel.attributes.config") %>

<%= f.text_field :title_open, class: "mb-4", label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
<%= f.text_field :title_closed, class: "mb-4", label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
Expand Down Expand Up @@ -48,7 +48,7 @@
</div>

<%= f.check_box :use_floating_button, class: "mb-4", label: t("intergram_use_floating_button", scope: "activemodel.attributes.config") %>
<%= f.color_field :color, value: f.object.color || "#E91E63", class: "mb-4 block w-full p-1", label: t("intergram_color", scope: "activemodel.attributes.config") %>
<%= f.color_field :color, class: "mb-4 block w-full p-1", label: t("intergram_color", scope: "activemodel.attributes.config") %>

<%= f.text_field :title_open, class: "mb-4", label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
<%= f.text_field :title_closed, class: "mb-4", label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
introMessage: "<%= j (settings[:intro_message].presence || t("decidim.decidim_awesome.config.intergram.intro_message")).html_safe %>",
autoResponse: "<%= j (settings[:auto_response].presence || t("decidim.decidim_awesome.config.intergram.auto_response")).html_safe %>",
autoNoResponse: "<%= j (settings[:auto_no_response].presence || t("decidim.decidim_awesome.config.intergram.auto_no_response")).html_safe %>",
mainColor: "<%= j (settings[:color].presence || "#E91E63").html_safe %>",
mainColor: "<%= j (settings[:color].presence || (current_organization.colors && current_organization.colors["primary"]) || "#E91E63").html_safe %>",
alwaysUseFloatingButton: <%= settings[:use_floating_button] ? "true" : "false" %> // Use the mobile floating button also on large screens
};
</script>
Expand Down

0 comments on commit 88c821a

Please sign in to comment.