marley 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +0,0 @@
1
-
2
- module Marley
3
- module Joints
4
- class UserBasedNavigation < Joint
5
- LOGIN_FORM= [:instance,{:url => 'login',:description => 'Existing users please log in here:',:new_rec => true,:schema => [[:text,'name',RESTRICT_REQ],[:password,'password',RESTRICT_REQ]]}]
6
- module ClassMethods
7
- module User
8
- def sections
9
- end
10
- end
11
- end
12
- module Resources
13
- class MainMenu
14
- attr_accessor :title,:name,:description, :items
15
- def self.rest_get
16
- new.to_json
17
- end
18
- def initialize
19
- if $request[:user].new?
20
- u=$request[:user].to_a
21
- u[1].merge!({:description => 'If you don\'t already have an account, please create one here:'})
22
- @title="Welcome to #{$request[:opts][:app_name]}"
23
- @description='Login or signup here.'
24
- @items=[LOGIN_FORM,u]
25
- else
26
- $request[:user].class.sections
27
- end
28
- end
29
- def self.requires_user?
30
- true
31
- end
32
- def to_json
33
- [:section,{:title => @title,:description => @description,:name => @name, :navigation => @items}]
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end