beautiful_scaffold 0.0.1 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +21 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +10 -0
- data/beautiful_scaffold.gemspec +18 -0
- data/lib/generators/USAGE +15 -0
- data/lib/generators/beautiful_locale_generator.rb +34 -0
- data/lib/generators/beautiful_migration_generator.rb +53 -0
- data/lib/generators/beautiful_scaffold_common_methods.rb +104 -0
- data/lib/generators/beautiful_scaffold_generator.rb +158 -0
- data/lib/generators/templates/app/assets/images/bg-bottom-login.jpg +0 -0
- data/lib/generators/templates/app/assets/images/bg-error.png +0 -0
- data/lib/generators/templates/app/assets/images/bg-left.jpg +0 -0
- data/lib/generators/templates/app/assets/images/bg-notice.jpg +0 -0
- data/lib/generators/templates/app/assets/images/bg-notice.png +0 -0
- data/lib/generators/templates/app/assets/images/bg-success.png +0 -0
- data/lib/generators/templates/app/assets/images/bg-top-login.jpg +0 -0
- data/lib/generators/templates/app/assets/images/bg-warning.png +0 -0
- data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +80 -0
- data/lib/generators/templates/app/assets/javascripts/jquery.pjax.js +370 -0
- data/lib/generators/templates/app/assets/javascripts/modernizr.custom.js +4 -0
- data/lib/generators/templates/app/assets/stylesheets/beautiful_scaffold.css.scss +719 -0
- data/lib/generators/templates/app/assets/stylesheets/reset.css +48 -0
- data/lib/generators/templates/app/controllers/base.rb +177 -0
- data/lib/generators/templates/app/controllers/master_base.rb +37 -0
- data/lib/generators/templates/app/helpers/beautiful_helper.rb +130 -0
- data/lib/generators/templates/app/helpers/model_helper.rb +4 -0
- data/lib/generators/templates/app/locales/beautiful_scaffold.en.yml +30 -0
- data/lib/generators/templates/app/locales/beautiful_scaffold.fr.yml +30 -0
- data/lib/generators/templates/app/models/pdf_report.rb +40 -0
- data/lib/generators/templates/app/views/_beautiful_menu.html.erb +9 -0
- data/lib/generators/templates/app/views/_form.html.erb +24 -0
- data/lib/generators/templates/app/views/edit.html.erb +6 -0
- data/lib/generators/templates/app/views/index.html.erb +86 -0
- data/lib/generators/templates/app/views/layout.html.erb +70 -0
- data/lib/generators/templates/app/views/new.html.erb +5 -0
- data/lib/generators/templates/app/views/partials/_form_field.html.erb +37 -0
- data/lib/generators/templates/app/views/partials/_index_batch.html.erb +6 -0
- data/lib/generators/templates/app/views/partials/_index_column.html.erb +19 -0
- data/lib/generators/templates/app/views/partials/_index_header.html.erb +9 -0
- data/lib/generators/templates/app/views/partials/_index_search.html.erb +10 -0
- data/lib/generators/templates/app/views/partials/_show_field.html.erb +14 -0
- data/lib/generators/templates/app/views/show.html.erb +7 -0
- data/lib/generators/templates/markitup/jquery.markitup.js +593 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/bold.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/clean.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/code.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/fonts.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/italic.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/link.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/list-bullet.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/list-item.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/list-numeric.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/picture.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/preview.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/quotes.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/stroke.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/images/underline.png +0 -0
- data/lib/generators/templates/markitup/sets/bbcode/readme.txt +11 -0
- data/lib/generators/templates/markitup/sets/bbcode/set.js +39 -0
- data/lib/generators/templates/markitup/sets/bbcode/style.css +47 -0
- data/lib/generators/templates/markitup/sets/default/images/bold.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/clean.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/image.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/italic.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/link.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/list-bullet.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/list-numeric.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/picture.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/preview.png +0 -0
- data/lib/generators/templates/markitup/sets/default/images/stroke.png +0 -0
- data/lib/generators/templates/markitup/sets/default/set.js +30 -0
- data/lib/generators/templates/markitup/sets/default/style.css +34 -0
- data/lib/generators/templates/markitup/sets/html/images/bold.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/clean.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/h1.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/h2.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/h3.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/h4.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/h5.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/h6.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/image.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/italic.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/link.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/list-bullet.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/list-item.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/list-numeric.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/paragraph.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/picture.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/preview.png +0 -0
- data/lib/generators/templates/markitup/sets/html/images/stroke.png +0 -0
- data/lib/generators/templates/markitup/sets/html/readme.txt +11 -0
- data/lib/generators/templates/markitup/sets/html/set.js +39 -0
- data/lib/generators/templates/markitup/sets/html/style.css +59 -0
- data/lib/generators/templates/markitup/sets/markdown/images/bold.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/code.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/h1.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/h2.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/h3.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/h4.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/h5.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/h6.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/italic.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/link.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/list-bullet.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/list-numeric.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/picture.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/preview.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/images/quotes.png +0 -0
- data/lib/generators/templates/markitup/sets/markdown/readme.txt +11 -0
- data/lib/generators/templates/markitup/sets/markdown/set.js +52 -0
- data/lib/generators/templates/markitup/sets/markdown/style.css +54 -0
- data/lib/generators/templates/markitup/sets/textile/images/bold.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/code.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/h1.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/h2.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/h3.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/h4.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/h5.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/h6.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/italic.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/link.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/list-bullet.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/list-numeric.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/paragraph.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/picture.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/preview.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/quotes.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/images/stroke.png +0 -0
- data/lib/generators/templates/markitup/sets/textile/readme.txt +11 -0
- data/lib/generators/templates/markitup/sets/textile/set.js +40 -0
- data/lib/generators/templates/markitup/sets/textile/style.css +60 -0
- data/lib/generators/templates/markitup/sets/wiki/images/bold.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/code.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/h1.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/h2.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/h3.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/h4.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/h5.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/h6.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/italic.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/link.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/list-bullet.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/list-numeric.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/picture.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/preview.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/quotes.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/stroke.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/images/url.png +0 -0
- data/lib/generators/templates/markitup/sets/wiki/readme.txt +11 -0
- data/lib/generators/templates/markitup/sets/wiki/set.js +37 -0
- data/lib/generators/templates/markitup/sets/wiki/style.css +57 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-container.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-html.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-json.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/bg-editor.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/handle.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/menu.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/images/submenu.png +0 -0
- data/lib/generators/templates/markitup/skins/markitup/style.css +147 -0
- data/lib/generators/templates/markitup/skins/simple/images/handle.png +0 -0
- data/lib/generators/templates/markitup/skins/simple/images/menu.png +0 -0
- data/lib/generators/templates/markitup/skins/simple/images/submenu.png +0 -0
- data/lib/generators/templates/markitup/skins/simple/style.css +118 -0
- data/lib/generators/templates/markitup/templates/preview.css +5 -0
- data/lib/generators/templates/markitup/templates/preview.html +11 -0
- data/lib/generators/templates/modules/beautiful_scaffold_module.rb +28 -0
- metadata +175 -3
@@ -0,0 +1,70 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="<%%= I18n.default_locale %>">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Beautiful Scaffold</title>
|
6
|
+
|
7
|
+
<meta name="description" content="Beautiful Scaffold">
|
8
|
+
<meta name="author" content="You or me Sylvain Claudel (http://blog.escarworld.com)">
|
9
|
+
|
10
|
+
<%%= stylesheet_link_tag "reset", "beautiful_scaffold" %>
|
11
|
+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
|
12
|
+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
|
13
|
+
<%%= javascript_include_tag "application", "jquery.pjax", "beautiful_scaffold" %>
|
14
|
+
|
15
|
+
<%%= javascript_include_tag "jquery.markitup.js" %>
|
16
|
+
<%%= javascript_include_tag "markitup/sets/default/set.js" %>
|
17
|
+
<%%= stylesheet_link_tag "markitup/skins/simple/style.css" %>
|
18
|
+
|
19
|
+
<% miufile = ["bbcode","wiki","markdown","html","textile"] %>
|
20
|
+
<%%= stylesheet_link_tag <%= miufile.map{ |code| "'markitup/sets/#{code}/style.css'" }.join(',') %> %>
|
21
|
+
<%%= javascript_include_tag <%= miufile.map{ |code| "'markitup/sets/#{code}/set.js'" }.join(',') %> %>
|
22
|
+
|
23
|
+
<%%= csrf_meta_tags %>
|
24
|
+
<%%= yield :head %>
|
25
|
+
</head>
|
26
|
+
<body>
|
27
|
+
<div id="admin">
|
28
|
+
<div id="left-panel">
|
29
|
+
<p id="logo">Beautiful Scaffold</p>
|
30
|
+
<p id="home">Hello
|
31
|
+
<span id="username">
|
32
|
+
<%%= l(Date.today, :format => :long) %>
|
33
|
+
</span>
|
34
|
+
<span id="message"></span>
|
35
|
+
</p>
|
36
|
+
<p id="home-link">
|
37
|
+
<a href="#">Homepage</a>
|
38
|
+
<div class="loader" style="display:none">
|
39
|
+
<div class="circle"></div>
|
40
|
+
<div class="circle1"></div>
|
41
|
+
</div>
|
42
|
+
</p>
|
43
|
+
|
44
|
+
<%%= render :partial => "layouts/beautiful_menu" %>
|
45
|
+
</div>
|
46
|
+
<div id="right-panel">
|
47
|
+
<h1>Administration Panel</h1>
|
48
|
+
<p class="subtitle">Beautiful Scaffold</p>
|
49
|
+
|
50
|
+
<!--<p id="flash-warning">Lorem ipsum....</p>-->
|
51
|
+
<%% if not flash[:notice].blank? then %>
|
52
|
+
<p id="flash-notice"><%%= flash[:notice] %></p>
|
53
|
+
<%% end %>
|
54
|
+
<!--<p id="flash-success">Lorem ipsum....</p>-->
|
55
|
+
<%% if not flash[:error].blank? then %>
|
56
|
+
<p id="flash-error"><%%= flash[:error] %></p>
|
57
|
+
<%% end %>
|
58
|
+
|
59
|
+
<div id="pjax-container">
|
60
|
+
<%%= yield %>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<p id="footer">
|
64
|
+
Copyright 2011 Beautiful Scaffold | Powered by <a href="http://blog.escarworld.com">rivsc</a> | <a href="http://www.beautiful-scaffold.com">Beautiful Scaffold</a>
|
65
|
+
</p>
|
66
|
+
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</body>
|
70
|
+
</html>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<div class="box content-box">
|
2
|
+
<div class="box-title"><%%= t(:new, :default => 'New') %> <%= singular_table_name %></div>
|
3
|
+
<%%= render 'form' %>
|
4
|
+
<%%= link_to t(:back, :default => "Back"), <%= namespace_for_route %><%= plural_table_name %>_path, :class => "btn" %>
|
5
|
+
</div>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<%- attributes.each do |attribute| -%>
|
2
|
+
<%- if @beautiful_attributes.include?(attribute.name + ':richtext') then -%>
|
3
|
+
<div class="field">
|
4
|
+
<%%= f.label :<%= attribute.name %>, t(:<%= attribute.name %>, :default => "<%= attribute.name %>") %>
|
5
|
+
<%%= f.text_area :<%= attribute.name %>, :class => "richtext-editor" %>
|
6
|
+
</div>
|
7
|
+
<div class="field">
|
8
|
+
<% for type in richtext_type %>
|
9
|
+
<%% hashradio = {:id => "<%= attribute.name %>-<%= type %>", :class => "select-richtext", 'data-editor' => 'markItUp<%= singular_table_name.capitalize %>_<%= attribute.name.downcase %>', 'data-spleditor' => '<%= singular_table_name %>_<%= attribute.name %>' } %>
|
10
|
+
<%% hashradio[:checked] = "checked" if @<%= singular_table_name %>.<%= attribute.name %>_typetext == "<%= type %>" %>
|
11
|
+
<%%= f.radio_button :<%= attribute.name %>_typetext, "<%= type %>", hashradio %>
|
12
|
+
<label for="<%= attribute.name %>-<%= type %>" class="label-richtext-type"><%= type.capitalize %></label>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<%% rttype = @<%= singular_table_name %>.<%= attribute.name %>_typetext.to_s %>
|
17
|
+
<%% if not rttype.blank? then %>
|
18
|
+
<script language="javascript">
|
19
|
+
$(document).ready(function(){
|
20
|
+
$('#<%= singular_table_name %>_<%= attribute.name %>').markItUp(my<%%= rttype.capitalize %>Settings);
|
21
|
+
$('#markItUp<%= singular_table_name.capitalize %>_<%= attribute.name.downcase %>').addClass('<%%= rttype.downcase %>');
|
22
|
+
});
|
23
|
+
</script>
|
24
|
+
<%% end %>
|
25
|
+
|
26
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':references') then -%>
|
27
|
+
<div class="field">
|
28
|
+
<%%= f.label :<%= attribute.name %>, t(:<%= attribute.name %>, :default => "<%= attribute.name %>") %>
|
29
|
+
<%%= f.collection_select :<%= attribute.name %>_id, <%= attribute.name.camelcase %>.all, :id, :caption %>
|
30
|
+
</div>
|
31
|
+
<%- else -%>
|
32
|
+
<div class="field">
|
33
|
+
<%%= f.label :<%= attribute.name %>, t(:<%= attribute.name %>, :default => "<%= attribute.name %>") %>
|
34
|
+
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
|
35
|
+
</div>
|
36
|
+
<%- end -%>
|
37
|
+
<%- end -%>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<%- attributes.each{ |attribute| -%>
|
2
|
+
<%- if attribute.type.to_s == "boolean" then -%>
|
3
|
+
<option value="<%= attribute.name %>.true"><%%= t(:settrueforattr, :attr => "<%= attribute.name %>", :default => "Set <%= attribute.name %> to true") %></option>
|
4
|
+
<option value="<%= attribute.name %>.false"><%%= t(:setfalseforattr, :attr => "<%= attribute.name %>", :default => "Set <%= attribute.name %> to false") %></option>
|
5
|
+
<%- end -%>
|
6
|
+
<%- } -%>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%- attributes.each do |attribute| -%>
|
2
|
+
<td class="<%%= align_attribute("<%= attribute.type %>") %>">
|
3
|
+
<% if @beautiful_attributes.include?(attribute.name + ':price') then %>
|
4
|
+
<%%= number_to_currency(<%= singular_table_name %>.<%= attribute.name %>) %>
|
5
|
+
<% elsif @beautiful_attributes.include?(attribute.name + ':richtext') then %>
|
6
|
+
<%%= truncate(<%= singular_table_name %>.<%= attribute.name + "_fulltext" %>, :length => 30) %>
|
7
|
+
<% elsif @beautiful_attributes.include?(attribute.name + ':boolean') then %>
|
8
|
+
<%%= t((<%= singular_table_name %>.<%= attribute.name %> ? "yes" : "no").to_sym) %>
|
9
|
+
<% elsif @beautiful_attributes.include?(attribute.name + ':references') then %>
|
10
|
+
<%% if not <%= singular_table_name %>.<%= attribute.name %>_id.nil? then %>
|
11
|
+
<%%= link_to "#" + <%= singular_table_name %>.<%= attribute.name %>_id.to_s, <%= namespace_for_route %><%= attribute.name %>_path(<%= singular_table_name %>.<%= attribute.name %>_id) %>
|
12
|
+
<%% else %>
|
13
|
+
<%%= t(:any, :default => "Any") %>
|
14
|
+
<%% end %>
|
15
|
+
<% else %>
|
16
|
+
<%%= <%= singular_table_name %>.<%= attribute.name %> %>
|
17
|
+
<% end %>
|
18
|
+
</td>
|
19
|
+
<%- end -%>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%- attributes.each do |attribute| -%>
|
2
|
+
<th>
|
3
|
+
<%- id_or_not = "" -%>
|
4
|
+
<%- if @beautiful_attributes.include?(attribute.name + ':references') then -%>
|
5
|
+
<%- id_or_not = "_id" -%>
|
6
|
+
<%- end -%>
|
7
|
+
<%%= sorting_header("<%= singular_table_name %>", "<%= attribute.name %><%= id_or_not %>", "<%= namespace_alone %>") %>
|
8
|
+
</th>
|
9
|
+
<%- end -%>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%- attributes.each do |a| -%>
|
2
|
+
<%- attribute = "" -%>
|
3
|
+
<%- caption = a.name.capitalize -%>
|
4
|
+
<%- if @beautiful_attributes.include?(a.name + ':references') then -%>
|
5
|
+
<%- attribute = "_id" -%>
|
6
|
+
<%- elsif @beautiful_attributes.include?(a.name + ':richtext') then -%>
|
7
|
+
<%- attribute = "_fulltext" -%>
|
8
|
+
<%- end -%>
|
9
|
+
<%%= ransack_field("<%= singular_table_name %>", "<%= a.name %><%= attribute %>", f, "<%= caption %>") %>
|
10
|
+
<%- end -%>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%- attributes.each do |attribute| -%>
|
2
|
+
<p>
|
3
|
+
<b><%%= t(:<%= attribute.name %>, :default => "<%= attribute.human_name %>") %>:</b>
|
4
|
+
<%- if @beautiful_attributes.include?(attribute.name + ':price') then -%>
|
5
|
+
<%%= number_to_currency(@<%= singular_table_name %>.<%= attribute.name %>) %>
|
6
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':boolean') then -%>
|
7
|
+
<%%= t((@<%= singular_table_name %>.<%= attribute.name %> ? "yes".to_sym : "no".to_sym)) %>
|
8
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':references') then -%>
|
9
|
+
<%%= (@<%= singular_table_name %>.<%= attribute.name %>.nil? ? "" : @<%= singular_table_name %>.<%= attribute.name %>.caption) %>
|
10
|
+
<%- else -%>
|
11
|
+
<%%= @<%= singular_table_name %>.<%= attribute.name %> %>
|
12
|
+
<%- end -%>
|
13
|
+
</p>
|
14
|
+
<%- end -%>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="box content-box">
|
2
|
+
<div class="box-title"><%%= t(:show, :default => "Show") %> <%= singular_table_name %></div>
|
3
|
+
<%= render_partial 'app/views/partials/_show_field.html.erb' %>
|
4
|
+
<!-- Beautiful_scaffold - AddField - Field - Do not remove -->
|
5
|
+
<%%= link_to t(:edit, :default => "Edit"), edit_<%= namespace_for_route %><%= singular_table_name %>_path(@<%= singular_table_name %>), :class => "btn" %>
|
6
|
+
<%%= link_to t(:back, :default => "Back"), <%= namespace_for_route %><%= plural_table_name %>_path, :class => "btn" %>
|
7
|
+
</div>
|