nicolasprigent / Dokuwiki-Kiwiki-Theme

Flex theme for Dokuwiki
https://www.dokuwiki.org/template:kiwiki
GNU General Public License v2.0
10 stars 3 forks source link

[feature request] add a down button (and some other features) #12

Closed Chris75forumname closed 1 year ago

Chris75forumname commented 1 year ago

Hi, I just love your template and I will use it personally. I would nominate your template for the DokuWiki best template design award! One of the first things I modified when I started with DokuWiki, I cloned the top button and morphed it into a down button in the template. I integrated it into the page menu, in symmetry with the top button. This would be a nice feat to have here too. πŸ˜ƒ

nicolasprigent commented 1 year ago

Hey thanks a lot for the kind words. I myself use this theme for my personal use, I think we got the same tastes regarding webdesign ☺️ I'm not totally sure of what you're referring to, could you provide a screenshot of what you described?

Chris75forumname commented 1 year ago

I refer to one of the main features:

What I am trying to say, is: It would be nice to have a "down button", similar to the "Back-to-top-button", fixed on the upper right corner of the screen.

I actually implemented this in the sprintdoc template and I use it all the time. E.g. to quickly jump to the Save button on a page with a form (like e.g. the admin >> config page). It basically just jumps to a text anchor in #dokuwiki__footer, which effectively scrolls the page all the way down to the bottom.

Cheers!

nicolasprigent commented 1 year ago

Ok I see, but I'm not sure if the top right is the best place for this, because it would interfere with the main menu, especially on mobile. What if this is just under the back to top anchor ? I will add an option to activate this, because it is more like a specific use case if that's ok for you ?

Chris75forumname commented 1 year ago

Yes, that would be great!! Cheers!

Chris75forumname commented 1 year ago

BTW: I have two more useful features, I propose to implement.

But, these are only suggestions! Yours, Chris

nicolasprigent commented 1 year ago

Do you have the code that you've implemented for acl ? the fullscreen is a nice suggestion too

Chris75forumname commented 1 year ago

I used this code from the tips and tricks section: https://www.dokuwiki.org/tips:display_acls. I described this in further detail here: https://forum.dokuwiki.org/d/21636-acl-deny-a-user-group-to-a-namespace/15. And it works in my wiki! Cheers!

Chris75forumname commented 1 year ago

Also cool would be an additional line in /doku.php?id=start&do=profile right after username as the second line: "group memberships" with a list of all groups the user belongs to.

In the following example only the first three groups are shown:

echo '<div>The current user belongs to following group(s): ' . $INFO['userinfo']['grps'][0] . ', ' . $INFO['userinfo']['grps'][1] . ', ' . $INFO['userinfo']['grps'][2] . '</div>';

This would have to be extended to loop over the whole array and extract all group memberships from the array.

nicolasprigent commented 1 year ago

You can re-install the theme to see the new features that you can add or remove from the admin panel of the theme :

For the last one that you've asked, you only want a list of the groups that the user belong too, that's right ? I'll see what I can do but it should not be a big deal.

Chris75forumname commented 1 year ago

Whow! That was a quick reaction! How did you do that?? πŸ˜„

I mean to list the groups, that have at least READ permission for the page. So someone who is editing can see, who will be able to view the (sensitive) data that he is about to add. (The usecase is a hierarchy with different levels of information clearance like staff and students in a university lab.)

For the last one that you've asked, you only want a list of the groups that the user belong too, that's right ?

Yes, exactly! But not in the footer, but on the user profile page: /doku.php?id=wiki:welcome&do=profile or as a top-down list on the user tab in the top bar menu (#dokuwiki__usertools)

nicolasprigent commented 1 year ago

Regarding the logged in user info in the footer, it's a default feature that I've deleted before, I made it as an option for convenience and/or compatibility with other plugins. Regarding the acl information, I've implemented the code that you've linked in the first link. I haven't see that you've made a custom one yourself on the second link. Is that what you need ? Thanks for the nice words about the other stuff :)

Chris75forumname commented 1 year ago

I haven't see that you've made a custom one yourself on the second link. Is that what you need ?

Yes exactly! It was not much customized by me, but I didn't see it come through in the template. It's supposed to say: page visible to: <list of groups>

Cheers!

nicolasprigent commented 1 year ago

isn't it an information that causes some security issues ? Would this be visible only to admins ?

nicolasprigent commented 1 year ago

Oh you've said it above "someone who is editing can see, who will be able to view the (sensitive) data that he is about to add", so I will make it visible only to people that have edit access on the page

Chris75forumname commented 1 year ago

I think it's save if this is turned off by default. I would activate this only depending on usecase.

Chris75forumname commented 1 year ago

I will make it visible only to people that have edit access on the page

Yes, great! And you can also extract the passage that says: page hidden to: ...

Chris75forumname commented 1 year ago

Unfortunately, the #dokuwiki__footer div.acl is still empty. It should show the default groups @ALL and @user.

nicolasprigent commented 1 year ago

I'm on it, I haven't made the proper code yet :D

Chris75forumname commented 1 year ago

In fact, I changed the output to from within the function, like so:

if (count($list)) {
    sort($list);
    echo '<div class="page_acls" style="margin-top:5px;"><bdi>Leserechte</bdi><span> Β· Seite sichtbar fΓΌr: ';
    echo join(', ',$list);
    echo '</span>';
}

... with echo instead of adding to $return and removed the line return $return;. Some CSS might be needed as well. Cheers!

nicolasprigent commented 1 year ago

You can re-install the theme to see the update. Only people that can edit the current page can view the information. And I've made some styling also.

Chris75forumname commented 1 year ago

AMAZING! You are a just unbelievable! THANK YOU VERY MUCH!!! You made my day! This is open source at it's finest! πŸ˜„πŸ‘ Have a nice day!

nicolasprigent commented 1 year ago

Last one for today, you can re-install the theme one more time to see the added information on the profile page.

Chris75forumname commented 1 year ago

Very cool! Many thanks! I am so happy, to see all my favorite features in this beautiful template! It's been a pleasure! πŸ˜ƒ

nicolasprigent commented 1 year ago

Thanks, have a great day