caseadilla 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.svg +228 -228
- data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/images/caseadilla/caseadilla.png +0 -0
- data/app/assets/javascripts/caseadilla/bootstrap.js +2114 -2114
- data/app/assets/javascripts/caseadilla/bootstrap3-wysihtml5.js +520 -520
- data/app/assets/javascripts/caseadilla/caseadilla.js +50 -50
- data/app/assets/javascripts/caseadilla/html5shiv.js +8 -8
- data/app/assets/javascripts/caseadilla/wysihtml5-0.3.0.min.js +260 -260
- data/app/assets/stylesheets/caseadilla/bootstrap-glyphicons.css.scss +2 -2
- data/app/assets/stylesheets/caseadilla/bootstrap-theme.css +442 -442
- data/app/assets/stylesheets/caseadilla/bootstrap-wysihtml5.css +101 -101
- data/app/assets/stylesheets/caseadilla/bootstrap.css +6203 -6203
- data/app/assets/stylesheets/caseadilla/caseadilla-bootstrap-overrides.css.scss +79 -79
- data/app/assets/stylesheets/caseadilla/caseadilla.scss +269 -269
- data/app/assets/stylesheets/caseadilla/login.css.scss +80 -80
- data/app/controllers/caseadilla/caseadilla_controller.rb +56 -56
- data/app/controllers/caseadilla/caseadilla_user_sessions_controller.rb +35 -35
- data/app/controllers/caseadilla/password_resets_controller.rb +63 -63
- data/app/controllers/caseadilla/roles_controller.rb +64 -64
- data/app/controllers/caseadilla/users_controller.rb +117 -117
- data/app/helpers/caseadilla/caseadilla_helper.rb +261 -261
- data/app/mailers/caseadilla/caseadilla_notification.rb +38 -38
- data/app/views/caseadilla/caseadilla/blank.html.erb +11 -11
- data/app/views/caseadilla/caseadilla_notification/generate_new_password.erb +11 -11
- data/app/views/caseadilla/caseadilla_notification/new_user_information.erb +11 -11
- data/app/views/caseadilla/caseadilla_notification/password_reset_instructions.erb +10 -10
- data/app/views/caseadilla/caseadilla_user_sessions/new.html.erb +38 -38
- data/app/views/caseadilla/roles/_form.html.erb +11 -11
- data/app/views/caseadilla/roles/_table.html.erb +27 -27
- data/app/views/caseadilla/roles/index.html.erb +14 -14
- data/app/views/caseadilla/roles/new.html.erb +17 -17
- data/app/views/caseadilla/roles/show.html.erb +17 -17
- data/app/views/caseadilla/users/index.html.erb +36 -36
- data/app/views/caseadilla/users/new.html.erb +49 -49
- data/app/views/caseadilla/users/show.html.erb +38 -38
- data/app/views/layouts/caseadilla_auth.html.erb +36 -36
- data/app/views/layouts/caseadilla_main.html.erb +110 -118
- data/caseadilla.gemspec +48 -48
- data/config/initializers/will_paginate.rb +39 -39
- data/config/routes.rb +22 -22
- data/lib/caseadilla.rb +13 -13
- data/lib/caseadilla/engine.rb +34 -34
- data/lib/caseadilla/version.rb +1 -1
- data/lib/generators/caseadilla/install/install_generator.rb +153 -153
- data/lib/generators/caseadilla/install/templates/app/assets/javascripts/caseadilla/custom.js +1 -1
- data/lib/generators/caseadilla/install/templates/app/assets/stylesheets/caseadilla/custom.css.scss +2 -2
- data/lib/generators/caseadilla/install/templates/app/helpers/caseadilla/config_helper.rb +44 -44
- data/lib/generators/caseadilla/install/templates/app/models/user.rb +23 -23
- data/lib/generators/caseadilla/install/templates/app/views/caseadilla/layouts/_tab_navigation.html.erb +1 -1
- data/lib/generators/caseadilla/install/templates/app/views/caseadilla/layouts/_top_navigation.html.erb +3 -3
- data/lib/generators/caseadilla/install/templates/public/robots.txt +4 -4
- data/lib/generators/caseadilla/install/templates/steak/config/initializers/caseadilla.rb +7 -7
- data/lib/generators/caseadilla/install/templates/steak/db/migrate/add_name_to_users.rb +8 -8
- data/lib/generators/caseadilla/install/templates/veggie/config/initializers/caseadilla.rb +7 -7
- data/lib/generators/caseadilla/scaffold/scaffold_generator.rb +110 -110
- data/lib/generators/caseadilla/scaffold/templates/controller.rb +71 -71
- data/lib/generators/caseadilla/scaffold/templates/migration.rb +12 -12
- data/lib/generators/caseadilla/scaffold/templates/model.rb +2 -2
- data/lib/generators/caseadilla/scaffold/templates/views/_form.html.erb +11 -11
- data/lib/generators/caseadilla/scaffold/templates/views/_table.html.erb +18 -18
- data/lib/generators/caseadilla/scaffold/templates/views/index.html.erb +14 -14
- data/lib/generators/caseadilla/scaffold/templates/views/new.html.erb +17 -17
- data/lib/generators/caseadilla/scaffold/templates/views/show.html.erb +17 -17
- data/lib/railties/tasks.rake +31 -31
- metadata +2 -2
@@ -1,13 +1,13 @@
|
|
1
|
-
class Create<%= class_name.pluralize %> < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :<%= table_name %> do |t|
|
4
|
-
<% attributes.each do |attribute| %>t.<%= attribute.type %> :<%= attribute.name %>
|
5
|
-
<% end %>
|
6
|
-
t.timestamps
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.down
|
11
|
-
drop_table :<%= table_name %>
|
12
|
-
end
|
1
|
+
class Create<%= class_name.pluralize %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
<% attributes.each do |attribute| %>t.<%= attribute.type %> :<%= attribute.name %>
|
5
|
+
<% end %>
|
6
|
+
t.timestamps
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
drop_table :<%= table_name %>
|
12
|
+
end
|
13
13
|
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
class <%= class_name %> < ActiveRecord::Base
|
2
|
-
|
1
|
+
class <%= class_name %> < ActiveRecord::Base
|
2
|
+
|
3
3
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
-
<% attribute_itr = 0 %>
|
3
|
-
<% while attribute_itr < attributes.count %>
|
4
|
-
<div class="row">
|
5
|
-
<div class="col-lg-6">
|
6
|
-
<%%= caseadilla_<%= field_type(attributes[attribute_itr].type).to_s %> f, f.object, :<%= attributes[attribute_itr].name %><%= ", {:readonly => true}" if @read_only %> %>
|
7
|
-
</div><% attribute_itr += 1 %>
|
8
|
-
<div class="col-lg-6">
|
9
|
-
<% if attribute_itr < attributes.count %><%%= caseadilla_<%= field_type(attributes[attribute_itr].type).to_s %> f, f.object, :<%= attributes[attribute_itr].name %><%= ", {:readonly => true}" if @read_only %> %><% end %>
|
10
|
-
</div><% attribute_itr += 1 %>
|
11
|
-
</div>
|
1
|
+
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
+
<% attribute_itr = 0 %>
|
3
|
+
<% while attribute_itr < attributes.count %>
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-lg-6">
|
6
|
+
<%%= caseadilla_<%= field_type(attributes[attribute_itr].type).to_s %> f, f.object, :<%= attributes[attribute_itr].name %><%= ", {:readonly => true}" if @read_only %> %>
|
7
|
+
</div><% attribute_itr += 1 %>
|
8
|
+
<div class="col-lg-6">
|
9
|
+
<% if attribute_itr < attributes.count %><%%= caseadilla_<%= field_type(attributes[attribute_itr].type).to_s %> f, f.object, :<%= attributes[attribute_itr].name %><%= ", {:readonly => true}" if @read_only %> %><% end %>
|
10
|
+
</div><% attribute_itr += 1 %>
|
11
|
+
</div>
|
12
12
|
<% end %>
|
@@ -1,19 +1,19 @@
|
|
1
|
-
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
-
|
3
|
-
<table class="table table-striped table-hover table-condensed">
|
4
|
-
<thead>
|
5
|
-
<tr>
|
6
|
-
<% for attribute in attributes %><th><%%= caseadilla_sort_link "<%= attribute.name.humanize %>", :<%= attribute.name %> %></th>
|
7
|
-
<% end %><% unless @read_only %><th> </th><% end %>
|
8
|
-
</tr>
|
9
|
-
</thead>
|
10
|
-
|
11
|
-
<%% <%= plural_name %>.each do |<%= singular_name %>| %>
|
12
|
-
<tr>
|
13
|
-
<% attributes.each do |attribute| %><td><%%= caseadilla_table_cell_link <%= singular_name %>.<%= attribute.name %>, caseadilla_<%= singular_name %>_path(<%= singular_name %>) %></td>
|
14
|
-
<% end %><% unless @read_only %><td class="delete">
|
15
|
-
<%%= link_to(caseadilla_show_row_icon("trash"), caseadilla_<%= singular_name %>_path(<%= singular_name %>), :method => :delete, :data => { :confirm => "Are you sure you want to delete this <%= singular_name.humanize.downcase %>?" }) %>
|
16
|
-
</td><% end %>
|
17
|
-
</tr>
|
18
|
-
<%% end %>
|
1
|
+
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
+
|
3
|
+
<table class="table table-striped table-hover table-condensed">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<% for attribute in attributes %><th><%%= caseadilla_sort_link "<%= attribute.name.humanize %>", :<%= attribute.name %> %></th>
|
7
|
+
<% end %><% unless @read_only %><th> </th><% end %>
|
8
|
+
</tr>
|
9
|
+
</thead>
|
10
|
+
|
11
|
+
<%% <%= plural_name %>.each do |<%= singular_name %>| %>
|
12
|
+
<tr>
|
13
|
+
<% attributes.each do |attribute| %><td><%%= caseadilla_table_cell_link <%= singular_name %>.<%= attribute.name %>, caseadilla_<%= singular_name %>_path(<%= singular_name %>) %></td>
|
14
|
+
<% end %><% unless @read_only %><td class="delete">
|
15
|
+
<%%= link_to(caseadilla_show_row_icon("trash"), caseadilla_<%= singular_name %>_path(<%= singular_name %>), :method => :delete, :data => { :confirm => "Are you sure you want to delete this <%= singular_name.humanize.downcase %>?" }) %>
|
16
|
+
</td><% end %>
|
17
|
+
</tr>
|
18
|
+
<%% end %>
|
19
19
|
</table>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
-
|
3
|
-
<h2><%= plural_name.humanize.capitalize %><%%= caseadilla_pagination_details @<%= plural_name %> %></h2>
|
4
|
-
|
5
|
-
<%%= render :partial => 'caseadilla/<%= plural_name %>/table', :locals => { :<%= plural_name %> => @<%= plural_name %> } %>
|
6
|
-
|
7
|
-
<div class="text-center">
|
8
|
-
<%%= will_paginate @<%= plural_name %> %>
|
9
|
-
</div>
|
10
|
-
|
11
|
-
<%%= content_for :sidebar do %>
|
12
|
-
<% unless @read_only %>
|
13
|
-
<li><%%= link_to "#{caseadilla_show_icon "plus-sign"}Add a new <%= singular_name.humanize.downcase %>".html_safe, new_caseadilla_<%= singular_name %>_path %></li>
|
14
|
-
<% end %>
|
1
|
+
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
+
|
3
|
+
<h2><%= plural_name.humanize.capitalize %><%%= caseadilla_pagination_details @<%= plural_name %> %></h2>
|
4
|
+
|
5
|
+
<%%= render :partial => 'caseadilla/<%= plural_name %>/table', :locals => { :<%= plural_name %> => @<%= plural_name %> } %>
|
6
|
+
|
7
|
+
<div class="text-center">
|
8
|
+
<%%= will_paginate @<%= plural_name %> %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%%= content_for :sidebar do %>
|
12
|
+
<% unless @read_only %>
|
13
|
+
<li><%%= link_to "#{caseadilla_show_icon "plus-sign"}Add a new <%= singular_name.humanize.downcase %>".html_safe, new_caseadilla_<%= singular_name %>_path %></li>
|
14
|
+
<% end %>
|
15
15
|
<%% end %>
|
@@ -1,18 +1,18 @@
|
|
1
|
-
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
-
|
3
|
-
<h2>Add a new <%= singular_name.humanize.downcase %></h2>
|
4
|
-
|
5
|
-
<%%= form_for @<%= file_name %>, :url => caseadilla_<%= @plural_route %>_path do |f| %>
|
6
|
-
|
7
|
-
<%%= render :partial => 'caseadilla/<%= plural_name %>/form', :locals => { :f => f } %>
|
8
|
-
|
9
|
-
<p class="submits">
|
10
|
-
<%%= link_to 'Cancel', caseadilla_<%= @plural_route %>_path, :class => 'btn btn-mini btn-danger' %>
|
11
|
-
<%%= f.submit "Add new <%= singular_name.humanize.downcase %>", :class => "btn btn-mini btn-primary" %>
|
12
|
-
</p>
|
13
|
-
|
14
|
-
<%% end %>
|
15
|
-
|
16
|
-
<%%= content_for :sidebar do %>
|
17
|
-
<li><%%= link_to "#{caseadilla_show_icon "th-list"}Back to list".html_safe, caseadilla_<%= @plural_route %>_path %></li>
|
1
|
+
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
+
|
3
|
+
<h2>Add a new <%= singular_name.humanize.downcase %></h2>
|
4
|
+
|
5
|
+
<%%= form_for @<%= file_name %>, :url => caseadilla_<%= @plural_route %>_path do |f| %>
|
6
|
+
|
7
|
+
<%%= render :partial => 'caseadilla/<%= plural_name %>/form', :locals => { :f => f } %>
|
8
|
+
|
9
|
+
<p class="submits">
|
10
|
+
<%%= link_to 'Cancel', caseadilla_<%= @plural_route %>_path, :class => 'btn btn-mini btn-danger' %>
|
11
|
+
<%%= f.submit "Add new <%= singular_name.humanize.downcase %>", :class => "btn btn-mini btn-primary" %>
|
12
|
+
</p>
|
13
|
+
|
14
|
+
<%% end %>
|
15
|
+
|
16
|
+
<%%= content_for :sidebar do %>
|
17
|
+
<li><%%= link_to "#{caseadilla_show_icon "th-list"}Back to list".html_safe, caseadilla_<%= @plural_route %>_path %></li>
|
18
18
|
<%% end %>
|
@@ -1,18 +1,18 @@
|
|
1
|
-
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
-
|
3
|
-
<h2>View <%= singular_name.humanize.downcase %></h2>
|
4
|
-
|
5
|
-
<%%= form_for @<%= file_name %>, :url => caseadilla_<%= singular_name %>_path(@<%= singular_name %>) do |f| %>
|
6
|
-
|
7
|
-
<%%= render :partial => 'caseadilla/<%= plural_name %>/form', :locals => { :f => f } %>
|
8
|
-
<% unless @read_only %>
|
9
|
-
<p class="submits">
|
10
|
-
<%%= link_to 'Cancel', caseadilla_<%= @plural_route %>_path, :class => 'btn btn-mini btn-danger' %>
|
11
|
-
<%%= f.submit "Save changes", :class => "btn btn-mini btn-primary" %>
|
12
|
-
</p>
|
13
|
-
<% end %>
|
14
|
-
<%% end %>
|
15
|
-
|
16
|
-
<%%= content_for :sidebar do %>
|
17
|
-
<li><%%= link_to "#{caseadilla_show_icon "th-list"}Back to list".html_safe, caseadilla_<%= @plural_route %>_path %></li>
|
1
|
+
<!-- Scaffolding generated by Caseadilla <%= caseadilla_get_full_version_string %> -->
|
2
|
+
|
3
|
+
<h2>View <%= singular_name.humanize.downcase %></h2>
|
4
|
+
|
5
|
+
<%%= form_for @<%= file_name %>, :url => caseadilla_<%= singular_name %>_path(@<%= singular_name %>) do |f| %>
|
6
|
+
|
7
|
+
<%%= render :partial => 'caseadilla/<%= plural_name %>/form', :locals => { :f => f } %>
|
8
|
+
<% unless @read_only %>
|
9
|
+
<p class="submits">
|
10
|
+
<%%= link_to 'Cancel', caseadilla_<%= @plural_route %>_path, :class => 'btn btn-mini btn-danger' %>
|
11
|
+
<%%= f.submit "Save changes", :class => "btn btn-mini btn-primary" %>
|
12
|
+
</p>
|
13
|
+
<% end %>
|
14
|
+
<%% end %>
|
15
|
+
|
16
|
+
<%%= content_for :sidebar do %>
|
17
|
+
<li><%%= link_to "#{caseadilla_show_icon "th-list"}Back to list".html_safe, caseadilla_<%= @plural_route %>_path %></li>
|
18
18
|
<%% end %>
|
data/lib/railties/tasks.rake
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
require 'securerandom'
|
2
|
-
|
3
|
-
namespace :caseadilla do
|
4
|
-
|
5
|
-
namespace :users do
|
6
|
-
|
7
|
-
desc "Create default admin user"
|
8
|
-
task create_admin: :environment do
|
9
|
-
|
10
|
-
raise "Usage: specify email address, e.g. rake [task] email=mail@caseadillacms.com" unless ENV.include?("email")
|
11
|
-
|
12
|
-
random_password = random_string = SecureRandom.hex
|
13
|
-
admin = Caseadilla::AdminUser.new({ login: 'admin', name: 'Admin', email: ENV['email'], access_level: $CASEIN_USER_ACCESS_LEVEL_ADMIN, password: random_password, password_confirmation: random_password })
|
14
|
-
|
15
|
-
unless admin.save
|
16
|
-
puts "[Caseadilla] Failed: check that the 'admin' account doesn't already exist."
|
17
|
-
else
|
18
|
-
puts "[Caseadilla] Created new admin user with username 'admin' and password '#{random_password}'"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
desc "Remove all users"
|
23
|
-
task remove_all: :environment do
|
24
|
-
users = Caseadilla::AdminUser.all
|
25
|
-
num_users = users.size
|
26
|
-
users.destroy_all
|
27
|
-
puts "[Caseadilla] Removed #{num_users} user(s)"
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
|
1
|
+
require 'securerandom'
|
2
|
+
|
3
|
+
namespace :caseadilla do
|
4
|
+
|
5
|
+
namespace :users do
|
6
|
+
|
7
|
+
desc "Create default admin user"
|
8
|
+
task create_admin: :environment do
|
9
|
+
|
10
|
+
raise "Usage: specify email address, e.g. rake [task] email=mail@caseadillacms.com" unless ENV.include?("email")
|
11
|
+
|
12
|
+
random_password = random_string = SecureRandom.hex
|
13
|
+
admin = Caseadilla::AdminUser.new({ login: 'admin', name: 'Admin', email: ENV['email'], access_level: $CASEIN_USER_ACCESS_LEVEL_ADMIN, password: random_password, password_confirmation: random_password })
|
14
|
+
|
15
|
+
unless admin.save
|
16
|
+
puts "[Caseadilla] Failed: check that the 'admin' account doesn't already exist."
|
17
|
+
else
|
18
|
+
puts "[Caseadilla] Created new admin user with username 'admin' and password '#{random_password}'"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Remove all users"
|
23
|
+
task remove_all: :environment do
|
24
|
+
users = Caseadilla::AdminUser.all
|
25
|
+
num_users = users.size
|
26
|
+
users.destroy_all
|
27
|
+
puts "[Caseadilla] Removed #{num_users} user(s)"
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caseadilla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xavier Bick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|