More Web Stuff

Posted by TXTCLA55 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
More Web Stuff
June 05, 2014 04:07PM
I've an unholy love for just making stuff with HTML/CSS and it kills me to see an open source project where I cannot easily do so. I've read the other topics on custom design, but I'm a noob to all this ssh stuff and I ended up messing up the PirateBox and had to call in a friend to fix it.

Solution? To be honest I'd just like to theme it, upload my own CSS file maybe, MAYBE a few HTML edits. It would be nice if there was a dirt simple "drop in USB" or even better a web interface. Any ideas or suggestions on doing this would be great, but again, I'm a noob and I'm prone to messing stuff up.



Edited 1 time(s). Last edit at 06/05/2014 10:41PM by TXTCLA55.
Re: More Web Stuff
June 06, 2014 07:57AM
Hi,
there is the possibility to use something called "offload_www", which enables you to edit the files on the usb stick. But that removes alot of features.

But you can use something like WinSCP to have SFTP access for editing the files on you desktop and upload a new version.


Matthias
Re: More Web Stuff
June 06, 2014 05:11PM
Thanks! The first time I tried to off load the www folder I kept getting a 404 error when I tried to connect or refresh the page. Eventually though I actually managed to get the hang of ssh and vi and made some changes to the html and css.

There should be more documentation on this as I'm sure another poor soul will have the same problem I did. Really just a basic run through of how you get to the www folder and if you want to change the look, copy, etc. here's how type post...actually, I think I'll make a video on it tongue sticking out smiley
Re: More Web Stuff
June 06, 2014 07:30PM
The www_offload is only made for ppl who know what they do, because it is far beyond our possibilities to help. Sorry.
Re: More Web Stuff
June 06, 2014 09:44PM
Hmmm so the only way to edit the front end is through ssh or off loading. I really wish that wasn't so but I can understand that it was done for a reason. Thanks.
Re: More Web Stuff
June 06, 2014 09:57PM
maybe this howto can help you at least a bit: [ubuntuhak.blogspot.de]
Re: More Web Stuff
June 18, 2014 02:32AM
Hi,

I'm interested in modding the pirate box for different themes or design with modules that can be 'add-ons'. Hit me up at my email OR it would be REALLY nice if PirateBox could create a sub-forum for Design/Themes or some other topic name so we can keep it in one section.

I'll check back.

My initial idea to solve your issue is to add a upload .css / index.html page (or zip file that unzips) and replaces the current index and style.css files used. That was people less experienced with the underlying OS and Hardware can still work on the look and feel.

Does that sound like what you would be interested in?
Re: More Web Stuff
June 18, 2014 03:21AM
Hi

I'd be very interested in seeing this come about. I've themed my own and I'd like to make others as well. If anything a unified style base and a simple way to upload a new css file would be amazing.

But we REALLY should get design/theme are going. Even when I started making mine I could never really find any screenshots that were less than a year old.



Edited 1 time(s). Last edit at 06/18/2014 03:23AM by TXTCLA55.
Re: More Web Stuff
June 18, 2014 05:34PM
TXTCLA55,

I'll start on this over the weekend and see what I can put together. I'll try to keep it simple and concentrate at first on the following:

Upload Theme

Then later:
Select Themes (support for more than one theme)

I would REALLY like it if PirateBox would put a Theme sub-forum smiling smiley
Re: More Web Stuff
June 18, 2014 10:02PM
Alright!

I had the recent experience where I broke my PirateBox when trying to mod it, its fixed now, but I'm not a code guy. I am a designer guy though, I REALLY want to add some themes tongue sticking out smiley
Re: More Web Stuff
June 19, 2014 04:41AM
TXTCLA55,

How might I contact you directly to send you stuff to test out? Once I have working changes, you can test them on your unit and see if the instructions work for you. Then you should be able to make suggestions and also your own style/theme since I'm not that great at themes and styles you can do the designing part.

- lnikon
Re: More Web Stuff
June 19, 2014 01:12PM
I like where this is heading. More power to the Open source!

Can you guys upload some working betas when you've resolved the module issues?

Thank you!
Re: More Web Stuff
June 19, 2014 03:26PM
Hey All, FYI I just created a Mods and Themes forum and moved this thread to it.
Re: More Web Stuff
June 19, 2014 06:31PM
Sure I've PM'd you an email. I'm not sure if I'll be much use beta testing. The previous time I modded I had a "bricked" router for a week lol.
Re: More Web Stuff
June 23, 2014 01:33AM
So I made some progress at really learning how this thing is put together. I've found that there is already an advanced feature for uploading built into the system. Once you enable it , it will allow you to specify where you want to upload the file to but I haven't gotten it to work the way we want to.

Then the World Cup came on and it ruined all my plans for working on this. The next important game for me isn't until Thursday so I think I should be able to get some more work done.

--
lnikon
Re: More Web Stuff
July 06, 2014 02:33PM
The easiest way i've found of doing it from Windows to a MR3020 is to SSH with WinSCP into the box, then just right-click/edit on the files like index.html/style.css to edit directly on the box.

    [*] do the edit
    [*] click save
    [*] F5 in the browser



Edited 1 time(s). Last edit at 07/06/2014 02:34PM by mod7e.
Re: More Web Stuff
July 16, 2014 08:42PM
Okay,

let's imagine something : a administration section to add custom CSS by uploading.
This means creating a login page (easy), an admin page to choose which theme to use and a page to apply changes (in perl).
Then the index.html page should be an perl script (index.pl) which reads the theme choosen by the admin.
To upload a CSS, for now, I prefer the SSH way, but we could imagine a upload tool in perl.

I'm trying to work on this feature tomorrow.

Cordially
Re: More Web Stuff
July 18, 2014 09:00AM
Ok, almost done...

This is the image of my current development goal.
It's simple, but means index.pl is needed at www directory (which works on my box with some modifications in lighthttpd.conf, but is maybe not highly secured. Help needed for this...)



So there is a /admin directory to do some conf (lang and css). It allows admin to change the directories where the template for lang and the custom style.css file are. The conf are saved in /lang.conf and /style.conf

There is a /lang directory with some subdirectories :
- default : the actual distribution of index.html renames in index.tpl
- fr : the translated index.tpl in french for example

There is a /styles directory with some subdirectories :
- default : the actual style.css
- mystyle : a custom style.css

This could be the index.pl perl script (not tested yet, not sure HTML::Template is available) :
#!/usr/bin/perl
use HTML::Template;
use CGI;

$cgi = new CGI;

# Open lang.conf
my $file = "lang.conf";
open (CONF, $file);
my $lang;
while (<CONF> ) {
	$lang =$_;
}
close CONF;

# Open style.conf
my $file = "style.conf";
open (CONF, $file);
my $style;
while (<CONF> ) {
	$style =$_;
}
close CONF;

# Open HTML template
my $template = HTML::Template->new(filename => '/$lang/test.tmpl');

# give style parameter
$template->param(STYLE => $style/style.css);

# Sending Content-Type (needed) and display template
print "Content-Type: text/html\n\n", $template->output;

I'm tring to validate the index.pl this week-end.

Janolap1
Re: More Web Stuff
August 05, 2014 06:56PM
Awesome! This is an exciting thread.

I've been doing some work on designing new themes for LibraryBox/PirateBox. I'd like to see some sort of "theme management" page working on PirateBox. I remember the days when I edited via SSH and Vi, nowadays I simply do my mods on my PC and transfer my work to the USB then move the file in place. Since I'm primarily on LibraryBox now it's much easier with it's FTP features.

I love contributing as a tester and would be open to help testing any mods/scripts/themes/etc.