Skip to content
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

Custom frontend (index/home page before login) #348

Closed
shubhank008 opened this issue Jan 19, 2015 · 12 comments
Closed

Custom frontend (index/home page before login) #348

shubhank008 opened this issue Jan 19, 2015 · 12 comments

Comments

@shubhank008
Copy link

I am wondering how is/are the pages handled when a user tries to access the domain seafile is installed on ? I see that initially a login page is shown always and if user is logged in, hes redirected to libraryHomePage.

I wanted to try and create a few custom html/php based frontend pages like a actual "home page", help page, FAQ, etc. which will open by default on domain root and open the seafile login page externally by its url (adding link in nav bar and such)
Basically have a proper website-like structure

I know one of the solutions is to host the seafile instances on sub-domains like cloud.xxx.com or on non-root like xxx.com/seafile but are there any alternatives ?

@shoeper
Copy link
Collaborator

shoeper commented Jan 19, 2015

yeah. Seahub is also opensource. Just add what you need.

@shubhank008
Copy link
Author

erm that I know of and is what I am trying to do, what I am asking about or trying to understand is how or rather from which file is the behaviour controlled:
"when a user tries to access the domain seafile is installed on ? I see that initially a login page is shown always and if user is logged in, hes redirected to libraryHomePage."

What I want to do is serve a html/php based homepage when domain opens instead of the login page and instead open the login page manually via a login link

@shoeper
Copy link
Collaborator

shoeper commented Jan 19, 2015

Seahub is written in python, so the best way would be to extend the pages with python. In the wiki you can find which files you have to modify to change the layout

@shubhank008
Copy link
Author

erm that also I have already checked, but what I am trying to find out is how is the navigation of the seahub is working
Basically how and what file decided whether to show login page or libraryHomePage when you open the seafile domain

My initial thought was that the login page itself was the default root/index page and it had a check for cookie/session to see if a user is already logged in and if he is, redirect him to the library home.
But I checked login page template and that is not the case

By the way, just to know, is seahub 100% made using the web/python APIs or has methods/codes of its own ?

@shoeper
Copy link
Collaborator

shoeper commented Jan 20, 2015

afaik redirect happens here (I'm not member of the team):

return HttpResponseRedirect(reverse(myhome))

If YOU want to work with seafile look in the code, work with it, learn how it works.
Language can also easily been found out via github; JavaScript 58.6% Python 35.6% CSS 5.6% Shell 0.2%. As we can see in media/js jQuery and other libraries are in use so we can assume that almost anything is written in python (at least the whole backend).
And as you can see here: https://github.com/haiwen/seahub/search?l=bash the 0.2% shell are for testing and developement.

@shubhank008
Copy link
Author

thanks a ton !! Didnt expected it in a file called init.py as being a php-based developer I was looking for something directly like a htaccess/index.php and then into directly code of main files to try and find it

The reason why I asked about if the seahub was using same webAPIs was because I was interested in creating a php based frontend for it based on the webAPIs for various functions,unless and ofcourse if there are functions/features in current seahub that can only be used via a python webserver

@shoeper
Copy link
Collaborator

shoeper commented Jan 20, 2015

Thats current documentation for the web api. http://manual.seafile.com/develop/web_api.html
Not sure if it can do everything, but quite much.

@shubhank008
Copy link
Author

Asking here instead of creating a new ticket, but how do you go around creating a new page ?
I want to add/create a new page called FAQ to the site, do I just create a faq.html template in templates (or media/custom folder) and add its link in existing django code (like footer.html) ?

@lins05
Copy link
Contributor

lins05 commented Jan 26, 2015

You need some basic knowledge of Django.

https://www.google.co.jp/search?q=django+tutorial&ie=utf-8&oe=utf-8&gws_rd=cr&ei=eqPFVL6aHpLW8gWzxoGQDw

On Mon, Jan 26, 2015 at 9:26 AM, shubhank008 notifications@github.com
wrote:

Asking here instead of creating a new ticket, but how do you go around
creating a new page ?
I want to add/create a new page called FAQ to the site, do I just create a
faq.html template in templates (or media/custom folder) and add its link in
existing django code (like footer.html) ?


Reply to this email directly or view it on GitHub
#348 (comment).

@shubhank008
Copy link
Author

Just asking it for knowledge purpose, but was there any particular reason or advantage for not creating seahub in PHP or RubyOnRails ? Or was it to have seahub interact with seafile and python APIs better ?

Trying to understand as I have been thinking to recreate a php-based version of seahub

@lins05
Copy link
Contributor

lins05 commented Jan 26, 2015

There are truly lots of excellent tools/languages/frameworks that are
sufficient to build a good web ui. We choose python and Django because we
know them best. You can build a custom web ui using seahub web api with any
language you know.

On Mon, Jan 26, 2015 at 10:20 AM, shubhank008 notifications@github.com
wrote:

Just asking it for knowledge purpose, but was there any particular reason
or advantage for not creating seahub in PHP or RubyOnRails ? Or was it to
have seahub interact with seafile and python APIs better ?

Trying to understand as I have been thinking to recreate a php-based
version of seahub


Reply to this email directly or view it on GitHub
#348 (comment).

@shubhank008
Copy link
Author

Phew, thanks. Thats what I wanted to know, I thought Django/python had some advantage or was needed to interact with seafile on root level, if its just a matter of preference, then means I can most probably create a full frontend like seahub in php as well by using the APIs, though since its a much more large scale task, guess will hold on till really need it

For the time being, will hire a freelance django/python dev to get my work done, learning a new language gonna be a new challenge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants