Splitting this off from #1545922: [META] Issue page redesign so it's an actionable task someone can claim and implement.

The various mockups for the new issue UI include a little block/region of action buttons:
- The current "Follow" UI
- "Update this issue"

Although the follow UI is being handled at #1560010: [META] Port issue following functionality to D7 we need some custom code/CSS to have a nice big/obvious "Update" button, perhaps also including the timestamp when the issue was last updated.

Comments

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
StatusFileSize
new19.49 KB
new3.53 KB

This is loosely based on parts of the code from #1696872: Create a block that shows the issue metadata but significantly reworked. There's now a theme template for rendering this button.

Here's how it looks with the block from #1696872 in Bartik:

Issue update button screenshot

senpai’s picture

Assigned: dww » bdragon
Status: Needs review » Reviewed & tested by the community

As long as this patch isn't breaking anything obvious, I say we commush it ASAP and tweak the CSS later if need be.

Should we also write an update hook that places this block into the correct sidebar?

dww’s picture

No update hooks (unless we want it in drupalorg_project for d.o). Many sites might not want to use the block at all. Anyway, that's a discussion for #1696872: Create a block that shows the issue metadata not here...

bdragon’s picture

Looks good to me.

dww’s picture

Assigned: bdragon » dww
Status: Reviewed & tested by the community » Fixed

Great, thanks. I slightly spruced up the CSS a bit so we have a darker green when you hover/focus the button. Committed and pushed to 7.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

klonos’s picture

...I expressed my concern elsewhere too but didn't get any replies. I realize that this issue is closed now, but do you really find the idea of having the status text along the "Update this issue" text of the button appealing? IMO the button is so big this way that instead of a button it resembles more a section of the container block that is simply differently colored. I strongly feel that the button should only have the "Update this issue" text and that we should move the "Last updated on..." text bellow the button. If they need to be somehow visually/mentally inter-connected, then perhaps we can have the "Last updated on..." text be the same color as the "Update this issue" button (i.e green).

hackwater’s picture

@klonos: +1

It looks like there are a couple of divs inside an anchor, one for the button text and another for the last update information. Could this be split off?

dww’s picture

Assigned: dww » Unassigned
Status: Closed (fixed) » Needs work

Yeah, I totally agree this looks terrible. I was just implementing what someone thought was a good idea, but there seems to be growing support for redoing this.

It'd probably be more sane to just fix the markup spit out by this block. There's a template for this, but I think we should just fix the default upstream template. I don't want project_issue to be shipping this nonesense by default. ;)

However, I don't think this is a critical launch blocker, so I need to unassign myself for now.

dww’s picture

Priority: Normal » Major

Another thing I just noticed is that the huge button is appearing for anonymous users and others without permission to update the issue. It needs to be replaced with a "Login or register to update this issue" set of links, instead.

dww’s picture

Assigned: Unassigned » dww

As per this morning's scrum call, I'm going to take this one and clean up all this stuff.

dww’s picture

This fixes the block in the following ways:

  • Moved the 'Last updated on...' text into a separate div outside of the <a>
  • Added logic to the preprocess function to check node_access('update') on the given node. There are 3 cases:
    1. User has update: Render the update link directly
    2. Anonymous user: Render "Log in or Register to update this issue" (or just "Log in to update..." if the site isn't configured to allow self-registration).
    3. Auth user without update permission: Don't print anything

I'm also including screenshots (using bartik) before/after the patch. The before case renders identically for all 3 cases described above, so I'm just attaching that once. In the case of anon and auth users without update perms, the big green button sends you to a 403. (You can disregard the "Category: 2" in here, that's just because my local dev site is a bit screwed up with field configuration from working on other issues).

Any objections?

dww’s picture

Status: Needs review » Fixed

Committed and pushed as 232a9a60e and merged into bzr.

Automatically closed -- issue fixed for 2 weeks with no activity.