Since the coupon id template (frontend/src/pug/common/_coupon_id.pug) is the same for the end user and store user, I had to add an ugly hack to determine whether or not to show the coupon delete button. Can you think of any better way of doing this?
However, @arowM has a better idea:
The important point is we need not ask backend server to determine whether we should render delete button or not, but we can determine it in compile time.
So, I have two plan to realize this.
Use pug-side variable to handle appearance of delete button
Set the style of store delete button display: block in store.scss.
Anyway since I'll implement OOUX way of delete feature in future PR, then I'll change this, too.
It would be nice to have an
X
button on each coupon on the Store's coupon list for deleting the coupon.This recommendation comes from https://github.com/blueimpact/kucipong/pull/155#issuecomment-290096847.
Also, we need a way to determine whether or not to show the delete button. It should be shown to Store users, but not to end users.
My original solution is below (and implemented in https://github.com/blueimpact/kucipong/pull/155):
However, @arowM has a better idea: