Skip to content

Commit

Permalink
Merge pull request #166 from restarone/fixsidenav
Browse files Browse the repository at this point in the history
Fixsidenav
  • Loading branch information
donrestarone authored May 30, 2021
2 parents a8faccb + a9670e8 commit 5a82dd7
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 14 deletions.
11 changes: 11 additions & 0 deletions app/assets/javascripts/comfy/admin/cms/custom.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
// Custom JS for the admin area

// patch the correct subdomain admin name in the browser tab
let subdomain = /:\/\/([^\/]+)/.exec(window.location.href)[1].split('.')[0]
document.title = `${subdomain} Admin`

// when html body is clicked collapse bootstrap nav expansion
$(document).click(function (event) {
let clickover = $(event.target);
let _opened = $(".navbar-collapse").hasClass("navbar-collapse collapse show");
if (_opened === true && !clickover.hasClass("navbar-toggler")) {
$("button.navbar-toggler").click();
}
});

if ($('#message_thread_recipients').length) {
$('select').select2({
multiple: true,
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/subdomain_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def og_image_url(subdomain)

def render_og_image(subdomain)
return if !subdomain.og_image.attached?
image_tag subdomain.og_image, class: 'rounded avatar', size: '40x40'
image_tag subdomain.og_image, class: 'rounded avatar', size: '100x100'
end


Expand Down
4 changes: 2 additions & 2 deletions app/views/comfy/admin/cms/partials/_navigation_before.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- if Subdomain.current.logo.attached?
= link_to root_path(subdomain: Apartment::Tenant.current), target: '_blank' do
= image_tag(Subdomain.current.logo, class: 'd-none d-lg-block img-fluid p-4')
= link_to root_path(subdomain: Apartment::Tenant.current), target: '_blank', class: 'd-flex justify-content-center align-items-center' do
= image_tag(Subdomain.current.logo, class: 'd-none d-lg-block img-fluid p-4', size: '150x150')
- else
= link_to "Add your logo here", edit_web_settings_path
3 changes: 2 additions & 1 deletion app/views/comfy/admin/cms/partials/_navigation_inner.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
= active_link_to "Call to Actions", call_to_actions_path, class: 'nav-link'
= active_link_to "Visitor Analytics", dashboard_path, class: 'nav-link'
= active_link_to "My Settings", edit_user_registration_path, class: 'nav-link'
%li{class: 'nav-item'}
%li.nav-item.dropdown
%a#navbarDropdown.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :href => "#", :role => "button"}
= "#{Subdomain.current.name.capitalize} Shortcuts"
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
= link_to "Website", '/', class: 'dropdown-item', target: '_blank'
= link_to "Blog", '/blog', class: 'dropdown-item', target: '_blank'
= link_to "Forum", '/forum', class: 'dropdown-item', target: '_blank'
= link_to "Logout", destroy_user_session_path, class: 'nav-link text-danger', method: :delete
= link_to "Logout", destroy_user_session_path, class: 'nav-link text-danger', method: :delete
2 changes: 1 addition & 1 deletion app/views/comfy/admin/web_settings/_form.haml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
%label
Favicon:
.m-2
= render_logo(Subdomain.current)
= render_favicon(Subdomain.current)
= f.file_field :favicon, required: false, class: 'form-control-file'
.form-group.card.p-2
%label
Expand Down
14 changes: 8 additions & 6 deletions app/views/mailbox/message_threads/_form.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
= form_for @message_thread, url: mailbox_message_threads_path, method: :post do |f|
%label
recipients:
= f.text_field :recipients, multiple: true, required: true
%label
Subject:
= f.text_field :subject
.form-group
%label
recipients:
= f.text_field :recipients, multiple: true, required: true, class: 'form-control'
.form-group
%label
Subject:
= f.text_field :subject, class: 'form-control'
= render partial: 'messages/form', locals: { f: f }
8 changes: 5 additions & 3 deletions app/views/messages/_form.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
= f.fields_for Message.new do |message_form|
= message_form.rich_text_area :content
= f.submit
.my-3
= f.fields_for Message.new do |message_form|
= message_form.rich_text_area :content
.my-3
= f.submit "Send", class: 'btn btn-primary'

0 comments on commit 5a82dd7

Please sign in to comment.