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,52 +1,52 @@
|
|
1
|
-
|
1
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
<%% form_for @<%=parent_singular_name%>, :validations => true do |f| %>
|
4
|
+
<%%= f.error_messages %>
|
5
5
|
|
6
6
|
<div class="item">
|
7
7
|
<p>
|
8
|
-
|
9
|
-
|
8
|
+
<%%= f.label :active %>
|
9
|
+
<%%= f.check_box :active %>
|
10
10
|
</p>
|
11
11
|
</div>
|
12
12
|
|
13
13
|
<div class="item">
|
14
14
|
<p>
|
15
|
-
|
16
|
-
|
15
|
+
<%%= f.label :nav, "Navigation Link" %><br />
|
16
|
+
<%%= f.text_field :nav, :class => 'field' %>
|
17
17
|
</p>
|
18
18
|
</div>
|
19
19
|
|
20
20
|
<div class="item">
|
21
21
|
<p>
|
22
|
-
|
23
|
-
|
22
|
+
<%%= f.label :title %><br />
|
23
|
+
<%%= f.text_field :title, :class => 'field' %>
|
24
24
|
</p>
|
25
25
|
</div>
|
26
26
|
|
27
27
|
<div class="item">
|
28
28
|
<p>
|
29
|
-
|
30
|
-
|
29
|
+
<%%= f.label :heading %><br />
|
30
|
+
<%%= f.text_field :heading, :class => 'field' %>
|
31
31
|
</p>
|
32
32
|
</div>
|
33
33
|
|
34
34
|
<div class="item">
|
35
35
|
<p>
|
36
|
-
|
37
|
-
|
36
|
+
<%%= f.label :filename %><br />
|
37
|
+
<%%= f.text_field :filename, :class => 'field' %>
|
38
38
|
</p>
|
39
39
|
</div>
|
40
40
|
|
41
41
|
<div class="item">
|
42
42
|
<p>
|
43
|
-
|
44
|
-
|
43
|
+
<%%= f.label :desc %><br />
|
44
|
+
<%%= f.text_area :desc, :class => 'field' %>
|
45
45
|
</p>
|
46
46
|
</div>
|
47
47
|
|
48
48
|
<div class="item">
|
49
|
-
<p
|
49
|
+
<p><%%= f.submit %></p>
|
50
50
|
</div>
|
51
51
|
|
52
|
-
|
52
|
+
<%% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div id="searchbox">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<%% form_tag <%=parent_plural_name%>_path, :method => 'get' do %>
|
3
|
+
<%%= text_field_tag :search, params[:search], :class => "input-text", :placeholder => 'Search <%=parent_plural_class_name%>' %>
|
4
|
+
<%%= image_submit_tag "admin/blank.png", :class => "image-submit"%>
|
5
|
+
<%% end %>
|
6
6
|
</div>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<%%- session_key_name = ActionController::Base.session_options[:key] -%>
|
2
|
+
<%%= javascript_include_tag "uploadify/swfobject", "uploadify/jquery.uploadify.v2.1.0" %>
|
3
3
|
|
4
4
|
<script type="text/javascript" charset="utf-8">
|
5
5
|
$(document).ready(function() {
|
6
|
-
$('
|
6
|
+
$('#<%=child_singular_name%>_file').click(function(event) {
|
7
7
|
event.preventDefault();
|
8
8
|
});
|
9
9
|
|
10
|
-
$('
|
10
|
+
$('#<%=child_singular_name%>_file').uploadify({
|
11
11
|
'uploader' : '/javascripts/uploadify/uploadify.swf',
|
12
|
-
'script' : '
|
12
|
+
'script' : '/<%=child_plural_name%>/create',
|
13
13
|
'multi' : true,
|
14
14
|
'auto' : false,
|
15
15
|
'buttonText' : 'Find',
|
@@ -19,19 +19,19 @@
|
|
19
19
|
height : 26, // The height of the flash button
|
20
20
|
width : 101, // The width of the flash button
|
21
21
|
onComplete : function(event, queueID, fileObj, response, data) { var dat = eval('(' +
|
22
|
-
response + ')');$.getScript(dat
|
22
|
+
response + ')');$.getScript(dat.<%=child_singular_name%>);},
|
23
23
|
'scriptData': {
|
24
|
-
'
|
25
|
-
'authenticity_token' : encodeURIComponent('
|
26
|
-
'
|
24
|
+
'<%%= session_key_name %>' : encodeURIComponent('<%%= u cookies[session_key_name] %>'),
|
25
|
+
'authenticity_token' : encodeURIComponent('<%%= u form_authenticity_token if protect_against_forgery? %>'),
|
26
|
+
'<%=parent_singular_name%>_id' : '<%%= @<%=parent_singular_name%>.id %>',
|
27
27
|
'title' : 'change me!',
|
28
28
|
'format' : 'json'
|
29
29
|
}
|
30
30
|
});
|
31
31
|
|
32
|
-
$('
|
32
|
+
$('#<%=child_singular_name%>_submit').click(function(event){
|
33
33
|
event.preventDefault();
|
34
|
-
$('
|
34
|
+
$('#<%=child_singular_name%>_file').uploadifyUpload();
|
35
35
|
});
|
36
36
|
});
|
37
37
|
</script>
|
@@ -1,53 +1,53 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<%% title "<%=parent_plural_class_name%>" %>
|
2
|
+
<%% heading "<%=parent_plural_class_name%>" %>
|
3
3
|
|
4
|
-
|
4
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
5
5
|
|
6
6
|
<div class="button_bar">
|
7
|
-
|
8
|
-
|
7
|
+
<%%= render :partial => 'search' %>
|
8
|
+
<%%=link_to('new allbum', new_<%=parent_singular_name%>_path, :class => 'newfile tip', :title => "New <%=parent_class_name%>")%>
|
9
9
|
</div>
|
10
10
|
|
11
|
-
<div class='
|
11
|
+
<div class='<%=child_singular_name%>list'>
|
12
12
|
|
13
|
-
|
13
|
+
<%%= will_paginate @<%=parent_plural_name%> %>
|
14
14
|
|
15
|
-
<table class="
|
15
|
+
<table class="<%=child_plural_name%>">
|
16
16
|
<tr style='color:#222;'>
|
17
17
|
<th></th>
|
18
18
|
<th>
|
19
|
-
|
19
|
+
<%=parent_class_name%> Title
|
20
20
|
</th>
|
21
21
|
<th>
|
22
22
|
Created At
|
23
23
|
</th>
|
24
24
|
<th></th>
|
25
25
|
</tr>
|
26
|
-
|
27
|
-
<tr class='
|
26
|
+
<%% @<%=parent_plural_name%>.each do |<%=parent_singular_name%>| %>
|
27
|
+
<tr class='<%%= cycle('odd', 'even')%>'>
|
28
28
|
|
29
29
|
<td>
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
<%% if <%=parent_singular_name%>.<%=child_plural_name%>.empty? %>
|
31
|
+
<%%= link_to "add <%=child_plural_name%> to #{<%=parent_singular_name%>.title}", <%=parent_singular_name%> %>
|
32
|
+
<%% else %>
|
33
|
+
<%% @<%=child_singular_name%> = <%=parent_singular_name%>.<%=child_plural_name%>.find(:first) %>
|
34
|
+
<%%= link_to image_tag(@<%=child_singular_name%>.file.url(:thumb)), <%=parent_singular_name%> %>
|
35
|
+
<%% end -%>
|
36
36
|
</td>
|
37
37
|
<td>
|
38
|
-
<%=
|
38
|
+
<%%= <%=parent_singular_name%>.title%>
|
39
39
|
</td>
|
40
40
|
<td>
|
41
|
-
<%=
|
41
|
+
<%%= <%=parent_singular_name%>.created_at.to_s(:m_d_y) %>
|
42
42
|
</td>
|
43
43
|
<td>
|
44
44
|
<div style='float:right'>
|
45
|
-
|
46
|
-
|
45
|
+
<%%=link_to('', edit_<%=parent_singular_name%>_path(<%=parent_singular_name%>), :class => 'edit')%>
|
46
|
+
<%%=link_to "", <%=parent_singular_name%>, :confirm => 'Are you sure?', :method => :delete, :class => 'destroy' %>
|
47
47
|
</div>
|
48
48
|
</td>
|
49
49
|
</tr>
|
50
|
-
|
50
|
+
<%% end %>
|
51
51
|
|
52
52
|
</table>
|
53
53
|
|
@@ -56,6 +56,6 @@
|
|
56
56
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
|
59
|
-
|
59
|
+
<%%= will_paginate @<%=parent_plural_name%> %>
|
60
60
|
|
61
61
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
2
2
|
|
3
3
|
<script type="text/javascript" charset="utf-8">
|
4
4
|
$(document).ready(function() {
|
@@ -10,12 +10,12 @@
|
|
10
10
|
});
|
11
11
|
</script>
|
12
12
|
|
13
|
-
<div class='
|
14
|
-
<h1
|
13
|
+
<div class='<%=child_singular_name%>list'>
|
14
|
+
<h1><%%= link_to @<%=parent_singular_name%>.title, <%=parent_singular_name%>_path(@<%=parent_singular_name%>) %></h1>
|
15
15
|
|
16
|
-
|
16
|
+
<%% form_tag '/<%=child_plural_name%>/destroy' do %>
|
17
17
|
|
18
|
-
<table class='
|
18
|
+
<table class='<%=child_plural_name%>'>
|
19
19
|
<tr style='color:#222;'>
|
20
20
|
<th>
|
21
21
|
|
@@ -31,35 +31,35 @@
|
|
31
31
|
Created At
|
32
32
|
</th>
|
33
33
|
</tr>
|
34
|
-
|
35
|
-
<tr class='
|
34
|
+
<%% @<%=parent_singular_name%>.<%=child_plural_name%>.each do |<%=child_singular_name%>| %>
|
35
|
+
<tr class='<%%= cycle('odd', 'even')%>'>
|
36
36
|
<td>
|
37
|
-
|
37
|
+
<%%= check_box_tag "<%=child_singular_name%>_ids[]", <%=child_singular_name%>.id %>
|
38
38
|
</td>
|
39
39
|
<td>
|
40
|
-
|
40
|
+
<%%= image_tag(<%=child_singular_name%>.file.url(:thumb), :height => "60") %>
|
41
41
|
|
42
|
-
<div style="display:none"><div id="
|
42
|
+
<div style="display:none"><div id="<%%=<%=child_singular_name%>.id%>"><%%= image_tag(<%=child_singular_name%>.file.url(:original)) %></div></div>
|
43
43
|
</td>
|
44
44
|
<td>
|
45
|
-
<%=
|
45
|
+
<%%= <%=child_singular_name%>.file_file_name %>
|
46
46
|
</td>
|
47
47
|
<td>
|
48
|
-
|
48
|
+
<%%= number_to_human_size(<%=child_singular_name%>.file_file_size) %>
|
49
49
|
</td>
|
50
50
|
<td>
|
51
|
-
<%=
|
51
|
+
<%%= <%=child_singular_name%>.created_at.to_s(:m_d_y) %>
|
52
52
|
</td>
|
53
53
|
</tr>
|
54
|
-
|
54
|
+
<%% end %>
|
55
55
|
<tr class='odd'>
|
56
56
|
<td colspan='5'>
|
57
57
|
<input type="checkbox" class="checkall"> Check all
|
58
|
-
|
58
|
+
<%%= submit_tag "Delete checked" %>
|
59
59
|
</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
|
63
|
-
|
63
|
+
<%% end -%>
|
64
64
|
|
65
65
|
</div>
|
@@ -1,56 +1,56 @@
|
|
1
|
-
|
1
|
+
<%% title h(@<%=parent_singular_name%>.title) %>
|
2
2
|
|
3
|
-
|
3
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
4
4
|
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
<%% content_for :head do %>
|
7
|
+
<%%= javascript_include_tag 'dragsort', 'dust_<%=parent_singular_name%>' %>
|
8
|
+
<%% end -%>
|
9
9
|
|
10
|
-
|
10
|
+
<%%= render :partial => "upload_script" %>
|
11
11
|
|
12
12
|
<div class="item">
|
13
13
|
|
14
14
|
<div class='manage'>
|
15
|
-
|
16
|
-
|
15
|
+
<%%= link_to "", edit_<%=parent_singular_name%>_path(@<%=parent_singular_name%>), :class => 'edit' %>
|
16
|
+
<%%= link_to "", @<%=parent_singular_name%>, :confirm => 'Are you sure?', :method => :delete, :class => 'destroy' %>
|
17
17
|
</div>
|
18
18
|
|
19
19
|
<h1>
|
20
|
-
|
20
|
+
<%%= link_to @<%=parent_singular_name%>.title, view_<%=parent_singular_name%>_path(@<%=parent_singular_name%>.filename) %>
|
21
21
|
</h1>
|
22
|
-
|
22
|
+
<%%= simple_format(h(@<%=parent_singular_name%>.desc)) %>
|
23
23
|
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<div class="item">
|
27
27
|
<div class="manage">
|
28
28
|
<br />
|
29
|
-
|
29
|
+
<%%= link_to image_tag('save_position.png'), <%=child_plural_name%>_path, :id => 'order_<%=child_plural_name%>' %>
|
30
30
|
</div>
|
31
31
|
|
32
|
-
<h3 id="
|
33
|
-
<p>Drag
|
32
|
+
<h3 id="<%=child_plural_name%>_count"><%%= pluralize(@<%=parent_singular_name%>.<%=child_plural_name%>.size, "<%=child_class_name%>")%> <%% unless @<%=parent_singular_name%>.<%=child_plural_name%>.empty? %> | <%%= link_to "Select <%=child_plural_class_name%> For Deletion", manage_<%=child_plural_name%>_path(@<%=parent_singular_name%>), :class => 'settings' %> <%% end %> </h3>
|
33
|
+
<p>Drag <%=child_plural_name%> to reorder them. Don't forget to hit the save order button when your done.</p>
|
34
34
|
<ul id="uploads">
|
35
|
-
|
35
|
+
<%%= render :partial => @<%=parent_singular_name%>.<%=child_plural_name%>.roots, :<%=child_singular_name%> => @<%=child_singular_name%> %>
|
36
36
|
</ul>
|
37
37
|
|
38
38
|
<div class="clear"></div>
|
39
39
|
</div>
|
40
40
|
|
41
|
-
|
41
|
+
<%% content_for :left do -%>
|
42
42
|
|
43
43
|
<div id="uploadify">
|
44
|
-
<h3>Add
|
45
|
-
|
44
|
+
<h3>Add <%=child_plural_class_name%> to <%%= @<%=parent_singular_name%>.title.titleize %></h3>
|
45
|
+
<%% form_for @new_<%=child_singular_name%>, :html => {:multipart => true} do |f| %>
|
46
46
|
|
47
|
-
|
47
|
+
<%%= f.hidden_field :<%=parent_singular_name%>_id, "value" => @<%=parent_singular_name%>.id %>
|
48
48
|
<div class="uploadifyButtons">
|
49
|
-
|
49
|
+
<%%= image_submit_tag "Upload.png", :id => "<%=child_singular_name%>_submit", :name => 'commit' %> <%%= f.file_field :file %>
|
50
50
|
<div class='clear'></div>
|
51
51
|
</div>
|
52
|
-
|
52
|
+
<%% end %>
|
53
53
|
</div>
|
54
54
|
|
55
|
-
|
55
|
+
<%% end -%>
|
56
56
|
|
@@ -1 +1 @@
|
|
1
|
-
$('#uploads').html("
|
1
|
+
$('#uploads').html("<%%= escape_javascript(render(@<%=parent_singular_name%>.<%=child_plural_name%>.roots, :<%=child_singular_name%> => @<%=child_singular_name%>)) %>");
|
@@ -1,23 +1,23 @@
|
|
1
|
-
|
1
|
+
<%%= stylesheet( 'dust_<%=parent_singular_name%>','uploadify') %>
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
<%% form_for @<%=child_singular_name%>, :validations => true do |f| %>
|
4
|
+
<%%= f.error_messages %>
|
5
5
|
<div class="item">
|
6
6
|
<p>
|
7
|
-
|
8
|
-
|
7
|
+
<%%= f.label :title %><br />
|
8
|
+
<%%= f.text_field :title, :class => 'field' %>
|
9
9
|
</p>
|
10
10
|
</div>
|
11
11
|
|
12
12
|
<div class="item">
|
13
13
|
<p>
|
14
|
-
|
15
|
-
|
14
|
+
<%%= f.label :desc %><br />
|
15
|
+
<%%= f.text_area :desc, :class => 'field' %>
|
16
16
|
</p>
|
17
17
|
</div>
|
18
18
|
|
19
19
|
<div class="item">
|
20
|
-
<p
|
20
|
+
<p><%%= f.submit %></p>
|
21
21
|
</div>
|
22
22
|
|
23
|
-
|
23
|
+
<%% end %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<li id="
|
2
|
-
<div class="
|
1
|
+
<li id="<%%= "<%=child_singular_name%>_#{<%=child_singular_name%>.id}" %>">
|
2
|
+
<div class="<%=child_singular_name%> <%%= "<%=child_singular_name%>_#{<%=child_singular_name%>.id}" %>">
|
3
3
|
<script type="text/javascript" charset="utf-8">
|
4
4
|
$("a.settings").fancybox({
|
5
5
|
'showCloseButton' : false,
|
@@ -13,13 +13,13 @@
|
|
13
13
|
'opacity' : 'true'
|
14
14
|
});
|
15
15
|
</script>
|
16
|
-
|
16
|
+
<%%= image_tag <%=child_singular_name%>.file.url(:thumb), :height => '50' %>
|
17
17
|
<p>
|
18
|
-
|
19
|
-
|
20
|
-
(<%=
|
21
|
-
|
22
|
-
|
18
|
+
<%%= truncate <%=child_singular_name%>.title, :length => 23 %> <br />
|
19
|
+
<%% unless <%=child_singular_name%>.date_shot.blank? %>
|
20
|
+
(<%%= <%=child_singular_name%>.date_shot %>)
|
21
|
+
<%% end -%>
|
22
|
+
<%%= link_to "Edit <%=child_class_name%>", edit_<%=child_singular_name%>_path(<%=child_singular_name%>.id)+'?edit=<%=child_singular_name%>', :class => "settings", :title => "<%=child_class_name%> Settings" %>
|
23
23
|
</p>
|
24
24
|
</div>
|
25
25
|
</li>
|