From 97f2c393c122409f1c90234935a8ebbca962cb44 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Mon, 29 Jul 2013 16:33:23 +0300 Subject: [PATCH 1/4] Allow apps to have own 404 content, closes #3225 --- apps/files_sharing/public.php | 5 +++++ apps/files_sharing/templates/part.404.php | 12 ++++++++++++ core/css/styles.css | 12 ++++++++++++ core/templates/404.php | 16 ++++++++++------ 4 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 apps/files_sharing/templates/part.404.php diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 3f8e29345a..6878109f7b 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -234,6 +234,11 @@ if (isset($path)) { } else { OCP\Util::writeLog('share', 'could not resolve linkItem', \OCP\Util::DEBUG); } + +$errorTemplate = new OCP\Template('files_sharing', 'part.404', ''); +$errorContent = $errorTemplate->fetchPage(); + header('HTTP/1.0 404 Not Found'); $tmpl = new OCP\Template('', '404', 'guest'); +$tmpl->assign('content', $errorContent); $tmpl->printPage(); diff --git a/apps/files_sharing/templates/part.404.php b/apps/files_sharing/templates/part.404.php new file mode 100644 index 0000000000..400dd6bbfd --- /dev/null +++ b/apps/files_sharing/templates/part.404.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/core/css/styles.css b/core/css/styles.css index 0dd66fb5b7..1e2ce3862a 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -304,6 +304,18 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } #body-login form .errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; } #body-login .success { background:#d7fed7; border:1px solid #0f0; width: 35%; margin: 30px auto; padding:1em; text-align: center;} +#body-login .error-broken-link{ + text-align:left; +} + +#body-login .error-broken-link ul{ + margin:10px 0 10px 0; +} + +#body-login .error-broken-link ul li{ + list-style: disc;list-style-position:inside; +} + /* Show password toggle */ #show, #dbpassword { position: absolute; diff --git a/core/templates/404.php b/core/templates/404.php index ee17f0de8e..bf1e03e6bc 100644 --- a/core/templates/404.php +++ b/core/templates/404.php @@ -7,9 +7,13 @@ if(!isset($_)) {//also provide standalone error page exit; } ?> - + + + + + From dec7b2fa40a7eeb0c0640a798e4c7443d1511bd5 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Mon, 29 Jul 2013 17:36:59 +0300 Subject: [PATCH 2/4] Move styles from core to app --- apps/files_sharing/css/404.css | 12 ++++++++++++ apps/files_sharing/public.php | 1 + core/css/styles.css | 12 ------------ 3 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 apps/files_sharing/css/404.css diff --git a/apps/files_sharing/css/404.css b/apps/files_sharing/css/404.css new file mode 100644 index 0000000000..e35e1a5808 --- /dev/null +++ b/apps/files_sharing/css/404.css @@ -0,0 +1,12 @@ + +#body-login .error-broken-link{ + text-align:left;color:#fff; +} + +#body-login .error-broken-link ul{ + margin:10px 0 10px 0; +} + +#body-login .error-broken-link ul li{ + list-style: disc;list-style-position:inside; +} diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 6878109f7b..741ab14538 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -239,6 +239,7 @@ $errorTemplate = new OCP\Template('files_sharing', 'part.404', ''); $errorContent = $errorTemplate->fetchPage(); header('HTTP/1.0 404 Not Found'); +OCP\Util::addStyle('files_sharing', '404'); $tmpl = new OCP\Template('', '404', 'guest'); $tmpl->assign('content', $errorContent); $tmpl->printPage(); diff --git a/core/css/styles.css b/core/css/styles.css index 1e2ce3862a..0dd66fb5b7 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -304,18 +304,6 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } #body-login form .errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; } #body-login .success { background:#d7fed7; border:1px solid #0f0; width: 35%; margin: 30px auto; padding:1em; text-align: center;} -#body-login .error-broken-link{ - text-align:left; -} - -#body-login .error-broken-link ul{ - margin:10px 0 10px 0; -} - -#body-login .error-broken-link ul li{ - list-style: disc;list-style-position:inside; -} - /* Show password toggle */ #show, #dbpassword { position: absolute; From a10a17f81857045b991fce3a1754b47608a8a4da Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Mon, 29 Jul 2013 18:25:17 +0300 Subject: [PATCH 3/4] Rewording --- apps/files_sharing/templates/part.404.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/templates/part.404.php b/apps/files_sharing/templates/part.404.php index 400dd6bbfd..b5152e1511 100644 --- a/apps/files_sharing/templates/part.404.php +++ b/apps/files_sharing/templates/part.404.php @@ -5,7 +5,7 @@
  • t('the item was removed')); ?>
  • t('the link expired')); ?>
  • -
  • t('sharing is disabled for this ownCloud')); ?>
  • +
  • t('sharing is disabled')); ?>

t('For more info, please ask the person who sent this link.')); ?>

From 15e9e95817a2d58951400c8a01ffdd89a573c9b3 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Tue, 30 Jul 2013 20:58:21 +0300 Subject: [PATCH 4/4] Use default cursor for list items --- apps/files_sharing/css/404.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/css/404.css b/apps/files_sharing/css/404.css index e35e1a5808..2ed81df3b8 100644 --- a/apps/files_sharing/css/404.css +++ b/apps/files_sharing/css/404.css @@ -8,5 +8,5 @@ } #body-login .error-broken-link ul li{ - list-style: disc;list-style-position:inside; + list-style: disc;list-style-position:inside;cursor:default; }