smithycms 0.0.1
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/MIT-LICENSE +20 -0
- data/README.md +142 -0
- data/Rakefile +27 -0
- data/app/assets/images/smithy/logo.png +0 -0
- data/app/assets/images/smithy/logo2.png +0 -0
- data/app/assets/javascripts/smithy/application.js +13 -0
- data/app/assets/javascripts/smithy/assets.js.coffee +35 -0
- data/app/assets/javascripts/smithy/guides.js +23 -0
- data/app/assets/javascripts/smithy/jquery-ui.min.js +5 -0
- data/app/assets/javascripts/smithy/nested_forms.js +55 -0
- data/app/assets/javascripts/smithy/page_contents.js +4 -0
- data/app/assets/javascripts/smithy/pages.js +41 -0
- data/app/assets/javascripts/smithy/settings.js +0 -0
- data/app/assets/javascripts/smithy/templates.js +25 -0
- data/app/assets/stylesheets/smithy/application.css.scss +29 -0
- data/app/assets/stylesheets/smithy/assets.css.scss +3 -0
- data/app/assets/stylesheets/smithy/bootstrap_and_overrides.css.scss +12 -0
- data/app/assets/stylesheets/smithy/content_blocks.css.scss +2 -0
- data/app/assets/stylesheets/smithy/forms.css.scss +3 -0
- data/app/assets/stylesheets/smithy/guides.css.scss +5 -0
- data/app/assets/stylesheets/smithy/layout.css.scss +113 -0
- data/app/assets/stylesheets/smithy/pages.css.scss +35 -0
- data/app/assets/stylesheets/smithy/templates.css.scss +14 -0
- data/app/controllers/smithy/assets_controller.rb +50 -0
- data/app/controllers/smithy/base_controller.rb +14 -0
- data/app/controllers/smithy/caches_controller.rb +13 -0
- data/app/controllers/smithy/content_blocks_controller.rb +50 -0
- data/app/controllers/smithy/content_pieces_controller.rb +97 -0
- data/app/controllers/smithy/contents_controller.rb +41 -0
- data/app/controllers/smithy/guides_controller.rb +9 -0
- data/app/controllers/smithy/images_controller.rb +41 -0
- data/app/controllers/smithy/page_contents_controller.rb +90 -0
- data/app/controllers/smithy/pages_controller.rb +110 -0
- data/app/controllers/smithy/settings_controller.rb +46 -0
- data/app/controllers/smithy/sitemap_controller.rb +13 -0
- data/app/controllers/smithy/templates_controller.rb +79 -0
- data/app/helpers/smithy/application_helper.rb +36 -0
- data/app/helpers/smithy/assets_helper.rb +9 -0
- data/app/helpers/smithy/pages_helper.rb +12 -0
- data/app/helpers/smithy/settings_helper.rb +4 -0
- data/app/helpers/smithy/templates_helper.rb +4 -0
- data/app/helpers/smithy/upload_helper.rb +110 -0
- data/app/models/smithy/asset.rb +64 -0
- data/app/models/smithy/content.rb +35 -0
- data/app/models/smithy/content_block.rb +41 -0
- data/app/models/smithy/content_block_template.rb +26 -0
- data/app/models/smithy/image.rb +41 -0
- data/app/models/smithy/page.rb +94 -0
- data/app/models/smithy/page_content.rb +62 -0
- data/app/models/smithy/page_list.rb +61 -0
- data/app/models/smithy/page_proxy.rb +63 -0
- data/app/models/smithy/setting.rb +6 -0
- data/app/models/smithy/site.rb +30 -0
- data/app/models/smithy/template.rb +53 -0
- data/app/models/smithy/template_container.rb +16 -0
- data/app/views/layouts/smithy/application.html.erb +27 -0
- data/app/views/layouts/smithy/guides.html.erb +16 -0
- data/app/views/layouts/smithy/modal.html.erb +10 -0
- data/app/views/layouts/smithy/shared/_flash.html.erb +6 -0
- data/app/views/layouts/smithy/shared/_footer.html.erb +3 -0
- data/app/views/layouts/smithy/shared/_head.html.erb +8 -0
- data/app/views/layouts/smithy/shared/_nav.html.erb +37 -0
- data/app/views/layouts/smithy/shared/_tail.html.erb +4 -0
- data/app/views/layouts/smithy/wide.html.erb +24 -0
- data/app/views/smithy/assets/_asset.html.erb +10 -0
- data/app/views/smithy/assets/_form.html.erb +13 -0
- data/app/views/smithy/assets/_upload_form.html.erb +13 -0
- data/app/views/smithy/assets/create.js.erb +5 -0
- data/app/views/smithy/assets/edit.html.erb +5 -0
- data/app/views/smithy/assets/index.html.erb +13 -0
- data/app/views/smithy/assets/new.html.erb +13 -0
- data/app/views/smithy/caches/show.html.erb +8 -0
- data/app/views/smithy/content_blocks/_content_block.html.erb +1 -0
- data/app/views/smithy/content_blocks/_secondary_nav.html.erb +12 -0
- data/app/views/smithy/content_blocks/_template_fields.html.erb +19 -0
- data/app/views/smithy/content_blocks/edit.html.erb +31 -0
- data/app/views/smithy/content_blocks/index.html.erb +17 -0
- data/app/views/smithy/content_blocks/new.html.erb +12 -0
- data/app/views/smithy/content_pieces/edit.html.erb +13 -0
- data/app/views/smithy/content_pieces/index.html.erb +21 -0
- data/app/views/smithy/content_pieces/new.html.erb +1 -0
- data/app/views/smithy/contents/_form.html.erb +6 -0
- data/app/views/smithy/contents/_form_fields.html.erb +12 -0
- data/app/views/smithy/contents/edit.html.erb +3 -0
- data/app/views/smithy/contents/new.html.erb +3 -0
- data/app/views/smithy/guides/markdown.html.erb +150 -0
- data/app/views/smithy/images/_form.html.erb +6 -0
- data/app/views/smithy/images/_form_fields.html.erb +28 -0
- data/app/views/smithy/images/edit.html.erb +3 -0
- data/app/views/smithy/images/new.html.erb +3 -0
- data/app/views/smithy/page_contents/edit.html.erb +18 -0
- data/app/views/smithy/page_contents/new.html.erb +28 -0
- data/app/views/smithy/page_lists/_form_fields.html.erb +6 -0
- data/app/views/smithy/pages/_container.html.erb +24 -0
- data/app/views/smithy/pages/_form.html.erb +57 -0
- data/app/views/smithy/pages/_page.html.erb +6 -0
- data/app/views/smithy/pages/_page_nav.html.erb +6 -0
- data/app/views/smithy/pages/_page_related.html.erb +21 -0
- data/app/views/smithy/pages/_parent.html.erb +10 -0
- data/app/views/smithy/pages/_root.html.erb +5 -0
- data/app/views/smithy/pages/edit.html.erb +7 -0
- data/app/views/smithy/pages/index.html.erb +17 -0
- data/app/views/smithy/pages/new.html.erb +7 -0
- data/app/views/smithy/settings/_form.html.erb +7 -0
- data/app/views/smithy/settings/_setting.html.erb +6 -0
- data/app/views/smithy/settings/edit.html.erb +3 -0
- data/app/views/smithy/settings/index.html.erb +9 -0
- data/app/views/smithy/settings/new.html.erb +3 -0
- data/app/views/smithy/settings/show.html.erb +10 -0
- data/app/views/smithy/sitemap/show.xml.erb +10 -0
- data/app/views/smithy/templates/_secondary_nav.html.erb +21 -0
- data/app/views/smithy/templates/_template.html.erb +1 -0
- data/app/views/smithy/templates/edit.html.erb +36 -0
- data/app/views/smithy/templates/index.html.erb +17 -0
- data/app/views/smithy/templates/new.html.erb +13 -0
- data/config/initializers/aws.rb +5 -0
- data/config/initializers/dragonfly.rb +48 -0
- data/config/initializers/formtastic.rb +77 -0
- data/config/initializers/kaminari_config.rb +10 -0
- data/config/initializers/liquid.rb +2 -0
- data/config/routes.rb +38 -0
- data/db/migrate/20120911193140_create_smithy_templates.rb +11 -0
- data/db/migrate/20120911203618_create_smithy_settings.rb +10 -0
- data/db/migrate/20121018182146_create_smithy_pages.rb +27 -0
- data/db/migrate/20121019145543_create_smithy_template_containers.rb +11 -0
- data/db/migrate/20121019160426_create_smithy_page_contents.rb +21 -0
- data/db/migrate/20121024213357_create_smithy_content_blocks.rb +10 -0
- data/db/migrate/20121025011733_create_smithy_content_block_templates.rb +12 -0
- data/db/migrate/20121029175812_create_smithy_contents.rb +9 -0
- data/db/migrate/20121105222537_create_smithy_assets.rb +16 -0
- data/db/migrate/20121115215053_create_smithy_images.rb +15 -0
- data/db/migrate/20121127205022_add_external_link_to_smithy_pages.rb +5 -0
- data/db/migrate/20130115190505_add_markdown_content_to_smithy_contents.rb +5 -0
- data/db/migrate/20130123170918_set_defaults_for_show_in_navigation_and_cache_length.rb +6 -0
- data/db/migrate/20130311203806_create_smithy_page_lists.rb +15 -0
- data/db/migrate/20130312161116_remove_description_from_content_block.rb +5 -0
- data/db/migrate/20130326191051_add_html_attributes_to_images.rb +5 -0
- data/db/migrate/20131003210228_add_publishable_to_smithy_page_contents.rb +11 -0
- data/db/migrate/20131220160755_add_content_to_images.rb +5 -0
- data/db/migrate/20131223145710_add_position_to_smithy_template_containers.rb +5 -0
- data/lib/smithy/content_blocks/model.rb +16 -0
- data/lib/smithy/content_blocks/registry.rb +30 -0
- data/lib/smithy/content_blocks.rb +2 -0
- data/lib/smithy/content_pieces/base.rb +10 -0
- data/lib/smithy/content_pieces/registry.rb +39 -0
- data/lib/smithy/dependencies.rb +19 -0
- data/lib/smithy/dragonfly/asset_helper.rb +67 -0
- data/lib/smithy/dragonfly/remote_data_store.rb +33 -0
- data/lib/smithy/dragonfly.rb +30 -0
- data/lib/smithy/engine.rb +48 -0
- data/lib/smithy/formatter.rb +46 -0
- data/lib/smithy/liquid/database.rb +12 -0
- data/lib/smithy/liquid/drops/base.rb +16 -0
- data/lib/smithy/liquid/drops/page.rb +78 -0
- data/lib/smithy/liquid/filters/asset_tag.rb +33 -0
- data/lib/smithy/liquid/filters/resize.rb +12 -0
- data/lib/smithy/liquid/rendering.rb +50 -0
- data/lib/smithy/liquid/tags/asset.rb +54 -0
- data/lib/smithy/liquid/tags/csrf.rb +30 -0
- data/lib/smithy/liquid/tags/html.rb +61 -0
- data/lib/smithy/liquid/tags/nav.rb +76 -0
- data/lib/smithy/liquid.rb +8 -0
- data/lib/smithy/logger.rb +12 -0
- data/lib/smithy/version.rb +3 -0
- data/lib/smithy.rb +21 -0
- data/lib/smithycms.rb +1 -0
- data/lib/tasks/smithy_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +11 -0
- metadata +871 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
<% content_for :title, "System Cache" %>
|
2
|
+
|
3
|
+
<div class="hero-unit">
|
4
|
+
<p>If your website is acting weird or your not seeing your updates, you may need to reset everything and clear the cache.</p>
|
5
|
+
<p>
|
6
|
+
<%= button_to "Clear the Cache", cache_path, :class => 'btn btn-primary btn-large', :method => :delete %>
|
7
|
+
</p>
|
8
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<li<%= raw ' class="active"' if action_name == "edit" && @content_block == content_block %>><%= link_to content_block.name, [:edit, content_block] %></li>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% content_for :secondary_nav do %>
|
2
|
+
<ul class="nav nav-list">
|
3
|
+
<li class="nav-header">Content Blocks</li>
|
4
|
+
<%= render @content_blocks %>
|
5
|
+
</ul>
|
6
|
+
|
7
|
+
<!--
|
8
|
+
<div class="btn-group actions pull-right">
|
9
|
+
<%= link_to "<i class=\"icon-plus\"></i> Add Template <span class=\"caret\"></span>".html_safe, new_template_path, :class => 'dropdown-toggle btn btn-inverse', 'data-toggle' => 'dropdown', 'data-target' => '#', :role => 'button' %>
|
10
|
+
</div>
|
11
|
+
-->
|
12
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="well form-horizontal nested">
|
2
|
+
<%= f.inputs "Template", :class => "inputs content_block_template_fields" do %>
|
3
|
+
<%= f.input :id, :as => :hidden %>
|
4
|
+
<%= f.input :name %>
|
5
|
+
<%= f.input :content, :label => "Template Content", :input_html => { :id => "template_content-#{f.object.id}" } %>
|
6
|
+
<div id="template_content_editor-<%= f.object.id %>" class="template_content_editor"></div>
|
7
|
+
<% unless f.object.new_record? %>
|
8
|
+
<%= f.input :_destroy, :label => "Delete", :as => :boolean, :wrapper_html => {:class => "destroy inline"} %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<% content_for :javascript do %>
|
14
|
+
<%- if f.object.id.present? -%>
|
15
|
+
<%= javascript_tag do %>
|
16
|
+
ace_edit(<%= f.object.id %>, 'liquid');
|
17
|
+
<% end %>
|
18
|
+
<%- end -%>
|
19
|
+
<% end %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% content_for :title, "Content Blocks" %>
|
2
|
+
|
3
|
+
<%= render :partial => "secondary_nav" %>
|
4
|
+
|
5
|
+
<%= semantic_form_for @content_block do |f| %>
|
6
|
+
<%= f.inputs do %>
|
7
|
+
<dl>
|
8
|
+
<dt>Name</dt>
|
9
|
+
<dd><%= @content_block.name %></dd>
|
10
|
+
<dt>Description</dt>
|
11
|
+
<dd><%= @content_block.description %></dd>
|
12
|
+
<dt>Variables Available</dt>
|
13
|
+
<% @content_block.content_field_names.each do |field| %>
|
14
|
+
<dd>{{ <%= field %> }}</dd>
|
15
|
+
<% end %>
|
16
|
+
</dl>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<div><%= link_to_add_fields "Add a Template", :templates, f %></div>
|
20
|
+
<%= f.semantic_fields_for(:templates) do |builder| %>
|
21
|
+
<%= render :partial => "template_fields", :locals => { :f => builder } %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= f.actions do %>
|
25
|
+
<%= f.action :submit, :label => "Save this Content Block" %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<% content_for :related do %>
|
30
|
+
<p><%= link_to "Delete Content Block", @content_block, :method => :delete, :confirm => "Are you sure you want to delete this Content Block?", :class => 'btn btn-danger' %></p>
|
31
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% content_for :title, "Content Blocks" %>
|
2
|
+
|
3
|
+
<div class="hero-unit">
|
4
|
+
<%- if @content_blocks.empty? -%>
|
5
|
+
<p>Be the first to add a Content Block to your site. Content Blocks are the small pieces of content that fill up a page. You can control the look and feel of content blocks through their individual templates.</p>
|
6
|
+
<% else %>
|
7
|
+
<p>Add a content block or select one from your left to edit.</p>
|
8
|
+
<% end %>
|
9
|
+
<p>
|
10
|
+
<%= link_to "Add Content Block", new_content_block_path, :class => 'btn btn-primary btn-large' %>
|
11
|
+
</p>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<%= render :partial => "secondary_nav" %>
|
15
|
+
|
16
|
+
<% content_for :related do %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% content_for :title, "Content Blocks" %>
|
2
|
+
|
3
|
+
<%= semantic_form_for @content_block, :html => { :class => 'form-horizontal' } do |f| %>
|
4
|
+
<%= f.inputs "New Content Block" do %>
|
5
|
+
<%= f.input :name %>
|
6
|
+
<% end %>
|
7
|
+
<%= f.actions :submit %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= render :partial => "secondary_nav" %>
|
11
|
+
|
12
|
+
<% content_for :related, nil %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% content_for :title, "Edit #{klass_name}" %>
|
2
|
+
|
3
|
+
<%= semantic_form_for @record do |f| %>
|
4
|
+
<%= f.inputs do %>
|
5
|
+
<%= f.inputs *accessible_attributes %>
|
6
|
+
<% end %>
|
7
|
+
<%= f.actions :submit %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
|
11
|
+
<% content_for :related do %>
|
12
|
+
<%= content_tag :p, link_to("Delete #{klass_name}", @record, :method => :delete, :confirm => "Are you sure you want to delete this #{klass_name}?", :class => 'btn btn-danger') if @record.persisted? %></p>
|
13
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% content_for :title, "#{klass_name}" %>
|
2
|
+
<table border="0" cellpadding="4" class="table table-hover table-bordered">
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th></th>
|
6
|
+
<%= raw readable_attributes.map{|a| "<th>#{a.to_s.titleize}</th>\n" }.join %>
|
7
|
+
</tr>
|
8
|
+
</thead>
|
9
|
+
<tbody>
|
10
|
+
<%- @records.each do |record| %>
|
11
|
+
<tr>
|
12
|
+
<td>
|
13
|
+
<%= link_to "Edit", [:edit, record], :class => "btn btn-mini" %>
|
14
|
+
</td>
|
15
|
+
<%- readable_attributes.map(&:to_sym).each do |attribute| %>
|
16
|
+
<td><%= record[attribute] %></td>
|
17
|
+
<% end -%>
|
18
|
+
</tr>
|
19
|
+
<% end -%>
|
20
|
+
</tbody>
|
21
|
+
</table>
|
@@ -0,0 +1 @@
|
|
1
|
+
<% content_for :title, "New #{klass_name}" %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= f.inputs do %>
|
2
|
+
<%= f.input :content, :as => :text, :input_html => { :class => "span12", :id => "template_content-#{f.object.id || 'new'}" }, :hint => "Use markdown syntax for formatting. You can also use HTML directly. <a href=\"#{guide_path('markdown')}\" data-toggle=\"remote-load\" data-target=\"#content-guide\">See our markdown syntax reference</a>".html_safe %>
|
3
|
+
<div id="template_content_editor-<%= f.object.id || 'new' %>" class="template_content_editor"></div>
|
4
|
+
<div id="content-guide"></div>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<% content_for :javascript do %>
|
8
|
+
<%= javascript_tag do %>
|
9
|
+
var editor = ace_edit('<%= f.object.id || 'new' %>', 'markdown');
|
10
|
+
editor.renderer.setShowGutter(false);
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
@@ -0,0 +1,150 @@
|
|
1
|
+
<% content_for :top_content do %>
|
2
|
+
<header id="guideHeader">
|
3
|
+
<h1>Markdown Syntax Reference</h1>
|
4
|
+
<h2>Mini-Reference</h2>
|
5
|
+
</header>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<h3>Phrase Emphasis</h3>
|
9
|
+
|
10
|
+
<pre><code>*italic* **bold**
|
11
|
+
_italic_ __bold__
|
12
|
+
</code></pre>
|
13
|
+
|
14
|
+
<h3>Links</h3>
|
15
|
+
|
16
|
+
<p>Inline:</p>
|
17
|
+
|
18
|
+
<pre><code>An [example](http://url.com/ "Title")
|
19
|
+
</code></pre>
|
20
|
+
|
21
|
+
<p>Reference-style labels (titles are optional):</p>
|
22
|
+
|
23
|
+
<pre><code>An [example][id]. Then, anywhere
|
24
|
+
else in the doc, define the link:
|
25
|
+
|
26
|
+
[id]: http://example.com/ "Title"
|
27
|
+
</code></pre>
|
28
|
+
|
29
|
+
<h3>Images</h3>
|
30
|
+
|
31
|
+
<p>Inline (titles are optional):</p>
|
32
|
+
|
33
|
+
<pre><code>
|
34
|
+
</code></pre>
|
35
|
+
|
36
|
+
<p>Reference-style:</p>
|
37
|
+
|
38
|
+
<pre><code>![alt text][id]
|
39
|
+
|
40
|
+
[id]: /url/to/img.jpg "Title"
|
41
|
+
</code></pre>
|
42
|
+
|
43
|
+
<h3>Headers</h3>
|
44
|
+
|
45
|
+
<p>Setext-style:</p>
|
46
|
+
|
47
|
+
<pre><code>Header 1
|
48
|
+
========
|
49
|
+
|
50
|
+
Header 2
|
51
|
+
--------
|
52
|
+
|
53
|
+
</code></pre>
|
54
|
+
|
55
|
+
<p>atx-style (closing #'s are optional):</p>
|
56
|
+
|
57
|
+
<pre><code># Header 1 #
|
58
|
+
|
59
|
+
|
60
|
+
</code></pre>
|
61
|
+
|
62
|
+
<h3>Lists</h3>
|
63
|
+
|
64
|
+
<p>Ordered, without paragraphs:</p>
|
65
|
+
|
66
|
+
<pre><code>1. Foo
|
67
|
+
2. Bar
|
68
|
+
</code></pre>
|
69
|
+
|
70
|
+
<p>Unordered, with paragraphs:</p>
|
71
|
+
|
72
|
+
<pre><code>* A list item.
|
73
|
+
|
74
|
+
With multiple paragraphs.
|
75
|
+
|
76
|
+
* Bar
|
77
|
+
</code></pre>
|
78
|
+
|
79
|
+
<p>You can nest them:</p>
|
80
|
+
|
81
|
+
<pre><code>* Abacus
|
82
|
+
* Ask
|
83
|
+
* Balthazar
|
84
|
+
1. Beethoven
|
85
|
+
2. bupkis
|
86
|
+
* BELITTLER
|
87
|
+
3. burper
|
88
|
+
* Cunning
|
89
|
+
</code></pre>
|
90
|
+
|
91
|
+
<h3>Blockquotes</h3>
|
92
|
+
|
93
|
+
<pre><code>> Email-style angle brackets
|
94
|
+
|
95
|
+
> are used for blockquotes.
|
96
|
+
|
97
|
+
> > And, they can be nested.
|
98
|
+
|
99
|
+
> >
|
100
|
+
> * You can quote a list.
|
101
|
+
> * Etc.
|
102
|
+
</code></pre>
|
103
|
+
|
104
|
+
<h3>Code Spans</h3>
|
105
|
+
|
106
|
+
<pre><code>`<code>` spans are delimited
|
107
|
+
by backticks.
|
108
|
+
|
109
|
+
You can include literal backticks
|
110
|
+
like `` `this` ``.
|
111
|
+
</code></pre>
|
112
|
+
|
113
|
+
<h3>Preformatted Code Blocks</h3>
|
114
|
+
|
115
|
+
<p>Indent every line of a code block by at least 4 spaces or 1 tab, and use a colon at the end of the preceding paragraph.</p>
|
116
|
+
|
117
|
+
<pre><code>This is a normal paragraph:
|
118
|
+
|
119
|
+
This is a preformatted
|
120
|
+
code block.
|
121
|
+
|
122
|
+
Preceded by a space, the colon
|
123
|
+
disappears. :
|
124
|
+
|
125
|
+
This is a preformatted
|
126
|
+
code block.
|
127
|
+
</code></pre>
|
128
|
+
|
129
|
+
<h3>Horizontal Rules</h3>
|
130
|
+
|
131
|
+
<p>Three or more dashes or asterisks:</p>
|
132
|
+
|
133
|
+
<pre><code>---
|
134
|
+
|
135
|
+
* * *
|
136
|
+
|
137
|
+
- - - -
|
138
|
+
</code></pre>
|
139
|
+
|
140
|
+
<h3>Manual Line Breaks</h3>
|
141
|
+
|
142
|
+
<p>End a line with two or more spaces:</p>
|
143
|
+
|
144
|
+
<pre><code>Roses are red,
|
145
|
+
Violets are blue.
|
146
|
+
</code></pre>
|
147
|
+
|
148
|
+
<div class="footer">
|
149
|
+
<input type="button" class="button" value="Close This Guide" data-dismiss="remote-load">
|
150
|
+
</div>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<%= f.inputs do %>
|
2
|
+
<%= f.input :asset, :collection => Smithy::Asset.order(:name) %>
|
3
|
+
<%= f.input :alternate_text %>
|
4
|
+
<% end %>
|
5
|
+
<%= f.inputs "Content (optional)" do %>
|
6
|
+
<%= f.input :content, :as => :text, :input_html => { :class => "span12", :id => "image_content-#{f.object.id || 'new'}" }, :hint => "Use markdown syntax for formatting. You can also use HTML directly. <a href=\"#{guide_path('markdown')}\" data-toggle=\"remote-load\" data-target=\"#content-guide\">See our markdown syntax reference</a>".html_safe %>
|
7
|
+
<div id="image_content_editor-<%= f.object.id || 'new' %>" class="image_content_editor"></div>
|
8
|
+
<div id="content-guide"></div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<% content_for :javascript do %>
|
12
|
+
<%= javascript_tag do %>
|
13
|
+
var editor = ace_edit('<%= f.object.id || 'new' %>', 'markdown');
|
14
|
+
editor.renderer.setShowGutter(false);
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= f.inputs "Image Sizing (optional)" do %>
|
19
|
+
<%= f.input :width %>
|
20
|
+
<%= f.input :height %>
|
21
|
+
<%= f.input :image_scaling, :as => :select, :collection => Smithy::Image.image_scaling_options %>
|
22
|
+
<% end %>
|
23
|
+
<%= f.inputs "Linked Image (optional)" do %>
|
24
|
+
<%= f.input :link_url %>
|
25
|
+
<% end %>
|
26
|
+
<%= f.inputs "HTML Attributes (optional)" do %>
|
27
|
+
<%= f.input :html_attributes %>
|
28
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% content_for :title, "Page Content" %>
|
2
|
+
|
3
|
+
<%= semantic_form_for [@page, @page_content], :url => page_content_path(@page.id, @page_content) do |f| %>
|
4
|
+
<%= f.inputs "Editing #{@page_content.container.titleize} on “#{@page.title}”" do %>
|
5
|
+
<%= f.input :label, :hint => "Internal CMS usage only" %>
|
6
|
+
<%= f.input :container, :as => :hidden %>
|
7
|
+
<%= f.input :content_block_type, :as => :hidden %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="well">
|
11
|
+
<%= f.input :content_block_template, :collection => @page_content.templates, :include_blank => false %>
|
12
|
+
<%= f.semantic_fields_for(:content_block) do |builder| %>
|
13
|
+
<%= render :partial => "#{@page_content.content_block_type.underscore.pluralize}/form_fields", :locals => { :f => builder } %>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<%= f.actions :submit %>
|
18
|
+
<% end %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<% content_for :title, "Page Content" %>
|
2
|
+
|
3
|
+
<%= semantic_form_for [@page, @page_content], :url => page_contents_path(@page.id), :html => { :class => 'form-horizontal' } do |f| %>
|
4
|
+
<%= f.inputs "Adding to #{@page_content.container.titleize} on “#{@page.title}”" do %>
|
5
|
+
<%= f.input :label, :hint => "Please enter a label for your content (internal CMS usage only)" %>
|
6
|
+
<%= f.input :container, :as => :hidden %>
|
7
|
+
<%= f.input :content_block_type, :as => :hidden %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= f.inputs "Choose a Content Block" do %>
|
11
|
+
<table class="table table-bordered table-striped">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th>Type</th>
|
15
|
+
<th>Description</th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<% @content_blocks.each do |content_block| %>
|
20
|
+
<tr>
|
21
|
+
<td><button class="btn btn-small page_content_block" type="button" data-content_block="<%= content_block.name %>"><%= content_block.name.capitalize %></button></td>
|
22
|
+
<td><%= content_block.description %></td>
|
23
|
+
</tr>
|
24
|
+
<% end %>
|
25
|
+
</tbody>
|
26
|
+
</table>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<%= f.inputs do %>
|
2
|
+
<%= f.input :count, :label => "Limit number of pages to", :hint => "Leave blank for all pages" %>
|
3
|
+
<%= f.input :page_template_id, :label => "Only show these page types", :as => :select, :collection => Smithy::Template.templates.map{|t| [t.name, t.id] } %>
|
4
|
+
<%= f.input :parent_id, :label => "Show pages below", :as => :select, :collection => tree_for_select, :include_blank => false %>
|
5
|
+
<%= f.input :sort, :label => 'Pages should appear in this order', :as => :select, :collection => Smithy::PageList.sort_options, :include_blank => false %>
|
6
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="well">
|
2
|
+
<%= f.inputs container.display_name do %>
|
3
|
+
<table class="table table-striped page-contents" data-reorder-href="<%= order_page_contents_path(@page.id) %>">
|
4
|
+
<% @page.contents.for_container(container.name).each do |page_content| %>
|
5
|
+
<%= content_tag_for :tr, page_content do %>
|
6
|
+
<td>
|
7
|
+
<i class="icon-reorder handle"></i>
|
8
|
+
<%= link_to "edit", edit_page_content_path(@page.id, page_content), :class => "btn btn-small btn-primary" %>
|
9
|
+
</td>
|
10
|
+
<td><strong><%= page_content.label %></strong></td>
|
11
|
+
<td><%= page_content.content_block_type.demodulize %></td>
|
12
|
+
<td><%= page_content.updated_at.strftime('%b %e, %Y %H:%M:%S') %></td>
|
13
|
+
<td>
|
14
|
+
<div class="pull-right">
|
15
|
+
<%= link_to "preview", preview_page_content_path(@page.id, page_content), :class => "btn btn-small", "data-previewtoggle" => "modal" %>
|
16
|
+
<%= link_to "<i class=\"icon-trash\"></i> delete".html_safe, page_content_path(@page.id, page_content), :method => :delete, :confirm => "Do you really want to delete this content?", :class => "btn btn-small btn-danger" %>
|
17
|
+
</div>
|
18
|
+
</td>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
<div><%= link_to "Add to #{container.display_name}", new_page_content_path(@page.id, :page_content => { :container => container.name }), :class => "btn btn-primary btn-small" %></div>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<% content_for :top_content do %>
|
2
|
+
<% unless @page.root? %>
|
3
|
+
<ul class="breadcrumb">
|
4
|
+
<%- breadcrumbs = @page.persisted? ? @page.ancestors : @parent.self_and_ancestors -%>
|
5
|
+
<% breadcrumbs.each do |p| %>
|
6
|
+
<li>
|
7
|
+
<%= @page == p ? p.title : link_to(p.title, edit_page_path(p.id)) %>
|
8
|
+
<%= content_tag :span, :class => 'divider' do %>/<% end %>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
<%= content_tag(:li, @page.title) if @page.persisted? %>
|
12
|
+
</ul>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= semantic_form_for @page, :url => ( @page.persisted? ? page_path(@page.id) : pages_path ), :html => { :class => 'form-horizontal' } do |f| %>
|
17
|
+
<%= f.inputs "Page Information" do %>
|
18
|
+
<%= f.input :title %>
|
19
|
+
<%= f.input :permalink, :hint => "This will be auto-created if blank. Only fill it in if you know what you're doing" %>
|
20
|
+
<%= f.input :parent, :include_blank => false, :collection => tree_for_select unless !@page.parent_id? %>
|
21
|
+
<%= f.input :show_in_navigation, :label => "Show page in site navigation" %>
|
22
|
+
<%= f.input :template, :collection => Smithy::Template.templates, :include_blank => false %>
|
23
|
+
<% end %>
|
24
|
+
<% if @page.persisted? && @page.external_link.blank? %>
|
25
|
+
<h3>Content</h3>
|
26
|
+
<%= render :partial => "container", :collection => @page.containers, :locals => { :f => f } %>
|
27
|
+
<% elsif @page.external_link? %>
|
28
|
+
<%= f.inputs "Redirect" do %>
|
29
|
+
<%= f.input :external_link, :hint => "This page is currently being redirected to #{link_to @page.external_link, @page.external_link}".html_safe %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
<h3 data-toggle="collapse" data-target="#page-meta">Meta <i class="icon-caret-down"></i></h3>
|
33
|
+
<%= content_tag :div, :id => "page-meta", :class => "collapse" do %>
|
34
|
+
<%= f.inputs do %>
|
35
|
+
<%= f.input(:external_link) unless @page.external_link? %>
|
36
|
+
<%= f.input :cache_length, :hint => "In seconds (eg. 600 is 10 minutes)" %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
<h3 data-toggle="collapse" data-target="#page-seo">SEO <i class="icon-caret-down"></i></h3>
|
40
|
+
<%= content_tag :div, :id => "page-seo", :class => "collapse" do %>
|
41
|
+
<%= f.inputs do %>
|
42
|
+
<%= f.input :browser_title %>
|
43
|
+
<%= f.input :keywords %>
|
44
|
+
<%= f.input :description %>
|
45
|
+
<% end %>
|
46
|
+
<% end %>
|
47
|
+
|
48
|
+
<%= f.actions do %>
|
49
|
+
<% if @page.published? %>
|
50
|
+
<%= f.action :submit, :label => "Save and Publish", :button_html => { :name => "publish" } %>
|
51
|
+
<%= f.action :submit, :label => "Save as Draft", :button_html => { :name => "draft" } %>
|
52
|
+
<% else %>
|
53
|
+
<%= f.action :submit, :label => "Save as Draft", :button_html => { :name => "draft" } %>
|
54
|
+
<%= f.action :submit, :label => "Save and Publish", :button_html => { :name => "publish" } %>
|
55
|
+
<% end %>
|
56
|
+
<% end %>
|
57
|
+
<% end %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<%= content_tag :li, :id => dom_id(page), :class => ["clearfix child", (params[:id].to_i == page.id ? "active" : nil)].compact.join(' ') do %>
|
2
|
+
<%= link_to "<i class=\"icon-#{ page.leaf? ? (page.published? ? 'file' : 'edit') : 'folder-close'}\"></i><span>#{page.title}</span>".html_safe, edit_page_path(page.id), :class => "edit-page" %>
|
3
|
+
<%#= raw '<i class="icon-caret-right pull-right"></i>' unless page.leaf? %>
|
4
|
+
<%= link_to "<i class=\"icon-plus\"></i>".html_safe, new_page_path(:page => {:parent_id => page.id}), :class => "add-page" %>
|
5
|
+
<i class="icon-reorder handle"></i>
|
6
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% content_for :related do %>
|
2
|
+
<h4>Page Meta</h4>
|
3
|
+
<div class="well well-small">
|
4
|
+
<dl>
|
5
|
+
<dt>Status</dt>
|
6
|
+
<dd><%= raw @page.published_at? ? '<i class="icon-check"></i>' : '<i class="icon-check-empty"></i>' %> Published</dd>
|
7
|
+
<dt>Navigation</dt>
|
8
|
+
<dd><%= raw @page.show_in_navigation? ? '<i class="icon-check"></i>' : '<i class="icon-check-empty"></i>' %> Show in Navigation</dd>
|
9
|
+
<dt>Template</dt>
|
10
|
+
<dd><%= @page.template.name %></dd>
|
11
|
+
<dt>Creator</dt>
|
12
|
+
<dd><%= "Tim Glen" %></dd>
|
13
|
+
<% if @page.persisted? %>
|
14
|
+
<dt>Updated</dt>
|
15
|
+
<dd><%= time_ago_in_words @page.updated_at %> ago</dd>
|
16
|
+
<% end %>
|
17
|
+
</dl>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<%= content_tag :p, link_to("Delete Page", page_path(@page.id), :method => :delete, :confirm => "Are you sure you want to delete this page?", :class => 'btn btn-danger') if @page.persisted? %></p>
|
21
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<li class="back"><%= link_to "<span class=\"btn btn-mini btn-inverse\"><i class=\"icon-caret-left\"></i> Back to #{@parent.title}</span>".html_safe, edit_page_path(@parent.id) %></li>
|
2
|
+
<%- if !@page.persisted? || @page.leaf? -%>
|
3
|
+
<%= render @parent.children %>
|
4
|
+
<% elsif @page.persisted? %>
|
5
|
+
<li<%= ' class="active"'.html_safe if params[:id].to_i == @page.id %>><%= link_to "<i class=\"icon-folder-close\"></i> #{@page.title}".html_safe, edit_page_path(@page.id) %></li>
|
6
|
+
<%= render @page.children %>
|
7
|
+
<% end %>
|
8
|
+
<% if @page.persisted? %>
|
9
|
+
<li class="add-page"><%= link_to "<i class=\"icon-plus\"></i> Add Page".html_safe, new_page_path(:page => { :parent_id => @parent.id }) %></li>
|
10
|
+
<% end %>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<%= content_tag :li, :id => dom_id(@root), :class => ['home', "clearfix", (params[:id].to_i == @root.id ? "active" : nil)].join(' ') do %>
|
2
|
+
<%= link_to "<i class=\"icon-home\"></i> #{@root.title}".html_safe, edit_page_path(@root.id) %>
|
3
|
+
<% end %>
|
4
|
+
<%= render @root.children %>
|
5
|
+
<li class="add-page"><%= link_to "<i class=\"icon-plus\"></i> Add Page".html_safe, new_page_path(:page => { :parent_id => @root.id }) %></li>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% content_for :title, "Site Content" %>
|
2
|
+
|
3
|
+
<div class="hero-unit">
|
4
|
+
<%- if @root.blank? -%>
|
5
|
+
<p>Be the first to add a Page to your site. Pages are the building blocks for your site. A page's look and feel is defined by the templates that you choose for it.</p>
|
6
|
+
<% else %>
|
7
|
+
<p>Add a page or select one from your left to edit.</p>
|
8
|
+
<% end %>
|
9
|
+
<p>
|
10
|
+
<%= link_to "Add Page", new_page_path, :class => 'btn btn-primary btn-large' %>
|
11
|
+
</p>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<%= render :partial => "page_nav" %>
|
15
|
+
|
16
|
+
<% content_for :related do %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<h1>Settings</h1>
|
2
|
+
<div class="hero-unit">
|
3
|
+
<p>The settings in your application can affect various preferences in your website, from the title of your website to the type of editing experience you want to have.</p>
|
4
|
+
<p>
|
5
|
+
<%= link_to "Add Settings", new_setting_path, :class => 'btn btn-primary btn-large' %>
|
6
|
+
</p>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<%= render @settings %>
|