Skip to content

allow to specify a link to a legal notice - #9437

Merged
rullzer merged 4 commits into
masterfrom
feature/noid/imprint
May 17, 2018
Merged

allow to specify a link to a legal notice#9437
rullzer merged 4 commits into
masterfrom
feature/noid/imprint

Conversation

@blizzz

@blizzzblizzz commented May 9, 2018

Copy link
Copy Markdown
Member

Adds another input field to theming settings:

screenshot_20180509_155443

the legal notice is added to the footer (default is empty):

screenshot_20180509_155514

Also fixes a bug where changes to input[type=url] where not saved.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Comment threadcore/css/guest.css Outdated

a.legal {
font-size: smaller;
text-decoration: underline;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No underline on links please. We don't do that anywhere, compare to "Nextcloud" in the footer.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Actually we have a style for external links that does this: https://github.com/nextcloud/server/blob/master/core/css/styles.scss#L65-L68 I am fine with removing it however.

<div class="advanced-options">
<div>
<label>
<span><?php p($l->t('Legal notice address')) ?></span>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"Legal notice link"

@blizzzblizzzMay 9, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Further up is also "Web address", I used this for conistency.

<span><?phpp($l->t('Web address')) ?></span>
<input id="theming-url" type="url" placeholder="<?phpp($l->t('Web address https://…')); ?>" value="<?phpp($_['url']) ?>" maxlength="500" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should change that one to »Website link« also. »Address« is just too ambiguous, especially for a legal notice. It might as well be the postal address of an imprint. (I know it says »https://…« but let’s make sure to use simple language.)

@MariusBluem

Copy link
Copy Markdown
Member

What about a seperate „Privacy“ link?

@blizzz

Copy link
Copy Markdown
MemberAuthor

What about a seperate „Privacy“ link?

Requirement was link to imprint/legal notice on login page.

If more should be placed there, we need a different, flexible approach, as I am not gonna add links for also Cookies, Contact us, Security, Cialis, Blog, etc. Perhaps with some pre-defined labels to allow easy translation, that's a significantly more work however.

@MariusBluem

MariusBluem commented May 10, 2018

Copy link
Copy Markdown
Member

The external-app has options for positions (where login-page could be one I think). This would make it easily possible to change the link for specific languages (show it only in EU for example) and integrate it into the clients too... Maybe this is something for the future ....

However, it is working fine - THX 👍

@juliusknorrjuliusknorr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Although I would prefer to have this integrated in the external sites app, since it would make the whole mechanism a lot more flexible and fit better to the concept of external sites than theming, i'd be fine to merge this to have it available quickly.

Looks good besides some small comments.

<div>
<label>
<span><?php p($l->t('Legal notice address')) ?></span>
<input id="theming-imprintUrl" type="url" placeholder="<?php p($l->t('Legal notice address https://…')); ?>" value="<?php p($_['imprintUrl']) ?>" maxlength="500" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd probably remove the Legal notice address from the placeholder, since that is duplicate to the label.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Same for web address then ^

<label>
<span><?php p($l->t('Legal notice address')) ?></span>
<input id="theming-imprintUrl" type="url" placeholder="<?php p($l->t('Legal notice address https://…')); ?>" value="<?php p($_['imprintUrl']) ?>" maxlength="500" />
<div data-setting="imprintUrl" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The undo button is not working, as in not visible to the user. You probably need to add the empty default value here: https://github.com/nextcloud/server/pull/9437/files#diff-7336f3dab52c02ef94f856620590f56bR80

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

the key issue was missing CSS rules for url-input fields, undoing "web address" was also broken. fixed with a coming commit :)

@juliusknorr

Copy link
Copy Markdown
Member
There were 4 failures:
1) OCA\Theming\Tests\Settings\AdminTest::testGetFormNoErrors
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
- 'iconDocs' => null
+ 'iconDocs' => ''
'images' => Array ()
+ 'imprintUrl' => null
/drone/src/github.com/nextcloud/server/apps/theming/tests/Settings/AdminTest.php:111
2) OCA\Theming\Tests\Settings\AdminTest::testGetFormWithErrors
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
+ 'imprintUrl' => null
/drone/src/github.com/nextcloud/server/apps/theming/tests/Settings/AdminTest.php:160
3) OCA\Theming\Tests\Controller\ThemingControllerTest::testGetJavascript
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
+ imprintUrl: null,\n
/drone/src/github.com/nextcloud/server/apps/theming/tests/Controller/ThemingControllerTest.php:825
4) OCA\Theming\Tests\Controller\ThemingControllerTest::testGetJavascriptInverted
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
+ imprintUrl: null,\n
/drone/src/github.com/nextcloud/server/apps/theming/tests/Controller/ThemingControllerTest.php:859

@blizzz

Copy link
Copy Markdown
MemberAuthor

@juliushaertl external sites did not come up to my mind, and i have not looked at it for ages… last time i hada glance, you could only insert a link. This looks more interesting now :) But getting this to work there needs to be wired with templates at least, if not theming (pre-/post-footer vs. general footer). And, as you say, cannot be just shipped to 13 out of its maintenance release.

blizzz added 2 commits May 11, 2018 15:37
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
and minor adjustments
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@codecov

codecovBot commented May 11, 2018

Copy link
Copy Markdown

Codecov Report

Merging #9437 into master will decrease coverage by <.01%.
The diff coverage is 47.82%.

@@ Coverage Diff @@## master #9437 +/- ##
============================================
- Coverage 51.61% 51.61% -0.01% - Complexity 25684 25699 +15 
============================================
Files 1638 1638 Lines 96283 96341 +58 Branches 1393 1393 ============================================
+ Hits 49695 49723 +28 - Misses 46588 46618 +30
Impacted FilesCoverage ΔComplexity Δ
apps/theming/templates/settings-admin.php0% <0%> (ø)0 <0> (ø)⬇️
apps/theming/lib/Settings/Admin.php82.85% <100%> (+0.5%)5 <0> (ø)⬇️
apps/theming/lib/ThemingDefaults.php89.79% <100%> (+0.58%)51 <1> (+3)⬆️
apps/theming/lib/Controller/ThemingController.php72.96% <20%> (-2.38%)31 <0> (+2)
lib/private/legacy/json.php0% <0%> (-12%)19% <0%> (ø)
lib/private/AppFramework/OCS/BaseResponse.php75.86% <0%> (-4.91%)14% <0%> (+10%)
lib/private/legacy/api.php34.37% <0%> (-1.05%)31% <0%> (ø)
apps/files_versions/lib/Sabre/RootCollection.php0% <0%> (ø)5% <0%> (ø)⬇️
apps/files_trashbin/lib/Sabre/RootCollection.php0% <0%> (ø)5% <0%> (ø)⬇️
apps/files_trashbin/lib/Expiration.php91.93% <0%> (+1.61%)29% <0%> (ø)⬇️

@blizzz

Copy link
Copy Markdown
MemberAuthor

I left "address" instead calling it link to keep it consistent with the web url. otherwise, all remarks are addressed.

@blizzz

Copy link
Copy Markdown
MemberAuthor

@jancborchardt 🏓

@jancborchardt

jancborchardt commented May 15, 2018

Copy link
Copy Markdown
Member

@blizzz see my follow-up comment to the wording link. Let’s change both, otherwise it’s fine. :)

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz

Copy link
Copy Markdown
MemberAuthor

@jancborchardt done

@rullzerrullzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@rullzer
rullzer merged commit 9236c20 into masterMay 17, 2018
@rullzer
rullzer deleted the feature/noid/imprint branch May 17, 2018 19:16
blizzz added a commit that referenced this pull request May 18, 2018
allow to specify a link to a legal notice
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
fix tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
fix undo for url-typed inputs
and minor adjustments
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Use link not address in labels for URLs
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
this file does not belong here
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@blizzz@MariusBluem@juliusknorr@jancborchardt@rullzer@MorrisJobke