Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor template: form.html #1891

Closed
2 tasks done
denschub opened this issue Nov 17, 2017 · 14 comments
Closed
2 tasks done

refactor template: form.html #1891

denschub opened this issue Nov 17, 2017 · 14 comments

Comments

@denschub
Copy link
Member

denschub commented Nov 17, 2017

Refactor following:
https://github.com/webcompat/webcompat.com/blob/master/webcompat/templates/home-page/form.html

with:

The form in http://webcompat.github.io/design/

Please be aware to add the placeholders for links as they are in the old templates.

Left do do:

  • Fix screenshot uploader
  • Make sure validation works
@denschub denschub added this to the Community Sprint milestone Nov 17, 2017
@denschub denschub self-assigned this Nov 17, 2017
@zoepage zoepage mentioned this issue Nov 17, 2017
2 tasks
zoepage added a commit that referenced this issue Nov 18, 2017
Issue #1891. Port the report form to the new style.
@denschub
Copy link
Member Author

Although PR #1908 is merged, let's keep this issue open. We need to do some follow-ups.

@zoepage
Copy link
Member

zoepage commented Nov 21, 2017

@denschub wanna add a list of follow ups / do you want to finish up the issue at some point? Otherwise happy to take over :)

@denschub
Copy link
Member Author

@zoepage added a list! i'll be able to continue, but that have to wait until next week, I fear.

@zoepage
Copy link
Member

zoepage commented Nov 22, 2017

@denschub no worries && thank you :)

@miketaylr
Copy link
Member

Left do do:

Fix screenshot uploader
Make sure validation works

I'm happy to help with this!

@denschub
Copy link
Member Author

denschub commented Jan 8, 2018

@miketaylr cool. Just for your reference (dumping my brain so you don't have to start at 0), I did not take over all css classes from the old template to avoid having a lot of classes on all elements. Since the JS heavily depends on some lookups via JS classes, this probably breaks. So the easy solution is probably just to re-apply the classes, but the cleaner solution would be to change the JS to use the new classes (or something more robust and style independent, maybe IDs...)

@zoepage
Copy link
Member

zoepage commented Jan 8, 2018

We kept all JS classes in the other templates as this would otherwise get too massive of a refactor. Phase 2 will be the part where we clean that up (probably 2020 🤡).

@miketaylr
Copy link
Member

miketaylr commented Jan 23, 2018

@zoepage can you explain what's the expected markup here?

<div class="form-upload form-element js-image-upload js-Form-group">
  <label class="wc-UploadForm wc-UploadForm--homePage js-image-upload-label" for="image">
    {{ form.image(class_='form-input input-upload wc-ButtonUpload', accept='.jpe,.jpg,.jpeg,.gif,.png,.bmp') }}
    {% if form.image.errors %}
      {% for error in form.image.errors %}
      <span class="wc-Form-helpMessage--imageUpload">{{ error }}</span>
      {% endfor %}
    {% endif %}
    <div class="wc-UploadForm-wrapper">
      <label class="form-label label-upload wc-UploadForm-label">
        <svg class="icon icon-big wc-UploadForm-icon" role="presentation">
          <use class="icon-upload" href="#svg-upload-2">Upload</use>
        </svg>
        Upload screenshot
      </label>
    </div>
    <button
      class="wc-UploadForm-button is-hidden r-ResetButton"
      role="button"
      type="button"
      tabindex="-1"
    >
      <img
        class="wc-Upload-Loader js-Upload-Loader"
        src="/img/upload-loader.svg"
        alt="Uploading image"
      >
      Remove image upload
    </button>
  </label>
</div>
<label for=foo>
  <input id=foo>
  <div>
    <label>
      <svg>
    <label>
  ....

Not sure why we have nested labels. Is that intentional? I think I need to figure out the new markup before I fix the JS, since I'm just going to re-write the relevant bits.

@zoepage
Copy link
Member

zoepage commented Jan 24, 2018

You might want to take a look at http://webcompat.github.io/design/ > Module: Forms

This is the expected markup:

/* UPLOAD */
<div class="form-upload form-element">
	<input
		type="file"
		accept=".jpe,.jpg,.jpeg,.gif,.png,.bmp"
		class="form-input input-upload"
		id="id"
	/>

	<label class="form-label label-upload" for="idOfInput">
		<svg class="icon icon-big" role="presentation">
		  	<use class="icon-upload" href="#upload-2">Upload</use>
		</svg>
		Screenshot label name
	</label>
</div>

Happy to help and fix the markup first, before you start working on this?

@miketaylr
Copy link
Member

miketaylr commented Jan 24, 2018

Thanks! I'll holler if I get stuck.

miketaylr added a commit that referenced this issue Jan 24, 2018
…review.

Now we show it on the containing <div>.
zoepage added a commit that referenced this issue Feb 2, 2018
zoepage added a commit that referenced this issue Feb 2, 2018
miketaylr pushed a commit that referenced this issue Feb 2, 2018
Fixes #1891: Get form working on refactor branch.
@zoepage
Copy link
Member

zoepage commented Feb 14, 2018

this was merged.

@zoepage zoepage closed this as completed Feb 14, 2018
miketaylr pushed a commit that referenced this issue Mar 23, 2018
miketaylr pushed a commit that referenced this issue Mar 23, 2018
miketaylr added a commit that referenced this issue Mar 23, 2018
…review.

Now we show it on the containing <div>.
miketaylr pushed a commit that referenced this issue Mar 23, 2018
miketaylr pushed a commit that referenced this issue Mar 23, 2018
miketaylr pushed a commit that referenced this issue Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants