Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

User customizable index page

  • Loading branch information...
commit b69f7799ec4f180994e2470411785828ba5fc883 1 parent 0fa81ea
myfreeweb authored
15 data/002_Add_IndexFile.rb
View
@@ -0,0 +1,15 @@
+require 'rubygems'
+require 'sequel'
+
+class Add_IndexFile < Sequel::Migration
+ def up
+ alter_table(:users) do
+ add_column :indexfile, String
+ end
+ end
+ def down
+ alter_table(:users) do
+ drop_column :indexfile
+ end
+ end
+end
4 views/pages.haml
View
@@ -12,8 +12,8 @@
%a{:href => "/pages/#{page}"}= page
%article
%header
- %h1= page
- %a{:href => "/pages/#{@cur_page['name']}/delete"} delete
+ %h1= @cur_page[:name]
+ %a{:href => "/pages/#{@cur_page[:name]}/delete"} delete
= @cur_page['text'] or "This page doesn't exist yet."
%form{:method => "post", :action => ""}
%textarea{:name => "text"}= @cur_page['text']
4 views/settings.haml
View
@@ -8,5 +8,7 @@
%h1 Settings
%form{:method => "post", :action => ""}
%label{:for => "folder"} Folder:
- %input{:name => "folder", :type => "text", value => @folder}
+ %input{:name => "folder", :type => "text", :value => @user.folder}
+ %label{:for => "indexfile"} Index file (main page):
+ %input{:name => "indexfile", :type => "text", :value => @user.indexfile}
%button{:type => "submit"} Save
Please sign in to comment.
Something went wrong with that request. Please try again.