Skip to content

Conversation

@blizzz
Copy link
Member

@blizzz blizzz commented May 9, 2018

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>

a.legal {
font-size: smaller;
text-decoration: underline;
Copy link
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
Member Author

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
Member

Choose a reason for hiding this comment

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

"Legal notice link"

Copy link
Member Author

@blizzz blizzz May 9, 2018

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

Copy link
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
Member

What about a seperate „Privacy“ link?

@blizzz
Copy link
Member Author

blizzz commented May 9, 2018

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
Copy link
Member

MariusBluem commented May 10, 2018

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 👍

Copy link
Member

@juliusknorr juliusknorr left a comment

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
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
Member Author

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
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
Member Author

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
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
Member Author

blizzz commented May 11, 2018

@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
Copy link

codecov bot commented May 11, 2018

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 Files Coverage Δ Complexity Δ
apps/theming/templates/settings-admin.php 0% <0%> (ø) 0 <0> (ø) ⬇️
apps/theming/lib/Settings/Admin.php 82.85% <100%> (+0.5%) 5 <0> (ø) ⬇️
apps/theming/lib/ThemingDefaults.php 89.79% <100%> (+0.58%) 51 <1> (+3) ⬆️
apps/theming/lib/Controller/ThemingController.php 72.96% <20%> (-2.38%) 31 <0> (+2)
lib/private/legacy/json.php 0% <0%> (-12%) 19% <0%> (ø)
lib/private/AppFramework/OCS/BaseResponse.php 75.86% <0%> (-4.91%) 14% <0%> (+10%)
lib/private/legacy/api.php 34.37% <0%> (-1.05%) 31% <0%> (ø)
apps/files_versions/lib/Sabre/RootCollection.php 0% <0%> (ø) 5% <0%> (ø) ⬇️
apps/files_trashbin/lib/Sabre/RootCollection.php 0% <0%> (ø) 5% <0%> (ø) ⬇️
apps/files_trashbin/lib/Expiration.php 91.93% <0%> (+1.61%) 29% <0%> (ø) ⬇️

@blizzz
Copy link
Member Author

blizzz commented May 11, 2018

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

@blizzz
Copy link
Member Author

blizzz commented May 15, 2018

@jancborchardt 🏓

@jancborchardt
Copy link
Member

jancborchardt commented May 15, 2018

@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
Member Author

blizzz commented May 15, 2018

@jancborchardt done

Copy link
Member

@rullzer rullzer left a comment

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 master May 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants