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 plugin for rapid generation of staff pages - update UI & UX #269

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Jul 14, 2023

Overview

Improve UI and UX and data.

Related

Changes

  • added admin interface for plugin instances
  • changed plugin name to be translatable
  • added field help text and custom labels
  • changed which fields are required
  • added form layout and field organization
  • added post_nomials and title2
  • changed photo to not be required
  • removed experience1
  • added styles for new ui requests
  • added image fallback for missing photo
  • added script for new ui request
  • changed markup to match live pages
  • added snippet for ui and ux on manual pages

Testing

Setup
  1. Checkout and pull the branch of this PR.
  2. Run the CMS locally, and be a superuser.
    After TACC/tup-ui:README.md step 7, continue with TACC/Core-CMS/:README.md "Start Project" step 2.
  3. docker exec -it tup_cms /bin/bash
    then python manage.py migrate staff_profile
    Unless you already ran python manage.py migrate cuz you set up fresh local env on this branch.
  4. Add or edit a "Staff Profile" plugin instance.
  1. Verify job title and dept. combinations render as expected.
    • one title and no dept.:

      Title

    • one title and a dept.:

      Title
      Dept

    • two titles and a dept.:

      Title, Dept.
      Title2

    • two titles and no dept.:

      Title
      Title2

  2. Verify image "alt text" possibilities:
    1. with "Alt. text" (add via Filer), uses that for alt attr.
    2. with no alt text (via Filer), uses full name for alt attr.
  3. Verify fields that are not required, when not provided, do not render excess markup.
    1. empty "Phone" should not render "Phone: | "
    2. empty "Group / Department" should not render ", " nor <br /><small></small>
    3. empty "Other" content should not render <div content-block">…</div>
  4. Verify required fields are only names, title, and e-mail.

    Any field required that is not filled will render error upon form submission.

  5. Verify a missing photo will render the UT Seal.

  6. Verify a missing photo will render the UT Seal.

    Any required field left empty will cause error to render after form submission.

  7. Verify design is responsive in specific ways:
    • On narrow screen (<768px):
      • Photo is beneath name and title and dept.
      • Education is at bottom of page
      • Education lacks green border beside heading
      • Education lacks extra padding
    • On wide screen (≥768px):
      • Photo is above Education, right of name and title and dept.
      • Education is below Photo, right of name and title and dept.
      • Education has green border beside heading
      • Education has extra padding
  8. Verify staff profiles can be browsed and edited via admin interface.

    Either, open http://localhost:8000/admin/staff_profile/staffprofileplugin.

    Or, from http://localhost:8000/admin/, scroll to "TACC Staff Profiles" and click "Staff profile plugins".

UI

  1. Job Title & Dept. Differences
    Page Form
    ian page ian form
    stephen page stephen form
    dan page dan form

  1. and 6. Photo Not Required & Fallback
    image.not.required.and.has.fallback.mov

  1. Responsive Design
    Wide Narrow
    staff profile - wide staff profile - narrow
  2. Admin Interface
    Admin Table Form
    1 admin list 2 staff_profile table 3 staff_profile form

Notes

CMD Proposals - Staff Profile Layout & Data

Footnotes

  1. H.P. says Professional Experience is for leadership, as wanted; rare in general; and easily appended to staff Bio.

BREAKING CHANGE: The "articles" are not shown, but at least page loads.
@wesleyboar wesleyboar changed the title Add plugin for rapid generation of staff pages Add plugin for rapid generation of staff pages - update UI and UX Jul 14, 2023
@wesleyboar wesleyboar changed the title Add plugin for rapid generation of staff pages - update UI and UX Add plugin for rapid generation of staff pages - update UI & UX Jul 14, 2023
Accodign to H.P.:
This field is only necessary for leadership, which are created manually.
It's overkill for most staff.
- rename s-staff-profile to c-staff-profile
- load c-staff-profile css from plugin instead
- add staff_profile js in plugin
- load staff_profile js from plugin
Warning: Image is only moved once. Image is not found after move. Error.
Copy link
Member Author

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave notes for reviewers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? To create "Staff profile plugins" in /admin interface.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? To title /admin page under "TACC STAFF PROFILES" (rather than "STAFF_PROFILE"),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? Consistent (and translatable) plugin identification. Use custom form layout.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? Set which fields are required. Add help text and custom labels. Define custom form layout.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Help! Git got confused or I screwed up.

@jarosenb jarosenb merged commit b552188 into task/TUP-125--staff-page-plugin Aug 18, 2023
1 check passed
@jarosenb jarosenb deleted the task/TUP-125--staff-page-plugin--ui-and-ux-updates branch August 18, 2023 16:09
jarosenb added a commit that referenced this pull request Aug 28, 2023
* Add plugin for rapid generation of staff pages

* Add plugin for rapid generation of staff pages - split name into first and last (#294)

* feat: split name into first and last name

* fix: reduce first and last name to 110 chars

* fix: replace template name w/ first_… and last_…

* Add plugin for rapid generation of staff pages - update UI & UX (#269)

* feat(tup-cms)!: save progress of ui/ux updates

BREAKING CHANGE: The "articles" are not shown, but at least page loads.

* style(tup-cms): missing html end tag slash

* chore: rm .vscode/settings.json

* fix: restore forms.py (untested)

I hope this restores WYSIWYG.

* fix: restore models.py changes (untested)

I hope this prevents migrations.

* fix: restore forms.py load

* fix: articles not rendering (mismatched key)

* fix: main col for articles with large content

* feat: split name into first and last name

* fix: reduce first and last name to 110 chars

* fix: only require names, title, and email

i.e. let all other fields `blank=True`

* Add plugin for rapid generation of staff pages - require only certain fields (#295)

* feat: add title2 (2nd, equal, optional job title)

* fix: replace template name w/ first_… and last_…

* feat: add post_nomial

* fix: remove templatetag (overkill)

Not necessary now, because no algorithm needed.

* fix: markup should match live pages

* refactor: move all ui context work into template

* chore: remvoe superfluous edits of original code

* feat: form layout and field labels

* fix: cms_plugins name translate and single quotes

* feat: add help_text

* fix: remove verbose name for most wysiwig fields

* fix: remove "Phone number" verbose name

* fix: rename post_nomial to post_nomials

* chore: migrations

* refactor: no form ui in models, rename a field

* refactor: do not use blank in models.py

* docs: encourage photo and bio

* fix: do not require photo

* fix: markup conditionals

* refactor: squash migrations

* feat: help text for secondary job title

* chore: migration reducing name field lengths

* feat: remove "experience" field

Accodign to H.P.:
This field is only necessary for leadership, which are created manually.
It's overkill for most staff.

* feat: s-staff-profile.css

* feat: at content wrap, undo c-content-block styles

* docs: ntoe why s-staff-profile is global css

* refactor: staff_profile css and js — ⚠️ untested

- rename s-staff-profile to c-staff-profile
- load c-staff-profile css from plugin instead
- add staff_profile js in plugin
- load staff_profile js from plugin

* fix: load staff_profile css

* fix: bugs in staff_profile js — ⚠️ incomplete

Warning: Image is only moved once. Image is not found after move. Error.

* fix: bugs in staff_profile js — ✓ complete

* fix: move image ot after job title, not just name

* feat: use ut seal if no staff photo

* style: captialization in css comments

* style: consistency in css comments

* feat: model access via admin interface

* style: nx format:write

* chore: remove excess property on admin class

* docs: in css comment warn about coupled html & css

* fix: donot require photo field

* feat: to load staff profile css+js on manual page

* refactor: c-staff-profile → s-staff-profile

* docs: remove inaccurate comment

* docs: remove excess comment

* docs: asset comment cleanup

* fix: remove experience from forms and output

* chore: move 'education" to bottom of form

* feat: less margin beneath `<h3>`

* docs: label blocks of css with different goals

* docs: group css that actuall has the same goal

* docs: title case css grouping comment

* Add plugin for rapid generation of staff pages - more design tweaks (#300)

* Add plugin for rapid generation of staff pages - manually squash migrations (#304)

* docs: add staff_profile/README to log known issues

* chore: nx format:write

---------

Co-authored-by: Jake Rosenberg <jrosenberg@MacBook-Pro.lan>
Co-authored-by: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Co-authored-by: Wesley Bomar <wbomar@tacc.utexas.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants