assemblymade/coderwall

View on GitHub
app/views/protips/_new_or_edit.html.haml

Summary

Maintainability
Test Coverage
.outside.editing
  %h1.editing= protip_editing_text
  .wrapper
    = simple_form_for @protip, url: create_or_update_url(@protip) do |p|
      .card-container
        %article.cf
          .card.cf
            #dropzone.tip-content.edit.front.side{'data-picture-upload-path' => user_pictures_path(current_user) }
              =file_field_tag 'dragupload[]', multiple: 'multiple', class: "safari5-upload-hack", id: "alternate_upload"
              %h2.edit-title
                = p.input :title, placeholder: "Title", label: false, input_html: {autocomplete: :off}

              .rule
                = p.input :body, placeholder: "Share link(s), text, code, or images", label: false, as: :text
                .preview-body
                %h4.formatting-tips Formatting tips
                %ul.formatting
                  %li.bold
                    **
                    %strong bold
                    **
                  %li.italic
                    *
                    %i italicize words
                    *
                  %li.code
                    indent 4 spaces for code
                  %li.drop-image
                    Drag & drop image in content area above to upload
                  %li.full-list=link_to("Markdown Cheat Sheet", "https://coderwall.com/p/hcqhja", target: "_blank")
                  %li.full-list=link_to('How to write a great pro tip', 'https://coderwall.com/p/o42nvq', target: "_blank")

              .rule.edit-tags
                = p.input :topic_list, label: false, input_html: {class: "tags cf", value: @protip.topic_list.join(","), id: "protip_tags", :autocomplete=>'off'}

            .x-tip-content.preview.back.side.cf#x-protip-preview


      .vertical-floatable
        = p.button :submit, 'Preview or cmd +', class: "preview-button"
        = p.submit 'Save & Publish', class: "save-and-publish",id: "protip-save-and-publish-button"