aureus 1.3.1 → 2.1.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.
- checksums.yaml +7 -0
- data/.gitignore +4 -1
- data/Gemfile +9 -8
- data/Gemfile.lock +105 -104
- data/README.md +80 -0
- data/Rakefile +3 -16
- data/app/assets/javascripts/aureus/index.js +78 -20
- data/app/assets/stylesheets/aureus/index.scss +3 -35
- data/app/assets/stylesheets/aureus/skin/default.scss +52 -0
- data/app/assets/stylesheets/aureus/theme.scss +7 -0
- data/app/assets/stylesheets/aureus/theme/base.scss +19 -0
- data/app/assets/stylesheets/aureus/theme/content.scss +65 -0
- data/app/assets/stylesheets/aureus/{form.scss → theme/form.scss} +27 -27
- data/app/assets/stylesheets/aureus/theme/messages.scss +16 -0
- data/app/assets/stylesheets/aureus/theme/navigation.scss +42 -0
- data/app/assets/stylesheets/aureus/theme/table.scss +121 -0
- data/app/assets/stylesheets/aureus/theme/toolbar.scss +80 -0
- data/aureus.gemspec +21 -12
- data/config.ru +10 -0
- data/lib/aureus.rb +22 -18
- data/lib/aureus/components/box.rb +58 -0
- data/lib/aureus/components/content.rb +19 -0
- data/lib/aureus/components/data_table.rb +169 -0
- data/lib/aureus/components/listing.rb +43 -0
- data/lib/aureus/components/messages.rb +27 -0
- data/lib/aureus/components/navigation.rb +48 -0
- data/lib/aureus/components/row.rb +69 -0
- data/lib/aureus/components/simple_map.rb +21 -0
- data/lib/aureus/components/toolbar.rb +124 -0
- data/lib/aureus/engine.rb +8 -2
- data/lib/aureus/helper.rb +56 -55
- data/lib/aureus/renderable.rb +4 -12
- data/lib/aureus/version.rb +2 -2
- data/lib/generators/aureus/devise_i18n/devise_i18n_generator.rb +17 -12
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.de.yml +0 -0
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.en.yml +1 -1
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.de.yml +1 -1
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.en.yml +1 -1
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.de.yml +0 -0
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.en.yml +0 -0
- data/lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb +25 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.de.yml +11 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.en.yml +11 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.de.yml +9 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.en.yml +9 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.de.yml +12 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.en.yml +12 -0
- data/lib/generators/aureus/devise_invitable_views/devise_invitable_views_generator.rb +23 -0
- data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/edit.html.haml +9 -0
- data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/new.html.haml +8 -0
- data/lib/generators/aureus/devise_invitable_views/templates/devise/mailer/invitation_instructions.html.haml +5 -0
- data/lib/generators/aureus/devise_views/devise_views_generator.rb +17 -15
- data/lib/generators/aureus/devise_views/templates/devise/confirmations/new.html.haml +5 -5
- data/lib/generators/aureus/devise_views/templates/devise/mailer/confirmation_instructions.html.haml +3 -3
- data/lib/generators/aureus/devise_views/templates/devise/mailer/reset_password_instructions.html.haml +5 -5
- data/lib/generators/aureus/devise_views/templates/devise/mailer/unlock_instructions.html.haml +4 -4
- data/lib/generators/aureus/devise_views/templates/devise/passwords/edit.html.haml +7 -7
- data/lib/generators/aureus/devise_views/templates/devise/passwords/new.html.haml +5 -5
- data/lib/generators/aureus/devise_views/templates/devise/registrations/edit.html.haml +9 -9
- data/lib/generators/aureus/devise_views/templates/devise/registrations/new.html.haml +7 -7
- data/lib/generators/aureus/devise_views/templates/devise/sessions/new.html.haml +7 -7
- data/lib/generators/aureus/devise_views/templates/devise/shared/_links.html.haml +6 -6
- data/lib/generators/aureus/devise_views/templates/devise/unlocks/new.html.haml +5 -5
- data/lib/generators/aureus/layout/layout_generator.rb +10 -10
- data/lib/generators/aureus/layout/templates/layout.html.haml +8 -8
- data/lib/generators/aureus/views/templates/views/_form.html.haml +3 -3
- data/lib/generators/aureus/views/templates/views/_item.html.haml +2 -2
- data/lib/generators/aureus/views/templates/views/_list.html.haml +8 -8
- data/lib/generators/aureus/views/templates/views/edit.html.haml +4 -4
- data/lib/generators/aureus/views/templates/views/index.html.haml +3 -3
- data/lib/generators/aureus/views/templates/views/new.html.haml +4 -4
- data/lib/generators/aureus/views/templates/views/show.html.haml +4 -4
- data/lib/generators/aureus/views/views_generator.rb +70 -68
- data/spec/controllers/all_spec.rb +19 -0
- data/spec/internal/app/assets/javascripts/application.js +9 -0
- data/spec/internal/app/assets/stylesheets/application.scss +5 -0
- data/spec/internal/app/controllers/all_controller.rb +14 -0
- data/spec/internal/app/controllers/resources_controller.rb +2 -0
- data/spec/{lib/helper → internal/app/models}/resource.rb +0 -0
- data/spec/internal/app/views/all/centered.html.haml +5 -0
- data/spec/internal/app/views/all/index.html.haml +39 -0
- data/spec/internal/app/views/layouts/application.html.haml +24 -0
- data/spec/internal/app/views/layouts/naked.html.haml +10 -0
- data/spec/internal/config/database.yml +3 -0
- data/spec/internal/config/routes.rb +5 -0
- data/spec/internal/db/schema.rb +10 -0
- data/spec/internal/log/.gitignore +1 -0
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/lib/generators/devise_i18n_spec.rb +19 -0
- data/spec/lib/generators/devise_invitable_i18n_spec.rb +19 -0
- data/spec/lib/generators/devise_invitable_views_spec.rb +19 -0
- data/spec/lib/generators/devise_views_spec.rb +25 -0
- data/spec/lib/generators/layout_spec.rb +17 -0
- data/spec/lib/generators/views_spec.rb +26 -0
- data/spec/requests/all_spec.rb +12 -0
- data/spec/spec_helper.rb +15 -0
- metadata +219 -78
- data/.rspec +0 -2
- data/Guardfile +0 -4
- data/Readme.md +0 -370
- data/TODO.md +0 -11
- data/app/assets/images/aureus/background.png +0 -0
- data/app/assets/images/aureus/topbar.png +0 -0
- data/app/assets/javascripts/aureus/defaults.js +0 -30
- data/app/assets/javascripts/aureus/extensions.js +0 -42
- data/app/assets/javascripts/aureus/functions.js +0 -67
- data/app/assets/javascripts/aureus/plugins/jquery-calendrical.js +0 -508
- data/app/assets/javascripts/aureus/plugins/jquery-datatables.js +0 -11838
- data/app/assets/javascripts/aureus/plugins/jquery-qtip.js +0 -15
- data/app/assets/stylesheets/aureus/base.scss +0 -48
- data/app/assets/stylesheets/aureus/content.scss +0 -100
- data/app/assets/stylesheets/aureus/mixins.scss +0 -43
- data/app/assets/stylesheets/aureus/navigation.scss +0 -43
- data/app/assets/stylesheets/aureus/reset.scss +0 -50
- data/app/assets/stylesheets/aureus/table.scss +0 -153
- data/app/assets/stylesheets/aureus/topbar.scss +0 -89
- data/app/assets/stylesheets/aureus/ui.scss +0 -98
- data/lib/aureus/box.rb +0 -54
- data/lib/aureus/content.rb +0 -15
- data/lib/aureus/data_table.rb +0 -148
- data/lib/aureus/listing.rb +0 -39
- data/lib/aureus/map.rb +0 -17
- data/lib/aureus/messages.rb +0 -23
- data/lib/aureus/navigation.rb +0 -42
- data/lib/aureus/row.rb +0 -65
- data/lib/aureus/toolbar.rb +0 -99
- data/spec/lib/helper/schema.rb +0 -6
- data/spec/lib/render_spec.rb +0 -16
- data/spec/lib/spec_helper.rb +0 -21
- data/spec/lib/views/box.haml +0 -14
- data/spec/lib/views/content.haml +0 -2
- data/spec/lib/views/datatable.haml +0 -11
- data/spec/lib/views/listing.haml +0 -5
- data/spec/lib/views/messages.haml +0 -2
- data/spec/lib/views/navigation.haml +0 -4
- data/spec/lib/views/row.haml +0 -28
- data/spec/lib/views/toolbar.haml +0 -11
data/lib/aureus/map.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module Aureus
|
2
|
-
|
3
|
-
class Map < Renderable
|
4
|
-
|
5
|
-
def initialize args
|
6
|
-
init args, {}
|
7
|
-
end
|
8
|
-
|
9
|
-
def render
|
10
|
-
if @options[:longitude] and @options[:latitude]
|
11
|
-
content_tag("iframe","",:src => "https://maps.google.ch/maps?q="+@options[:latitude].to_s+","+@options[:longitude].to_s+"&ie=UTF8&z=15&output=embed", :width => @options[:width], :height => @options[:height])
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
data/lib/aureus/messages.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
module Aureus
|
2
|
-
|
3
|
-
class Messages < Renderable
|
4
|
-
|
5
|
-
def initialize flash
|
6
|
-
@flash = flash
|
7
|
-
end
|
8
|
-
|
9
|
-
def render
|
10
|
-
content_tag "div", :id => "messages" do
|
11
|
-
out = Array.new
|
12
|
-
[:notice,:error,:alert].each do |i|
|
13
|
-
if @flash[i]
|
14
|
-
out << content_tag("p", @flash[i], :class => i.to_s)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
compact *out
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
data/lib/aureus/navigation.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
module Aureus
|
2
|
-
|
3
|
-
class Navigation < Renderable
|
4
|
-
|
5
|
-
def initialize
|
6
|
-
@title = ""
|
7
|
-
@buttons = Array.new
|
8
|
-
end
|
9
|
-
|
10
|
-
def title title
|
11
|
-
@title = title
|
12
|
-
end
|
13
|
-
|
14
|
-
def button content
|
15
|
-
@buttons << NavigationButton.new(content)
|
16
|
-
end
|
17
|
-
|
18
|
-
def submit_form_button resource, text
|
19
|
-
@buttons << NavigationButton.new(content_tag("a",text,:onclick=>"aureus_trigger_form('form.#{resource.class.name.underscore}')"))
|
20
|
-
end
|
21
|
-
|
22
|
-
def render
|
23
|
-
content_tag "div", :id => "navigation" do
|
24
|
-
compact content_tag("h2", content_tag("span",@title)), content_tag("ul", compact_render(*@buttons), :id => "quicklinks")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
class NavigationButton < Renderable
|
31
|
-
|
32
|
-
def initialize content
|
33
|
-
@content = content
|
34
|
-
end
|
35
|
-
|
36
|
-
def render
|
37
|
-
content_tag "li", @content
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
data/lib/aureus/row.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
module Aureus
|
2
|
-
|
3
|
-
class Row < Renderable
|
4
|
-
|
5
|
-
def initialize &block
|
6
|
-
init_haml_helpers
|
7
|
-
@columns = Array.new
|
8
|
-
@content = capture_haml self, &block
|
9
|
-
end
|
10
|
-
|
11
|
-
def column width, &block
|
12
|
-
@columns << RowColumn.new(width,capture_haml(&block))
|
13
|
-
end
|
14
|
-
|
15
|
-
def space width
|
16
|
-
@columns << RowColumn.new(width,"")
|
17
|
-
end
|
18
|
-
|
19
|
-
def render
|
20
|
-
if @columns.empty?
|
21
|
-
content_tag "div", @content, :class => "row"
|
22
|
-
elsif @columns.length == 1
|
23
|
-
content_tag "div", @columns.first.content, :class => "row"
|
24
|
-
else
|
25
|
-
total_width = @columns.inject 0 do |sum, n|
|
26
|
-
sum += n.width
|
27
|
-
end
|
28
|
-
out = String.new.html_safe
|
29
|
-
@columns.each_with_index do |c,i|
|
30
|
-
left = 0.5
|
31
|
-
right = 0.5
|
32
|
-
width = (100.0 / total_width * c.width).round
|
33
|
-
if i == 0
|
34
|
-
left = 0
|
35
|
-
width -= 0.5
|
36
|
-
elsif i == @columns.length-1
|
37
|
-
right = 0
|
38
|
-
width -= 0.5
|
39
|
-
else
|
40
|
-
width -= 1
|
41
|
-
end
|
42
|
-
out += content_tag "div", c.content, :class => :column, :style => "width: #{width}%; margin-left: #{left}%; margin-right: #{right}%"
|
43
|
-
end
|
44
|
-
content_tag "div", out, :class => "row"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
class RowColumn < Renderable
|
51
|
-
|
52
|
-
attr_reader :width, :content
|
53
|
-
|
54
|
-
def initialize width, content
|
55
|
-
@width = width
|
56
|
-
@content = content
|
57
|
-
end
|
58
|
-
|
59
|
-
def render
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
data/lib/aureus/toolbar.rb
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
module Aureus
|
2
|
-
|
3
|
-
class Toolbar < Renderable
|
4
|
-
|
5
|
-
def initialize title
|
6
|
-
@title = title
|
7
|
-
@left = ToolbarSection.new "left"
|
8
|
-
@right = ToolbarSection.new "right"
|
9
|
-
end
|
10
|
-
|
11
|
-
def left
|
12
|
-
yield @left
|
13
|
-
end
|
14
|
-
|
15
|
-
def right
|
16
|
-
yield @right
|
17
|
-
end
|
18
|
-
|
19
|
-
def render
|
20
|
-
content_tag "div", { :id => "aureus-toolbar" } do
|
21
|
-
compact content_tag("h1",@title), @left.render, @right.render
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
class ToolbarSection < Renderable
|
28
|
-
|
29
|
-
def initialize position
|
30
|
-
@items = Array.new
|
31
|
-
@position = position
|
32
|
-
end
|
33
|
-
|
34
|
-
def link_to text, url, *args
|
35
|
-
@items << ToolbarButton.new(text,url,args)
|
36
|
-
end
|
37
|
-
|
38
|
-
def dropdown title
|
39
|
-
toolbar = ToolbarDropdown.new(title)
|
40
|
-
yield toolbar
|
41
|
-
@items << toolbar
|
42
|
-
end
|
43
|
-
|
44
|
-
def info text
|
45
|
-
@items << ToolbarInfo.new(text)
|
46
|
-
end
|
47
|
-
|
48
|
-
def render
|
49
|
-
content_tag "ul", compact_render(*@items), :class => @position
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
class ToolbarButton < Renderable
|
55
|
-
|
56
|
-
def initialize text, url, args
|
57
|
-
@text = text
|
58
|
-
@url = url
|
59
|
-
@args = args
|
60
|
-
end
|
61
|
-
|
62
|
-
def render
|
63
|
-
content_tag "li", link_to(@text,@url,*@args)
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
class ToolbarInfo < Renderable
|
69
|
-
|
70
|
-
def initialize text
|
71
|
-
@text = text
|
72
|
-
end
|
73
|
-
|
74
|
-
def render
|
75
|
-
content_tag "li", content_tag("span",@text)
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
class ToolbarDropdown < Renderable
|
81
|
-
|
82
|
-
def initialize title
|
83
|
-
@title = title
|
84
|
-
@items = Array.new
|
85
|
-
end
|
86
|
-
|
87
|
-
def link_to text, url, *args
|
88
|
-
@items << ToolbarButton.new(text,url,args)
|
89
|
-
end
|
90
|
-
|
91
|
-
def render
|
92
|
-
title = content_tag "div", @title, :class => "dropdown-caption"
|
93
|
-
list = content_tag "ul", compact_render(*@items), :class => "dropdown-inner"
|
94
|
-
content_tag "li", title+list, :class => "dropdown-outer"
|
95
|
-
end
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
end
|
data/spec/lib/helper/schema.rb
DELETED
data/spec/lib/render_spec.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative "spec_helper"
|
2
|
-
|
3
|
-
describe Aureus do
|
4
|
-
|
5
|
-
before do
|
6
|
-
@resource = Resource.create! title: "the title", text: "some long text"
|
7
|
-
@resources = [@resource,@resource,@resource]
|
8
|
-
end
|
9
|
-
|
10
|
-
Dir["spec/lib/views/*.haml"].each do |file|
|
11
|
-
it "should render #{file}" do
|
12
|
-
Haml::Engine.new(File.read(file)).render(self)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
data/spec/lib/spec_helper.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "bundler/setup"
|
3
|
-
|
4
|
-
require "rails/all"
|
5
|
-
require "aureus"
|
6
|
-
require "haml"
|
7
|
-
|
8
|
-
Bundler.require :default, :test
|
9
|
-
|
10
|
-
include Aureus::Helper
|
11
|
-
|
12
|
-
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
|
13
|
-
load "spec/lib/helper/schema.rb"
|
14
|
-
load "spec/lib/helper/resource.rb"
|
15
|
-
|
16
|
-
RSpec.configure do |config|
|
17
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
18
|
-
config.run_all_when_everything_filtered = true
|
19
|
-
config.filter_run :focus
|
20
|
-
config.order = "random"
|
21
|
-
end
|
data/spec/lib/views/box.haml
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
.first
|
2
|
-
= aureus_box "first_box" do
|
3
|
-
%strong content
|
4
|
-
|
5
|
-
.second
|
6
|
-
= aureus_box "a title", :centered => true, :for => :form do
|
7
|
-
%li a entry
|
8
|
-
|
9
|
-
.third
|
10
|
-
= aureus_box "a title" do |b|
|
11
|
-
- b.content do
|
12
|
-
%strong the content
|
13
|
-
- b.foot do
|
14
|
-
%strong the footer
|
data/spec/lib/views/content.haml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
.first
|
2
|
-
= aureus_datatable @resources do |t|
|
3
|
-
- t.head do |h|
|
4
|
-
- h.text "Title"
|
5
|
-
- h.text "Text"
|
6
|
-
- t.row do |r,res|
|
7
|
-
- r.cell res.title
|
8
|
-
- r.cell res.text
|
9
|
-
- r.button :show, "url"
|
10
|
-
- r.button :edit, "url"
|
11
|
-
- r.button :destroy, "url", :confirm => "Delete user?"
|
data/spec/lib/views/listing.haml
DELETED
data/spec/lib/views/row.haml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
.first
|
2
|
-
= aureus_row do
|
3
|
-
= aureus_box "a box title" do
|
4
|
-
%strong hello
|
5
|
-
|
6
|
-
.second
|
7
|
-
= aureus_row do
|
8
|
-
%strong only wrapper
|
9
|
-
|
10
|
-
.third
|
11
|
-
= aureus_row do |r|
|
12
|
-
- r.column 100 do
|
13
|
-
.one-column
|
14
|
-
|
15
|
-
.fourth
|
16
|
-
= aureus_row do |r|
|
17
|
-
- r.column 2 do
|
18
|
-
.first
|
19
|
-
- r.space 2
|
20
|
-
|
21
|
-
.fifth
|
22
|
-
= aureus_row do |r|
|
23
|
-
- r.column 25 do
|
24
|
-
.first
|
25
|
-
- r.column 25 do
|
26
|
-
.second
|
27
|
-
- r.column 50 do
|
28
|
-
.third
|
data/spec/lib/views/toolbar.haml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
.first
|
2
|
-
= aureus_toolbar "A nice title" do |t|
|
3
|
-
- t.left do |l|
|
4
|
-
- l.link_to "an anchor", "http://www.example.com"
|
5
|
-
- l.link_to "an anchor", "http://www.example.com"
|
6
|
-
- l.dropdown "a caption" do |d|
|
7
|
-
- d.link_to "an anchor", "http://www.example.com"
|
8
|
-
- d.link_to "an anchor", "http://www.example.com"
|
9
|
-
- t.right do |r|
|
10
|
-
- r.info "some info"
|
11
|
-
- r.link_to "an anchor", "http://www.example.com"
|