oupala / apaxy

a simple, customisable theme for your apache directory listing
https://oupala.github.io/apaxy/
GNU General Public License v3.0
1.86k stars 256 forks source link

feat: Add styled error pages #114

Closed ghost closed 6 years ago

ghost commented 6 years ago

I added custom error pages that follow the style of Apaxy. These error pages are fully functional, as Apache will automatically redirect to them upon each error code. These are the common ones, I can add more if we want. This closes #98

Here are the errors I implemented:

Here is an example (404 page):

example

The message will also fade down on load, just like the Apaxy website. We can always add more errors if we want.

oupala commented 6 years ago

Your pull request is trying to merge to master. Can you update it to merge to develop?

And can you please pay attention to the style refactoring made by @PeterDaveHello in pull request #108. Thanks.

oupala commented 6 years ago

And do not forget to mention that your commit closes issue #98 by adding the following to your commit message:

close #98

as I did on this commit: 4471ec1b9f0b966738c4dab8cd423b871b951a5b (more information here Closing issues using keywords, I personally prefer close keyword).

ghost commented 6 years ago

Ok. I will merge branch develop into jordanbancino/patch-1 and set jordanbancino/patch-1 to merge into develop. I will also add close #98 to the commit message.

ghost commented 6 years ago

I reviewed the article you referenced, and I used the closes keyword in the pull request description, so if this gets merged, it will close it automatically, without me needing to put it in a commit message.

DanielDK100 commented 6 years ago

Just a mere suggestion; wouldn't it be better to reuse the HTML error pages? The only thing that changes in the HTML is the error code and error message depending on which error is triggered. Instead of having 6 (or more) almost identical HTML files - we could have just a single one.

This would make it easier to:

I'm thinking something along these lines;

ErrorDocument 400 http://%{HTTP_HOST}/{FOLDERNAME}/theme/error.html?code=400
ErrorDocument 403 http://%{HTTP_HOST}/{FOLDERNAME}/theme/error.html?code=403
ErrorDocument 404 http://%{HTTP_HOST}/{FOLDERNAME}/theme/error.html?code=404
ErrorDocument 408 http://%{HTTP_HOST}/{FOLDERNAME}/theme/error.html?code=408
ErrorDocument 500 http://%{HTTP_HOST}/{FOLDERNAME}/theme/error.html?code=500
ErrorDocument 502 http://%{HTTP_HOST}/{FOLDERNAME}/theme/error.html?code=502

The error code is sent as parameter in a query string - which is then parsed in a switch case statement with JavaScript/jQuery and then displays the appropriate error message depending on the parameter that was sent.

Any input on this? :)

oupala commented 6 years ago

I like to have an easy static solution that does not require any js processing on the client side.

I think it was a good idea to merge the current pull request as is.

It should not prevent you to test your idea in another pull request, so that we can compare the two solutions.

nodiscc commented 6 years ago

error code is sent as parameter in a query string - which is then parsed in a switch case statement with JavaScript/jQuery

Please try to avoid unneeded dependencies :/ I like the fact that Apaxy is simple and makes use of standard apache features. If you are looking for something more complex, have a look at https://larsjung.de/h5ai/

oupala commented 6 years ago

I agree with @nodiscc.

But I think there is a huge difference between h5ai and apaxy: while h5ai needs php and some server side processing in php, apaxy will stay an apache + client side solution.

If we add an external dependencie, it will be manager by the automation script (see #107) while the standard version of apaxy will remain simple and self-contained.