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

Add a 'disposition' partial #32

Open
evanplaice opened this issue Jan 19, 2016 · 5 comments
Open

Add a 'disposition' partial #32

evanplaice opened this issue Jan 19, 2016 · 5 comments

Comments

@evanplaice
Copy link

The disposition section was added to FRESCA. It needs a template partial.

  "disposition": {
    "travel": 0,
    "authorization": "",
    "commitment": [
      ""
    ],
    "remote": false,
    "relocation": {
      "willing": "",
      "destinations": [
        ""
      ]
    }
  }
@hacksalot
Copy link
Member

Agreed. This will require a small change on the HackMyResume side to support default "show" or "hide" state for sections. Thanks~

@evanplaice
Copy link
Author

Gotcha. I just wrap the partial template with a conditional to only render if data is present.

<template [ngIf]="!empty()">
  <hr>
  <section id="education">
    <header title="Education"><span class="fa fa-lg fa-mortar-board"></span></header>
    <div *ngFor="#school of education.history">
      <h3><template [ngIf]="school.title">{{ school.title }}, </template>{{ school.institution }}</h3>
      <duration [start]="school.start" [end]="school.end"></duration>
      <p>{{ school.summary }}<p>
      <curriculum [curriculum]="school.curriculum"></curriculum>
    </div>
  </section>
  </template>

The template element here is used because it doesn't show up in the rendered output. So, in this case if the data model in the controller returns not empty, the contents get rendered.

BTW, I hope you don't mind me flooding the issues. I like to get all the known required tasks added up front so there's a central place to add notes as progress is made. I figure, start with the data structures and work from there.

@hacksalot
Copy link
Member

Very cool to see the Angular interpretation here. Any reason not to use the {{#section}} block helper?

{{#section 'education' 'Work'}}

/* Render when 'education' is present and > 0 entries. */

{{/section}}

It's maybe a little explicit, but each {{#section}} block partial is also a hint to the HMR (or other tool) runtime that "this is a section", for stuff like renaming or reordering sections and the like, as well as providing conditional rendering. Not required though.

And re: submitting issues: user & developer involvement are actually valued here. Submit as many issues or PRs as you think deserve attention. Thanks!

@hacksalot
Copy link
Member

Oh, also, I meant that disposition contains sensitive info, and HMR should support a flag in the .json as well as command line to show or hide at will based on whether it's a private resume for a specific employer or a public resume for the blog, etc.

@evanplaice
Copy link
Author

@hacksalot that's what it uses at the higher level except instead of using a generic wrapping element, it uses a semantically named custom element.

Here's the element used on the parent view. resume.education is a reference to the resume data used in this partial that gets passed in as an input parameter and assigned to this.education within the EducationComponent partial.

<education [education]="resume.education"></education>

If you look at the previous example above, I've also created subpartial views for <header>, <curriculum>, and <duration>. There are a few others not shown here such as <highlights> and <keywords>.

Gotcha, so disposition needs a private field. Makes sense.

@hacksalot hacksalot modified the milestones: v0.14.0-beta, v0.15.0-beta Jan 22, 2016
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

2 participants