dust-generators 0.1.9 → 0.2.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.
- data/lib/dust/version.rb +2 -2
- data/rails_generators/dust_albums/dust_albums_generator.rb +98 -32
- data/rails_generators/dust_albums/templates/app/controllers/albums_controller.rb +20 -20
- data/rails_generators/dust_albums/templates/app/controllers/photos_controller.rb +32 -32
- data/rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb +6 -6
- data/rails_generators/dust_albums/templates/app/helpers/albums_helper.rb +1 -1
- data/rails_generators/dust_albums/templates/app/helpers/photos_helper.rb +1 -1
- data/rails_generators/dust_albums/templates/app/helpers/view_albums_helper.rb +1 -1
- data/rails_generators/dust_albums/templates/app/models/album.rb +4 -4
- data/rails_generators/dust_albums/templates/app/models/photo.rb +4 -4
- data/rails_generators/dust_albums/templates/app/views/albums/_form.html.erb +17 -17
- data/rails_generators/dust_albums/templates/app/views/albums/_search.html.erb +4 -4
- data/rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb +11 -11
- data/rails_generators/dust_albums/templates/app/views/albums/edit.html.erb +3 -3
- data/rails_generators/dust_albums/templates/app/views/albums/index.html.erb +23 -23
- data/rails_generators/dust_albums/templates/app/views/albums/manage.html.erb +16 -16
- data/rails_generators/dust_albums/templates/app/views/albums/new.html.erb +3 -3
- data/rails_generators/dust_albums/templates/app/views/albums/show.html.erb +21 -21
- data/rails_generators/dust_albums/templates/app/views/albums/show.js.erb +1 -1
- data/rails_generators/dust_albums/templates/app/views/photos/_form.html.erb +9 -9
- data/rails_generators/dust_albums/templates/app/views/photos/_photo.html.erb +8 -8
- data/rails_generators/dust_albums/templates/app/views/photos/_search.html.erb +4 -4
- data/rails_generators/dust_albums/templates/app/views/photos/array.js.erb +1 -1
- data/rails_generators/dust_albums/templates/app/views/photos/edit.html.erb +6 -6
- data/rails_generators/dust_albums/templates/app/views/photos/index.html.erb +24 -24
- data/rails_generators/dust_albums/templates/app/views/photos/new.html.erb +4 -4
- data/rails_generators/dust_albums/templates/app/views/photos/show.html.erb +9 -9
- data/rails_generators/dust_albums/templates/app/views/photos/show.js.erb +2 -2
- data/rails_generators/dust_albums/templates/app/views/view_albums/index.html.erb +16 -16
- data/rails_generators/dust_albums/templates/app/views/view_albums/show.html.erb +19 -19
- data/rails_generators/dust_albums/templates/javascript/dust_album.js +3 -3
- data/rails_generators/dust_albums/templates/migration/albums_migration.rb +9 -8
- data/rails_generators/dust_albums/templates/stylesheets/dust_album.css +6 -6
- data/rails_generators/dust_albums/templates/stylesheets/dust_album_app.css +4 -4
- data/rails_generators/dust_albums/templates/stylesheets/uploadify.css +1 -1
- metadata +5 -5
@@ -1,6 +1,6 @@
|
|
1
1
|
<div id="searchbox">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<%% form_tag <%=child_plural_name%>_path, :method => 'get' do %>
|
3
|
+
<%%= text_field_tag :search, params[:search], :class => "input-text", :placeholder => 'Search <%=child_plural_class_name%>' %>
|
4
|
+
<%%= image_submit_tag "admin/blank.png", :class => "image-submit"%>
|
5
|
+
<%% end %>
|
6
6
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
<%% title "Edit <%=child_class_name%>" %>
|
2
2
|
|
3
|
-
|
3
|
+
<%% if params[:edit] == '<%=child_singular_name%>' %>
|
4
4
|
<script type="text/javascript" charset="utf-8">
|
5
5
|
|
6
6
|
var options = {
|
@@ -9,9 +9,9 @@
|
|
9
9
|
clearForm: true
|
10
10
|
};
|
11
11
|
|
12
|
-
$('.
|
12
|
+
$('.edit_<%=child_singular_name%>').ajaxForm(options);
|
13
13
|
|
14
|
-
$("
|
14
|
+
$("#<%=child_singular_name%>_submit").click(function () {
|
15
15
|
$("#fancybox-inner").fadeTo("slow", 0.1);
|
16
16
|
$.fancybox.showActivity();
|
17
17
|
});
|
@@ -23,6 +23,6 @@
|
|
23
23
|
$("#fancybox-inner").fadeTo("slow", 1);
|
24
24
|
}
|
25
25
|
</script>
|
26
|
-
|
26
|
+
<%% end -%>
|
27
27
|
|
28
|
-
|
28
|
+
<%%= render :partial => 'form' %>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
<%% title "<%=child_plural_class_name%>" %>
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
4
|
+
<%%= javascript( 'uploadify/jquery.uploadify.v2.1.0' ) %>
|
5
5
|
|
6
6
|
<script type="text/javascript" charset="utf-8">
|
7
7
|
$(document).ready(function() {
|
@@ -14,19 +14,19 @@
|
|
14
14
|
</script>
|
15
15
|
|
16
16
|
<div class="button_bar">
|
17
|
-
|
17
|
+
<%%= render :partial => 'search' %>
|
18
18
|
</div>
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
<%%= will_paginate @<%=child_plural_name%> %>
|
22
22
|
|
23
|
-
|
24
|
-
<div class='
|
25
|
-
<h1
|
23
|
+
<%% @<%=child_singular_name%>_<%=parent_plural_name%>.sort.each do |title, <%=child_plural_name%>| %>
|
24
|
+
<div class='<%=child_singular_name%>list'>
|
25
|
+
<h1><%%= link_to title, <%=parent_singular_name%>_path(<%=child_plural_name%>.first.<%=parent_singular_name%>) %></h1>
|
26
26
|
|
27
|
-
|
27
|
+
<%% form_for :<%=child_singular_name%>, :url => {:action => 'destroy'} do %>
|
28
28
|
|
29
|
-
<table class='
|
29
|
+
<table class='<%=child_plural_name%>'>
|
30
30
|
<tr style='color:#222;'>
|
31
31
|
<th>
|
32
32
|
|
@@ -42,44 +42,44 @@
|
|
42
42
|
Created At
|
43
43
|
</th>
|
44
44
|
</tr>
|
45
|
-
|
46
|
-
|
47
|
-
<tr class='
|
45
|
+
<%% for <%=child_singular_name%> in <%=child_plural_name%> %>
|
46
|
+
<%%= hidden_field_tag :<%=parent_singular_name%>_id, <%=child_singular_name%>.<%=parent_singular_name%>.id %>
|
47
|
+
<tr class='<%%= cycle('odd', 'even')%>'>
|
48
48
|
<td>
|
49
|
-
|
49
|
+
<%%= check_box_tag "<%=child_singular_name%>_ids[]", <%=child_singular_name%>.id %>
|
50
50
|
</td>
|
51
51
|
<td>
|
52
|
-
|
52
|
+
<%%= link_to image_tag(<%=child_singular_name%>.file.url(:thumb), :height => "30"), <%=child_singular_name%>.file.url(:original), :rel => title, :id => 'single_image' %>
|
53
53
|
|
54
|
-
<div style="display:none"><div id="
|
54
|
+
<div style="display:none"><div id="<%%=<%=child_singular_name%>.id%>"><%%= image_tag(<%=child_singular_name%>.file.url(:original)) %></div></div>
|
55
55
|
</td>
|
56
56
|
<td>
|
57
|
-
<%=
|
57
|
+
<%%= <%=child_singular_name%>.file_file_name %>
|
58
58
|
</td>
|
59
59
|
<td>
|
60
|
-
|
60
|
+
<%%= number_to_human_size(<%=child_singular_name%>.file_file_size) %>
|
61
61
|
</td>
|
62
62
|
<td>
|
63
|
-
<%=
|
63
|
+
<%%= <%=child_singular_name%>.created_at.to_s(:m_d_y) %>
|
64
64
|
</td>
|
65
65
|
</tr>
|
66
|
-
|
66
|
+
<%% end %>
|
67
67
|
<tr class='odd'>
|
68
68
|
<td colspan='5'>
|
69
69
|
<input type="checkbox" class="checkall"> Check all
|
70
|
-
|
70
|
+
<%%= submit_tag "Delete checked" %>
|
71
71
|
</td>
|
72
72
|
</tr>
|
73
73
|
</table>
|
74
74
|
|
75
75
|
|
76
|
-
|
76
|
+
<%% end -%>
|
77
77
|
|
78
78
|
</div>
|
79
79
|
|
80
80
|
|
81
81
|
|
82
|
-
|
82
|
+
<%% end %>
|
83
83
|
|
84
|
-
|
84
|
+
<%%= will_paginate @<%=child_plural_name%> %>
|
85
85
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
<%% title "New <%=child_class_name%>" %>
|
2
2
|
|
3
|
-
|
3
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
4
4
|
|
5
|
-
|
5
|
+
<%%= render :partial => 'form' %>
|
6
6
|
|
7
|
-
<p
|
7
|
+
<p><%%= link_to "Back to List", <%=child_plural_name%>_path %></p>
|
@@ -1,26 +1,26 @@
|
|
1
|
-
|
1
|
+
<%% title "<%=child_class_name%>" %>
|
2
2
|
|
3
|
-
|
3
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
4
4
|
|
5
5
|
<p>
|
6
6
|
<strong>Title:</strong>
|
7
|
-
|
7
|
+
<%%=h @<%=child_singular_name%>.title %>
|
8
8
|
</p>
|
9
9
|
<p>
|
10
10
|
<strong>Desc:</strong>
|
11
|
-
|
11
|
+
<%%=h @<%=child_singular_name%>.desc %>
|
12
12
|
</p>
|
13
13
|
<p>
|
14
14
|
<strong>Date Shot:</strong>
|
15
|
-
|
15
|
+
<%%=h @<%=child_singular_name%>.date_shot %>
|
16
16
|
</p>
|
17
17
|
<p>
|
18
18
|
<strong>Location:</strong>
|
19
|
-
|
19
|
+
<%%=h @<%=child_singular_name%>.location %>
|
20
20
|
</p>
|
21
21
|
|
22
22
|
<p>
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
<%%= link_to "Edit", edit_<%=child_singular_name%>_path(@<%=child_singular_name%>) %> |
|
24
|
+
<%%= link_to "Destroy", @<%=child_singular_name%>, :confirm => 'Are you sure?', :method => :delete %> |
|
25
|
+
<%%= link_to "View All", <%=child_plural_name%>_path %>
|
26
26
|
</p>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
$('
|
2
|
-
$('#uploads').append("
|
1
|
+
$('#<%=child_plural_name%>_count').html('<%%= pluralize(@<%=parent_singular_name%>.<%=child_plural_name%>.size, "<%=child_class_name%>")%> | <%%= link_to "Select <%=child_plural_class_name%> For Deletion", manage_<%=child_plural_name%>_path(@<%=parent_singular_name%>), :class => 'settings' %> ');
|
2
|
+
$('#uploads').append("<%%= escape_javascript(render(:partial => "<%=child_plural_name%>/<%=child_singular_name%>", :locals => {:<%=child_singular_name%> => @<%=child_singular_name%>})) %>");
|
3
3
|
$("a#inline").fancybox({
|
4
4
|
'transitionIn' : 'elastic',
|
5
5
|
'transitionOut' : 'elastic',
|
@@ -1,27 +1,27 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<%% title "All <%=parent_plural_class_name%>" %>
|
2
|
+
<%% heading "Dresen Landscaping Project Gallery" %>
|
3
3
|
|
4
|
-
|
4
|
+
<%%= will_paginate @<%=parent_plural_name%> %>
|
5
5
|
|
6
|
-
|
7
|
-
<div class="
|
8
|
-
|
6
|
+
<%% @<%=parent_plural_name%>.each do |<%=parent_singular_name%>| %>
|
7
|
+
<div class="<%=parent_singular_name%>_thumb">
|
8
|
+
<%% unless <%=parent_singular_name%>.<%=child_plural_name%>.empty? %>
|
9
9
|
|
10
|
-
|
10
|
+
<%% @<%=child_singular_name%> = <%=parent_singular_name%>.<%=child_plural_name%>.find(:first) %>
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
<%% link_to view_<%=parent_singular_name%>_path(<%=parent_singular_name%>.filename), :style => 'float:left; ' do %>
|
13
|
+
<%%= image_tag @<%=child_singular_name%>.file.url(:thumb), :alt => <%=parent_singular_name%>.heading %>
|
14
|
+
<%% end %>
|
15
15
|
|
16
16
|
<p>
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
<%%= link_to <%=parent_singular_name%>.title, view_<%=parent_singular_name%>_path(<%=parent_singular_name%>.filename) %><br />
|
18
|
+
<%%= truncate(<%=parent_singular_name%>.desc, :length => 100) %>
|
19
|
+
<%%= link_to "Read More", view_<%=parent_singular_name%>_path(<%=parent_singular_name%>.filename) unless <%=parent_singular_name%>.desc.blank? %>
|
20
20
|
</p>
|
21
21
|
|
22
|
-
|
22
|
+
<%% end -%>
|
23
23
|
</div>
|
24
|
-
|
24
|
+
<%% end -%>
|
25
25
|
<div class="clear"></div>
|
26
26
|
|
27
|
-
|
27
|
+
<%%= will_paginate @<%=parent_plural_name%> %>
|
@@ -1,31 +1,31 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<%% title @<%=parent_singular_name%>.title %>
|
2
|
+
<%% heading @<%=parent_singular_name%>.heading %>
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
<%% content_for :head do %>
|
5
|
+
<%%= stylesheet_link_tag 'dust_<%=parent_singular_name%>_app' %>
|
6
|
+
<%% end -%>
|
7
7
|
|
8
|
-
|
8
|
+
<%%= @<%=parent_singular_name%>.desc %>
|
9
9
|
|
10
|
-
|
10
|
+
<%%= will_paginate @<%=child_plural_name%> %>
|
11
11
|
|
12
12
|
<div id="uploads">
|
13
|
-
|
14
|
-
<div class="
|
15
|
-
|
16
|
-
|
13
|
+
<%% @<%=child_plural_name%>.each do |<%=child_singular_name%>| %>
|
14
|
+
<div class="<%=child_singular_name%>">
|
15
|
+
<%%= link_to image_tag(<%=child_singular_name%>.file.url(:thumb), :alt => <%=child_singular_name%>.desc), <%=child_singular_name%>.file.url(:large), :class => 'group', :rel => "#{@<%=parent_singular_name%>.title}" %><br />
|
16
|
+
<%%= truncate <%=child_singular_name%>.title, :length => 23 %>
|
17
17
|
</div>
|
18
|
-
|
18
|
+
<%% end -%>
|
19
19
|
</div>
|
20
20
|
<div class="clear"></div>
|
21
21
|
|
22
|
-
|
22
|
+
<%%= will_paginate @<%=child_plural_name%> %>
|
23
23
|
|
24
|
-
|
24
|
+
<%% if permitted_to? :manage, :<%=parent_plural_name%> %>
|
25
25
|
<p>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
<%%= link_to "Manage <%=child_plural_class_name%>", @<%=parent_singular_name%> %> |
|
27
|
+
<%%= link_to "Edit", edit_<%=parent_singular_name%>_path(@<%=parent_singular_name%>) %> |
|
28
|
+
<%%= link_to "Destroy", @<%=parent_singular_name%>, :confirm => 'Are you sure?', :method => :delete %> |
|
29
|
+
<%%= link_to "View All", <%=parent_plural_name%>_path %>
|
30
30
|
</p>
|
31
|
-
|
31
|
+
<%% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
$(document).ready(function(){
|
2
2
|
|
3
|
-
//
|
3
|
+
// <%=child_singular_name%> management /////////////////////////////////////////////////////////////////////////////////////////////
|
4
4
|
$("#uploads").dragsort({
|
5
5
|
dragSelector: "div",
|
6
6
|
dragEnd: notice,
|
@@ -18,9 +18,9 @@ $(document).ready(function(){
|
|
18
18
|
});
|
19
19
|
});
|
20
20
|
|
21
|
-
$(
|
21
|
+
$("#order_<%=child_plural_name%>").click(function(){
|
22
22
|
mylist = $('#uploads').serializelist();
|
23
|
-
$.post("
|
23
|
+
$.post("/<%=child_plural_name%>/array", mylist);
|
24
24
|
$.fancybox.showActivity();
|
25
25
|
return false;
|
26
26
|
});
|
@@ -1,24 +1,25 @@
|
|
1
|
-
class
|
1
|
+
class Create<%=parent_plural_class_name%> < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
create_table
|
3
|
+
create_table :<%=parent_plural_name%> do |t|
|
4
4
|
t.string :title
|
5
5
|
t.string :filename
|
6
6
|
t.text :desc
|
7
7
|
t.boolean :active
|
8
8
|
t.string :heading
|
9
9
|
t.string :nav
|
10
|
+
t.integer :position
|
10
11
|
t.timestamps
|
11
12
|
end
|
12
13
|
|
13
|
-
AdminMenuItem.create({:title =>"
|
14
|
-
MenuItem.create({:title => "All
|
14
|
+
AdminMenuItem.create({:title =>"<%=parent_plural_class_name%>", :controller_name => "<%=parent_plural_name%>", :url => "/<%=parent_plural_name%>"})
|
15
|
+
MenuItem.create({:title => "All <%=parent_plural_class_name%>", :url => "/all/<%=parent_plural_name%>", :active => true})
|
15
16
|
|
16
|
-
create_table
|
17
|
+
create_table :<%=child_plural_name%> do |t|
|
17
18
|
t.string :title
|
18
19
|
t.text :desc
|
19
20
|
t.date :date_shot
|
20
21
|
t.string :location
|
21
|
-
t.integer
|
22
|
+
t.integer :<%=parent_singular_name%>_id
|
22
23
|
t.string :file_file_name
|
23
24
|
t.string :file_content_type
|
24
25
|
t.integer :file_file_size
|
@@ -32,7 +33,7 @@ class CreateAlbums < ActiveRecord::Migration
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def self.down
|
35
|
-
drop_table
|
36
|
-
drop_table
|
36
|
+
drop_table :<%=parent_plural_name%>
|
37
|
+
drop_table :<%=child_plural_name%>
|
37
38
|
end
|
38
39
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
#uploadify h3 { display:block; text-align:center; color:#767D87; font-weight: normal; }
|
2
2
|
|
3
3
|
#uploads{overflow:hidden;}
|
4
|
-
|
4
|
+
.<%=child_singular_name%> { text-align:center; float:left; width:100px; height:150px; margin: 5px; }
|
5
5
|
|
6
6
|
tr.even td { background: #fff;}
|
7
7
|
|
8
|
-
table
|
9
|
-
table
|
10
|
-
table
|
11
|
-
table
|
8
|
+
table.<%=child_plural_name%>{ margin: 0 auto; width:100%; border:1px solid #C5CCD6; }
|
9
|
+
table.<%=child_plural_name%> tr th { background: #D3DAE6; padding:5px; }
|
10
|
+
table.<%=child_plural_name%> tr.even td { background: #D3DAE6; padding:15px;}
|
11
|
+
table.<%=child_plural_name%> tr.odd td { padding:15px;}
|
12
12
|
|
13
13
|
#uploads li{ float:left; padding:5px; width:100px; height:125px; }
|
14
|
-
|
14
|
+
.<%=child_singular_name%>{ width:90px; height:125px; padding:5px; text-align:center; }
|
15
15
|
|
16
16
|
.placeHolder div { background-color:transparent !important; border:dashed 1px gray !important; width:100px; height: 125px; }
|
@@ -5,11 +5,11 @@
|
|
5
5
|
tr.even td { background: #fff;}
|
6
6
|
|
7
7
|
#uploads{overflow:hidden; width: 845px; margin:0 auto}
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
.<%=child_singular_name%> { text-align:center; float:left; width:130px; height: 175px; margin: 5px; }
|
9
|
+
.<%=parent_singular_name%>_thumb{ width: 288px; height:125px; margin:10px; float:left }
|
10
|
+
.<%=parent_singular_name%>_thumb a{ text-align:left; }
|
11
11
|
|
12
|
-
table
|
12
|
+
table.<%=child_plural_name%>{ margin: 0 auto; width:100%; border:1px solid #C5CCD6; }
|
13
13
|
tr th { background: #D3DAE6; padding:5px; }
|
14
14
|
tr.even td { background: #D3DAE6; padding:15px;}
|
15
15
|
tr.odd td { padding:15px;}
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- rossnelson
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-04-
|
17
|
+
date: 2011-04-22 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -302,7 +302,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
302
302
|
requirements:
|
303
303
|
- - ">="
|
304
304
|
- !ruby/object:Gem::Version
|
305
|
-
hash:
|
305
|
+
hash: 1672646635295594340
|
306
306
|
segments:
|
307
307
|
- 0
|
308
308
|
version: "0"
|