aureus 1.3.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -1
  3. data/Gemfile +9 -8
  4. data/Gemfile.lock +105 -104
  5. data/README.md +80 -0
  6. data/Rakefile +3 -16
  7. data/app/assets/javascripts/aureus/index.js +78 -20
  8. data/app/assets/stylesheets/aureus/index.scss +3 -35
  9. data/app/assets/stylesheets/aureus/skin/default.scss +52 -0
  10. data/app/assets/stylesheets/aureus/theme.scss +7 -0
  11. data/app/assets/stylesheets/aureus/theme/base.scss +19 -0
  12. data/app/assets/stylesheets/aureus/theme/content.scss +65 -0
  13. data/app/assets/stylesheets/aureus/{form.scss → theme/form.scss} +27 -27
  14. data/app/assets/stylesheets/aureus/theme/messages.scss +16 -0
  15. data/app/assets/stylesheets/aureus/theme/navigation.scss +42 -0
  16. data/app/assets/stylesheets/aureus/theme/table.scss +121 -0
  17. data/app/assets/stylesheets/aureus/theme/toolbar.scss +80 -0
  18. data/aureus.gemspec +21 -12
  19. data/config.ru +10 -0
  20. data/lib/aureus.rb +22 -18
  21. data/lib/aureus/components/box.rb +58 -0
  22. data/lib/aureus/components/content.rb +19 -0
  23. data/lib/aureus/components/data_table.rb +169 -0
  24. data/lib/aureus/components/listing.rb +43 -0
  25. data/lib/aureus/components/messages.rb +27 -0
  26. data/lib/aureus/components/navigation.rb +48 -0
  27. data/lib/aureus/components/row.rb +69 -0
  28. data/lib/aureus/components/simple_map.rb +21 -0
  29. data/lib/aureus/components/toolbar.rb +124 -0
  30. data/lib/aureus/engine.rb +8 -2
  31. data/lib/aureus/helper.rb +56 -55
  32. data/lib/aureus/renderable.rb +4 -12
  33. data/lib/aureus/version.rb +2 -2
  34. data/lib/generators/aureus/devise_i18n/devise_i18n_generator.rb +17 -12
  35. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.de.yml +0 -0
  36. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.en.yml +1 -1
  37. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.de.yml +1 -1
  38. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.en.yml +1 -1
  39. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.de.yml +0 -0
  40. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.en.yml +0 -0
  41. data/lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb +25 -0
  42. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.de.yml +11 -0
  43. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.en.yml +11 -0
  44. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.de.yml +9 -0
  45. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.en.yml +9 -0
  46. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.de.yml +12 -0
  47. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.en.yml +12 -0
  48. data/lib/generators/aureus/devise_invitable_views/devise_invitable_views_generator.rb +23 -0
  49. data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/edit.html.haml +9 -0
  50. data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/new.html.haml +8 -0
  51. data/lib/generators/aureus/devise_invitable_views/templates/devise/mailer/invitation_instructions.html.haml +5 -0
  52. data/lib/generators/aureus/devise_views/devise_views_generator.rb +17 -15
  53. data/lib/generators/aureus/devise_views/templates/devise/confirmations/new.html.haml +5 -5
  54. data/lib/generators/aureus/devise_views/templates/devise/mailer/confirmation_instructions.html.haml +3 -3
  55. data/lib/generators/aureus/devise_views/templates/devise/mailer/reset_password_instructions.html.haml +5 -5
  56. data/lib/generators/aureus/devise_views/templates/devise/mailer/unlock_instructions.html.haml +4 -4
  57. data/lib/generators/aureus/devise_views/templates/devise/passwords/edit.html.haml +7 -7
  58. data/lib/generators/aureus/devise_views/templates/devise/passwords/new.html.haml +5 -5
  59. data/lib/generators/aureus/devise_views/templates/devise/registrations/edit.html.haml +9 -9
  60. data/lib/generators/aureus/devise_views/templates/devise/registrations/new.html.haml +7 -7
  61. data/lib/generators/aureus/devise_views/templates/devise/sessions/new.html.haml +7 -7
  62. data/lib/generators/aureus/devise_views/templates/devise/shared/_links.html.haml +6 -6
  63. data/lib/generators/aureus/devise_views/templates/devise/unlocks/new.html.haml +5 -5
  64. data/lib/generators/aureus/layout/layout_generator.rb +10 -10
  65. data/lib/generators/aureus/layout/templates/layout.html.haml +8 -8
  66. data/lib/generators/aureus/views/templates/views/_form.html.haml +3 -3
  67. data/lib/generators/aureus/views/templates/views/_item.html.haml +2 -2
  68. data/lib/generators/aureus/views/templates/views/_list.html.haml +8 -8
  69. data/lib/generators/aureus/views/templates/views/edit.html.haml +4 -4
  70. data/lib/generators/aureus/views/templates/views/index.html.haml +3 -3
  71. data/lib/generators/aureus/views/templates/views/new.html.haml +4 -4
  72. data/lib/generators/aureus/views/templates/views/show.html.haml +4 -4
  73. data/lib/generators/aureus/views/views_generator.rb +70 -68
  74. data/spec/controllers/all_spec.rb +19 -0
  75. data/spec/internal/app/assets/javascripts/application.js +9 -0
  76. data/spec/internal/app/assets/stylesheets/application.scss +5 -0
  77. data/spec/internal/app/controllers/all_controller.rb +14 -0
  78. data/spec/internal/app/controllers/resources_controller.rb +2 -0
  79. data/spec/{lib/helper → internal/app/models}/resource.rb +0 -0
  80. data/spec/internal/app/views/all/centered.html.haml +5 -0
  81. data/spec/internal/app/views/all/index.html.haml +39 -0
  82. data/spec/internal/app/views/layouts/application.html.haml +24 -0
  83. data/spec/internal/app/views/layouts/naked.html.haml +10 -0
  84. data/spec/internal/config/database.yml +3 -0
  85. data/spec/internal/config/routes.rb +5 -0
  86. data/spec/internal/db/schema.rb +10 -0
  87. data/spec/internal/log/.gitignore +1 -0
  88. data/spec/internal/public/favicon.ico +0 -0
  89. data/spec/lib/generators/devise_i18n_spec.rb +19 -0
  90. data/spec/lib/generators/devise_invitable_i18n_spec.rb +19 -0
  91. data/spec/lib/generators/devise_invitable_views_spec.rb +19 -0
  92. data/spec/lib/generators/devise_views_spec.rb +25 -0
  93. data/spec/lib/generators/layout_spec.rb +17 -0
  94. data/spec/lib/generators/views_spec.rb +26 -0
  95. data/spec/requests/all_spec.rb +12 -0
  96. data/spec/spec_helper.rb +15 -0
  97. metadata +219 -78
  98. data/.rspec +0 -2
  99. data/Guardfile +0 -4
  100. data/Readme.md +0 -370
  101. data/TODO.md +0 -11
  102. data/app/assets/images/aureus/background.png +0 -0
  103. data/app/assets/images/aureus/topbar.png +0 -0
  104. data/app/assets/javascripts/aureus/defaults.js +0 -30
  105. data/app/assets/javascripts/aureus/extensions.js +0 -42
  106. data/app/assets/javascripts/aureus/functions.js +0 -67
  107. data/app/assets/javascripts/aureus/plugins/jquery-calendrical.js +0 -508
  108. data/app/assets/javascripts/aureus/plugins/jquery-datatables.js +0 -11838
  109. data/app/assets/javascripts/aureus/plugins/jquery-qtip.js +0 -15
  110. data/app/assets/stylesheets/aureus/base.scss +0 -48
  111. data/app/assets/stylesheets/aureus/content.scss +0 -100
  112. data/app/assets/stylesheets/aureus/mixins.scss +0 -43
  113. data/app/assets/stylesheets/aureus/navigation.scss +0 -43
  114. data/app/assets/stylesheets/aureus/reset.scss +0 -50
  115. data/app/assets/stylesheets/aureus/table.scss +0 -153
  116. data/app/assets/stylesheets/aureus/topbar.scss +0 -89
  117. data/app/assets/stylesheets/aureus/ui.scss +0 -98
  118. data/lib/aureus/box.rb +0 -54
  119. data/lib/aureus/content.rb +0 -15
  120. data/lib/aureus/data_table.rb +0 -148
  121. data/lib/aureus/listing.rb +0 -39
  122. data/lib/aureus/map.rb +0 -17
  123. data/lib/aureus/messages.rb +0 -23
  124. data/lib/aureus/navigation.rb +0 -42
  125. data/lib/aureus/row.rb +0 -65
  126. data/lib/aureus/toolbar.rb +0 -99
  127. data/spec/lib/helper/schema.rb +0 -6
  128. data/spec/lib/render_spec.rb +0 -16
  129. data/spec/lib/spec_helper.rb +0 -21
  130. data/spec/lib/views/box.haml +0 -14
  131. data/spec/lib/views/content.haml +0 -2
  132. data/spec/lib/views/datatable.haml +0 -11
  133. data/spec/lib/views/listing.haml +0 -5
  134. data/spec/lib/views/messages.haml +0 -2
  135. data/spec/lib/views/navigation.haml +0 -4
  136. data/spec/lib/views/row.haml +0 -28
  137. data/spec/lib/views/toolbar.haml +0 -11
@@ -1,89 +0,0 @@
1
- #aureus-toolbar {
2
- padding: 11px 40px;
3
- height: 18px;
4
- @include gradient(#333,#222);
5
- background-image: url($asset_topbar_background);
6
- h1 {
7
- color: $color_main;
8
- margin: 2px 0px;
9
- font-size: 14px;
10
- float: left;
11
- text-shadow: -1px -1px 0 black;
12
- }
13
- > ul.left {
14
- float: left;
15
- margin-left: 20px;
16
- }
17
- > ul.right {
18
- float: right;
19
- }
20
- > ul {
21
- > li {
22
- display: inline;
23
- position: relative;
24
- > a, span {
25
- font-size: 14px ;
26
- color: #ddd;
27
- text-decoration: none;
28
- padding: 4px 10px;
29
- @include border-radius(15px);
30
- text-shadow: -1px -1px 0 black;
31
- }
32
- > span {
33
- color: #777;
34
- }
35
- }
36
- > li.dropdown-outer {
37
- > div {
38
- display: inline;
39
- font-size: 14px ;
40
- color: #ddd;
41
- text-decoration: none;
42
- padding: 4px 10px;
43
- @include border-radius(15px);
44
- text-shadow: -1px -1px 0 black;
45
- }
46
- > ul.dropdown-inner {
47
- display: none;
48
- li {
49
- margin: 7px 0;
50
- a {
51
- white-space: nowrap;
52
- }
53
- }
54
- }
55
- }
56
- > li:hover {
57
- > a {
58
- color: white;
59
- @include gradient(#000,#333);
60
- }
61
- }
62
- li.dropdown-outer:hover {
63
- margin-bottom: 5px;
64
- > ul.dropdown-inner {
65
- margin-left: -20px;
66
- display: block !important;
67
- position: absolute;
68
- @include gradient(#333,#222);
69
- @include border-radius(15px);
70
- padding: 20px;
71
- margin-top: 5px;
72
- li > a, span {
73
- font-size: 14px ;
74
- color: #ddd;
75
- text-decoration: none;
76
- padding: 4px 10px;
77
- @include border-radius(15px);
78
- text-shadow: -1px -1px 0 black;
79
- }
80
- > li:hover {
81
- > a {
82
- color: white;
83
- @include gradient(#000,#333);
84
- }
85
- }
86
- }
87
- }
88
- }
89
- }
@@ -1,98 +0,0 @@
1
- .ui-datepicker {
2
- margin-top: 5px;
3
- width: 250px;
4
- padding: 15px;
5
- @include gradient(#333,#222);
6
- @include box-shadow(0,0,3px,black);
7
- @include border-radius(5px);
8
- .ui-datepicker-header {
9
- padding: 0 5px;
10
- a, span {
11
- color: white;
12
- text-shadow: -1px -1px 0 black;
13
- }
14
- .ui-datepicker-prev {
15
- float :left;
16
- cursor: pointer;
17
- }
18
- .ui-datepicker-next {
19
- float: right;
20
- cursor: pointer;
21
- }
22
- .ui-datepicker-title {
23
- text-align: center;
24
- }
25
- }
26
- table {
27
- margin-top: 10px;
28
- width: 100%;
29
- @include gradient(#ddd,#bbb);
30
- @include border-radius(3px);
31
- @include box-shadow(0,0,3px,black);
32
- td, th {
33
- padding: 5px 7px;
34
- color: black;
35
- text-shadow: 1px 1px 0 white;
36
- text-align: center;
37
- a {
38
- color: black;
39
- text-decoration: none;
40
- }
41
- a:hover {
42
- color: $color_main;
43
- }
44
- }
45
- th {
46
- color: #444;
47
- }
48
- .ui-datepicker-today a {
49
- color: $color_main;
50
- }
51
- }
52
- }
53
-
54
- .calendricalTimePopup {
55
- margin-top: 5px;
56
- ul {
57
- width: 255px;
58
- padding: 15px;
59
- @include gradient(#333,#222);
60
- @include box-shadow(0,0,3px,black);
61
- @include border-radius(5px);
62
- overflow: hidden;
63
- li {
64
- display: block;
65
- width: 45px;
66
- float: left;
67
- margin: 3px;
68
- padding: 0;
69
- a {
70
- color: white;
71
- font-size: 14px;
72
- text-shadow: -1px -1px 0 black;
73
- text-decoration: none;
74
- }
75
- a:hover {
76
- color: $color_main;
77
- }
78
- }
79
- }
80
- }
81
-
82
- .ui-autocomplete {
83
- width: 400px;
84
- padding: 5px 15px;
85
- @include gradient(#333,#222);
86
- @include box-shadow(0,0,3px,black);
87
- @include border-radius(5px);
88
- li {
89
- color: white;
90
- font-size: 14px;
91
- text-shadow: -1px -1px 0 black;
92
- margin: 10px 0px;
93
- }
94
- li:hover {
95
- color: $color_main;
96
- cursor: pointer;
97
- }
98
- }
data/lib/aureus/box.rb DELETED
@@ -1,54 +0,0 @@
1
- module Aureus
2
-
3
- class Box < Renderable
4
-
5
- def initialize title, options, &block
6
- init options, :for => :text, :centered => false
7
- init_haml_helpers
8
- @title = title
9
- @buttons = Array.new
10
- @content = capture_haml self, &block
11
- end
12
-
13
- def content &block
14
- @new_content = capture_haml &block
15
- end
16
-
17
- def foot &block
18
- @foot = capture_haml &block
19
- end
20
-
21
- def button content
22
- @buttons << BoxButton.new(content)
23
- end
24
-
25
- def render
26
- title = content_tag("h3",compact(content_tag("span",@title),compact_render(*@buttons)))
27
- classes = ["box"]
28
- classes << "centered" if @options[:centered]
29
- @content = @new_content if not @new_content.nil?
30
- content_tag "div", :class => classes.join(" ") do
31
- case @options[:for]
32
- when :form
33
- @content = content_tag("ul",@content,:class => "content")
34
- end
35
- footer = @foot.nil? ? "" : content_tag("div",@foot,:class => "foot")
36
- compact title, content_tag("div",@content), footer
37
- end
38
- end
39
-
40
- end
41
-
42
- class BoxButton < Renderable
43
-
44
- def initialize content
45
- @content = content
46
- end
47
-
48
- def render
49
- @content
50
- end
51
-
52
- end
53
-
54
- end
@@ -1,15 +0,0 @@
1
- module Aureus
2
-
3
- class Content < Renderable
4
-
5
- def initialize content
6
- @content = content
7
- end
8
-
9
- def render
10
- content_tag "div", @content, :id => "content"
11
- end
12
-
13
- end
14
-
15
- end
@@ -1,148 +0,0 @@
1
- module Aureus
2
-
3
- class DataTable < Renderable
4
-
5
- def initialize resource, args
6
- init args, { :toolbar => true }
7
- @resource = resource
8
- @head = DataTableHead.new
9
- @rows = Array.new
10
- end
11
-
12
- def head
13
- yield @head
14
- end
15
-
16
- def row
17
- @resource.each do |r|
18
- row = DataTableRow.new
19
- yield row, r
20
- @rows << row
21
- end
22
- end
23
-
24
- def render
25
- content_tag "table", :id => @resource.class.name.downcase, :class => (@options[:toolbar] ? "datatable":"datatable-no-toolbar") do
26
- compact @head.render, content_tag("tbody",compact_render(*@rows))
27
- end
28
- end
29
-
30
- end
31
-
32
- class DataTableHead < Renderable
33
-
34
- def initialize
35
- @columns = Array.new
36
- end
37
-
38
- def text name
39
- @columns << DataTableHeadColumn.new(name,"text-sorting")
40
- end
41
-
42
- def date name
43
- @columns << DataTableHeadColumn.new(name,"date-sorting")
44
- end
45
-
46
- def raw name
47
- @columns << DataTableHeadColumn.new(name,"no-sorting")
48
- end
49
-
50
- def render
51
- raw ""
52
- content_tag "thead" do
53
- content_tag "tr", compact_render(*@columns)
54
- end
55
- end
56
-
57
- end
58
-
59
- class DataTableHeadColumn < Renderable
60
-
61
- def initialize name, sorting
62
- @name = name
63
- @sorting = sorting
64
- end
65
-
66
- def render
67
- content_tag "th", @name, :class => @sorting
68
- end
69
-
70
- end
71
-
72
- class DataTableRow < Renderable
73
-
74
- def initialize
75
- init_haml_helpers
76
- @cells = Array.new
77
- @buttons = Array.new
78
- end
79
-
80
- def cell data="", &block
81
- if block_given?
82
- @cells << DataTableRowCell.new(capture_haml(&block))
83
- else
84
- @cells << DataTableRowCell.new(data)
85
- end
86
- end
87
-
88
- def button type_or_title, url, *args
89
- if type_or_title.is_a? Symbol
90
- @buttons << DataTableRowButton.new(type_or_title,type_or_title.to_s,url,args)
91
- else
92
- @buttons << DataTableRowButton.new(:text,type_or_title.to_s,url,args)
93
- end
94
- end
95
-
96
- def button_raw content
97
- @buttons << Renderable.new(content)
98
- end
99
-
100
- def render
101
- content_tag "tr", compact_render(*@cells)+content_tag("td",compact_render(*@buttons),:class => "buttons")
102
- end
103
-
104
- end
105
-
106
- class DataTableRowCell < Renderable
107
-
108
- def initialize data
109
- @data = data
110
- end
111
-
112
- def render
113
- content_tag "td", @data
114
- end
115
-
116
- end
117
-
118
- class DataTableRowButton < Renderable
119
-
120
- def initialize type, text, url, options
121
- init options, :remote => true, :confirm => "Delete resource?"
122
- @type = type
123
- @text = text
124
- @url = url
125
- end
126
-
127
- def render
128
- case @type
129
- when :text
130
- link_to @text, @url
131
- when :print
132
- link_to @text, @url, :class => :print
133
- when :show
134
- link_to @text, @url, :class => :show
135
- when :edit
136
- link_to @text, @url, :class => :edit
137
- when :destroy
138
- if @options[:remote]
139
- link_to @text, @url, :class => :destroy, :method => :delete, :data => { :confirm => @options[:confirm] }
140
- else
141
- link_to @text, @url, :class => :destroy
142
- end
143
- end
144
- end
145
-
146
- end
147
-
148
- end
@@ -1,39 +0,0 @@
1
- module Aureus
2
-
3
- class Listing < Renderable
4
-
5
- def initialize
6
- @entries = Array.new
7
- end
8
-
9
- def entry head, body = nil, &block
10
- init_haml_helpers
11
- if block_given?
12
- @entries << ListingEntry.new(head,capture_haml(&block))
13
- else
14
- @entries << ListingEntry.new(head,body)
15
- end
16
- end
17
-
18
- def render
19
- content_tag "table", compact_render(*@entries), :class => "simple-table"
20
- end
21
-
22
- end
23
-
24
- class ListingEntry < Renderable
25
-
26
- def initialize head, body
27
- @head = head
28
- @body = body
29
- end
30
-
31
- def render
32
- content_tag "tr" do
33
- compact content_tag("th",@head), content_tag("td",@body)
34
- end
35
- end
36
-
37
- end
38
-
39
- end