- content_for :javascript do
  initialize_admin_edit_tribe_look_and_feel_form("#{I18n.locale}", "#{@community.id}", "#{t('.invalid_color_code')}");

- content_for :title_header do
  %h1
    = t("layouts.admin.admin")
    = "-"
    = t("admin.communities.edit_details.community_look_and_feel")

- if local_assigns[:show_onboarding_popup]
  = render :layout => "layouts/lightbox", :partial => "layouts/onboarding_popup", locals: {title: t(popup_title_key), body: t(popup_body_key), action_label: t(popup_button_key), action_link: popup_action_link, image: asset_path(popup_image), id: "onboarding-popup" }

= render :partial => "admin/left_hand_navigation", :locals => { :links => admin_links_for(@current_community) }

#new_news_item_form.left-navi-section
  %h2= t(".edit_community_look_and_feel", :community_name => @community.name(I18n.locale))
  = form_for @community, :url => admin_look_and_feel_path, method: :patch do |form|
    .row
      .col-12
        - logo_old = ".logo_instructions_text_with_dimensions"
        - logo_no_placing = ".logo_instructions_text_with_dimensions_no_placing"
        - logo_info = FeatureFlagHelper.feature_enabled?(:topbar_v1) ? logo_no_placing : logo_old
        = form.label :wide_logo, t(".community_logo"), :class => "input"
        = render :partial => "layouts/info_text", :locals => { :text =>t(logo_info, :width => 336, :height => 80)}
        = form.file_field(:wide_logo, :class => "file_field")

    .row
      .col-12
        - icon_old = ".logo_icon_instructions_text_with_dimensions"
        - icon_no_placing = ".logo_icon_instructions_text_with_dimensions_no_placing"
        - icon_info = FeatureFlagHelper.feature_enabled?(:topbar_v1) ? icon_no_placing : icon_old
        = form.label :logo, t(".community_logo_icon"), :class => "input"
        = render :partial => "layouts/info_text", :locals => { :text => t(icon_info, :width => 600, :height => 600)}
        = form.file_field(:logo, :class => "file_field")

    .row
      .col-12
        = form.label :cover_photo, t(".community_cover_photo"), :class => "input"
        = render :partial => "layouts/info_text", :locals => { :text => (t(".cover_photo_visibility") + " " +  t(".cover_photo_instructions_text_with_dimensions", :width => 1920, :height => 450, :see_how_it_looks_like => link_to(t("admin.communities.edit_details.see_how_it_looks_like"), "/?big_cover_photo=true", :id => "view_cover_photo_link"))).html_safe}
        = form.file_field(:cover_photo, :class => "file_field")

    .row
      .col-12
        = form.label :small_cover_photo, t(".small_community_cover_photo"), :class => "input"
        = render :partial => "layouts/info_text", :locals => { :text => t(".small_cover_photo_visibility") + " " + t(".small_cover_photo_instructions_text_with_dimensions", :width => 1920, :height => 96) }
        = form.file_field(:small_cover_photo, :class => "file_field")


        = render :partial => "layouts/info_text", :locals => { :text => t(".main_content_width", :main_width => 1008)}

    .row
      .col-12
        = form.label :favicon, t(".favicon"), :class => "input"
        = render :partial => "layouts/info_text", :locals => { :text => t(".favicon_info_text") }
        = form.file_field(:favicon, :class => "file_field")

    .row
      .col-12
        = form.label :custom_color1, t(".community_custom_color1"), :class => "input"
        = render :partial => "layouts/info_text", :locals => { :text => t(".custom_color1_instructions_text").html_safe }
        = form.text_field :custom_color1, :maxlength => "6", :class => "text_field"

    - unless FeatureFlagHelper.feature_enabled?(:topbar_v1)
      .row
        .col-12
          - post_new_listing = "<i>#{t("homepage.index.post_new_listing")}</i>"
          = form.label :custom_color2, t(".new_listing_button_custom_color").html_safe, :class => "input"
          = render :partial => "layouts/info_text", :locals => { :text =>  t(".new_listing_button_instructions_text", link_to_colorpicker: link_to("ColorPicker.com", "http://www.colorpicker.com?colorcode=00a26c", target: "_blank", rel: "noreferrer")).html_safe }
          = form.text_field :custom_color2, :maxlength => "6", :class => "text_field"

    .row
      .col-12
        = form.label :default_browse_view, t(".default_browse_view")
        = render :partial => "layouts/info_text", :locals => { :text => t(".default_browse_view_instructions_text") }
        = form.select :default_browse_view, [[t(".grid"), "grid"], [t(".list"), "list"], [t(".map"), "map"]]

    .row
      .col-12
        = form.label :name_display_type, t(".name_display_type")
        = render :partial => "layouts/info_text", :locals => { :text => t(".name_display_type_instructions_text") }
        = form.select :name_display_type, [[t(".full_name"), "full_name"], [t(".first_name_with_initial"), "first_name_with_initial"], [t(".first_name_only"), "first_name_only"]]

    .row
      .col-12
        = form.label :custom_head_script, t(".custom_head_script")
        = render :partial => "layouts/info_text", :locals => { :text => t(".custom_head_script_instructions_text") }
        = form.text_area :custom_head_script, class: "text_area_code", placeholder: "<script src=\"http://example.com/customscript.js\"></script>"

    .row
      .col-12
        = form.button t("admin.communities.edit_details.update_information"), :id => "edit_community_button", :class => "send_button"

= render :partial => "people/help_texts", :collection => ["invite_only_help_text"], :as => :field
