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
Fixes: #2755 Adding privacy for source display to visitors #4748
base: main
Are you sure you want to change the base?
Conversation
Remove extra leading tabs from lines 116, 117, 127, and 128.
Replaced tab stops with spaces on lines 116,117, 127, and 128. Removed extra tab stops on line 118
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4748 +/- ##
============================================
- Coverage 30.92% 30.92% -0.01%
Complexity 11361 11361
============================================
Files 1188 1174 -14
Lines 47909 47896 -13
============================================
- Hits 14817 14812 -5
+ Misses 33092 33084 -8 ☔ View full report in Codecov by Sentry. |
I'm at a little of a loss here mostly because I don't know much about codecov and what exactly it's looking for. I ran the tests on my side through PHPUnit and those came back 100% clean (see attached at the end of this post). So, I guess I'm looking for guidance as to how to turn the codecov checks green. Magic? Bribary? Bag of non-sequential unmarked bills under a park bench? Any advice would be greatly appreciated. Thanks, Bill
|
Hi Bill. Sorry for not replying earlier. Too many things happening IRL at the moment. CodeCov just counts the lines of code that get used one or more times when you run the tests. TIP: if the subject line contains the text Reviewing PRs often takes more time that writing them. I tend to spend too long worrying about So be patient if I appear to be ignoring you. |
Thanks, Greg for taking the time to reply and for your patience with a beginner in this process. Everything you have said makes sense; I appreciate you taking the time to check out what I've written. Cheers! Bill |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you PR, i added it to my site too and really like your additions... one small suggestion:
<?php if (Auth::isMember($tree) || $tree->getPreference('SHOW_SOURCE_TITLES') === '0') : ?> | ||
<?php $value = '<span class="field" dir="auto"><a href="' . e($source->url()) . '">' . $source->fullName() . '</a></span>' ?> | ||
<?php else: ?> | ||
<?php $value = '<span class="field" dir="auto">' . I18N::translate('PRIVATE') . '</span>' ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you use I18N::translate('Private')
instead of I18N::translate('PRIVATE')
the existing translations to other langguages will be successful ;-)
Thanks @HerzScheisse for the tip! I just today saw your comment from 12 February; I haven't looked at my Webtrees stuff for quite a while (my site is still running 2.1.16 or crying out loud!). I should bite the bullet and upgrade to 2.1.19 and then reapply the changes. I'm glad you liked the changes I made in the PR. Hopefully, they can help others as well someday Cheers! Bill |
Long-time user, first-time contributor. Please be gentle :-)
In November of 2019, I suggested both in the forums and through a git suggestion (#2755) that I'd like there to be a way to hide source details from visitors and make them available only to members. From my original forum post, "Even though my main site contains only the non-living people I export out of RootsMagic, I'm suddenly not fond of my full source broadcasting. However, I want something there so people don't think my work is sourceless and I'm some kind of noob hack (I do still consider myself a noob hack, but the rest of the world doesn't need to know that)."
My modifications add two new options to the tree privacy page:
These are a few sources for my dad. This is how they normally look:
If the source detail toggles are disabled for visitors, they look like this.
Finally, if the source titles are disabled or visitors, they look like this:
That's about it. The fact that sources exist can be conveyed to non-authenticated visitors without revealing any detailed information (or any information at all).
Even if these changes don't get accepted into Webtrees proper, no worries, it was a good coding experience dabbling into .phtml files for the first time and learning the submission process.
Cheers,
Bill