tb_cms 1.1.5 → 1.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8489bda6705051746c0d9bfc282aa87958d6b94e
4
- data.tar.gz: b5d332e0e887e04ec5ce00b1f6d19d20e8768ea5
3
+ metadata.gz: 6d493436489707a83b24c42f45f4c28da810f6eb
4
+ data.tar.gz: 0b85e51660ae264c80f50e063fa2ebca8538cf02
5
5
  SHA512:
6
- metadata.gz: 2e3b9246f237eabdb5465c408b0c8635c18733bf388fcc574da2faaaba2ec4d1f0fa206c1c5ab27b212b09684d76d4e5e4fc9d6bfb08f8cabd07bcd2ab4294e1
7
- data.tar.gz: dce96636d73c406842425ec2a3905b68b92a0d005c21bb2468d2ad7a9a85fe53d816b545e4fe1af01d2539a16e0b142fc72496790eb7cac9b75208cef96b803e
6
+ metadata.gz: 9106c75d5cd3f91334426eb8dd51e4006bb9cfbe04d6b8c5d1a8569e76537e2302361bc9dcf396ce0976045712ca4b58ac0f01f50604b4d9d22c44eda5295d64
7
+ data.tar.gz: 89588fb1c7d5ccf19e299ea1b6c076e41564a45a0268781df4b124d3d1085f89459100dab67752cba18f5dd55e24cf7011b68b59480c81a540f122dc2840dd84
@@ -1,25 +0,0 @@
1
-
2
- .menu_list {
3
- list-style-type:none;
4
- }
5
- .page_row {
6
- background:white;
7
- }
8
- .menu_edit .subitem {
9
-
10
- min-height:10px;
11
- /*padding-bottom:12px;*/
12
- }
13
-
14
- .subitem .page_row {
15
-
16
- border-left:2px solid #999;
17
- }
18
- .left_guide.subitem .page_row {
19
- border:none;
20
- }
21
-
22
- .ui-sortable-placeholder {
23
- background:#FAE7D9 !important;
24
- visibility:visible !important;
25
- }
@@ -4,14 +4,11 @@ class Admin::PagesController < Admin::ApplicationController
4
4
  before_filter :load_page,:only => [:edit,:update,:show,:destroy]
5
5
 
6
6
  def index
7
-
8
- @pages = SpudPage.site(session[:admin_site]).where(:spud_page_id => nil).order(:page_order).includes(:spud_pages).paginate :page => params[:page]
9
-
7
+ @pages = SpudPage.site(session[:admin_site]).where(:spud_page_id => nil).order(:page_order).includes(:spud_pages)
10
8
  home_page = SpudPage.where(:url_name => Spud::Cms.root_page_name).first
11
9
  if home_page.blank?
12
10
  flash.now[:warning] = "You have not setup your default CMS page. This page will be your homepage. To do so, create a page with the name '#{Spud::Cms.root_page_name.titlecase}'"
13
11
  end
14
-
15
12
  respond_with @pages
16
13
  end
17
14
 
@@ -48,8 +45,7 @@ class Admin::PagesController < Admin::ApplicationController
48
45
  end
49
46
 
50
47
  def edit
51
- add_breadcrumb "#{@page.name}", :admin_page_path
52
- add_breadcrumb "Edit", :edit_admin_page_path
48
+ add_breadcrumb @page.name, :edit_admin_page_path
53
49
 
54
50
  layouts = Spud::Cms::Engine.template_parser.layouts(Spud::Core.site_config_for_id(session[:admin_site] || 0)[:short_name])
55
51
  layout, layout_info = layouts.select{|k,v| k == @page.layout}.flatten if @page.layout.blank? == false
@@ -1,6 +1,7 @@
1
1
  class SpudMenu < ActiveRecord::Base
2
2
  validates :name,:presence => true
3
3
  validates_uniqueness_of :name, :scope => [:site_id]
4
+
4
5
  has_many :spud_menu_items, :as => :parent, :dependent => :destroy
5
6
  has_many :spud_menu_items_combined, :class_name => "SpudMenuItem", :foreign_key => :spud_menu_id, :dependent => :destroy
6
7
 
@@ -4,7 +4,7 @@ class SpudPagePartial < ActiveRecord::Base
4
4
  validates :name,:presence => true
5
5
  before_save :maintain_revisions
6
6
  before_save :update_symbol_name
7
- acts_as_spud_liquid_content
7
+ acts_as_tb_liquid_content
8
8
 
9
9
  def update_symbol_name
10
10
  self.symbol_name = self.name.parameterize.underscore
@@ -5,7 +5,7 @@ class SpudSnippet < ActiveRecord::Base
5
5
 
6
6
  scope :site, lambda {|sid| where(:site_id => sid)}
7
7
 
8
- acts_as_spud_liquid_content
8
+ acts_as_tb_liquid_content
9
9
 
10
10
  def postprocess_content
11
11
  template = Liquid::Template.parse(self.content)
@@ -1,51 +1,50 @@
1
- <%=error_messages_for(f.object)%>
2
- <fieldset>
3
- <div class="control-group">
4
- <%=f.label :name, :required=>true,:class => "control-label"%>
5
- <div class="controls">
6
- <%=f.text_field :name,:title => "",:size=>40%>
7
- </div>
8
-
9
- </div>
10
- <div class="control-group">
1
+ <%= tb_form_errors(f.object)%>
11
2
 
12
- <%=f.label :menu_order, :required=>true,:class => "control-label"%>
13
- <div class="controls">
14
- <%=f.text_field :menu_order,:title => "",:size=>5%>
3
+ <div class="form-group">
4
+ <%= f.label :name, :required=>true, :class=>"col-sm-2 control-label" %>
5
+ <div class="col-sm-10">
6
+ <%= f.text_field :name, :title => "", :class=>"form-control" %>
15
7
  </div>
16
-
17
8
  </div>
18
- <div class="control-group">
19
- <%=f.label :spud_page_id, "Page",:class => "control-label"%>
20
- <div class="controls">
21
- <%=f.select :spud_page_id,options_for_select(SpudPage.options_tree_for_page(:site_id => session[:admin_site]),@menu_item.spud_page_id),{:include_blank => 'Use URL instead'},{:title => "",:onchange => "if($(this).val() != '') {$('#spud_menu_item_url').val('');}"}%>
9
+
10
+ <div class="form-group">
11
+ <%=f.label :menu_order, :required=>true,:class => "col-sm-2 control-label"%>
12
+ <div class="col-sm-10">
13
+ <%=f.text_field :menu_order, :title => "", :class=>'form-control'%>
22
14
  </div>
23
-
24
15
  </div>
25
16
 
17
+ <div class="form-group">
18
+ <%=f.label :spud_page_id, "Page", :class=>"col-sm-2 control-label"%>
19
+ <div class="col-sm-10">
20
+ <%= f.select :spud_page_id, options_for_select(SpudPage.options_tree_for_page(:site_id => session[:admin_site]), @menu_item.spud_page_id), {:include_blank => 'Use URL instead'}, {:class=>'form-control',:title => "", :onchange => "if($(this).val() != '') {$('#spud_menu_item_url').val('');}"}%>
21
+ </div>
22
+ </div>
26
23
 
27
-
28
- <div class="control-group">
29
- <%=f.label :url,:class => "control-label"%>
30
- <div class="controls">
31
- <%=f.text_field :url,:title => "",:size=>40%>
24
+ <div class="form-group">
25
+ <%=f.label :url, :class => "col-sm-2 control-label"%>
26
+ <div class="col-sm-10">
27
+ <%=f.text_field :url, :title => "", :class=>'form-control' %>
32
28
  </div>
33
29
  </div>
34
- <div class="control-group">
35
- <%=f.label :classes,:class => "control-label"%>
36
- <div class="controls">
37
- <%=f.text_field :classes,:title => "",:size=>40%>
30
+
31
+ <div class="form-group">
32
+ <%=f.label :classes, :class => "col-sm-2 control-label"%>
33
+ <div class="col-sm-10">
34
+ <%=f.text_field :classes, :title => "", :class=>'form-control'%>
38
35
  </div>
39
36
  </div>
40
- <div class="control-group">
41
- <%=f.label :parent, "Parent Menu",:class => "control-label"%>
42
- <div class="controls">
43
- <%=f.select :parent_id,options_for_select(SpudMenuItem.options_tree_for_item(@menu,:filter => @menu_item),@menu_item.parent_type == 'SpudMenuItem' ? @menu_item.parent_id : nil),{:include_blank => "#{@menu.name}"},{:title => ""}%>
37
+
38
+ <div class="form-group">
39
+ <%= f.label :parent, "Parent Menu", :class=>"col-sm-2 control-label" %>
40
+ <div class="col-sm-10">
41
+ <%=f.select :parent_id,options_for_select(SpudMenuItem.options_tree_for_item(@menu,:filter => @menu_item),@menu_item.parent_type == 'SpudMenuItem' ? @menu_item.parent_id : nil),{:include_blank => "#{@menu.name}"},{:class => 'form-control', :title => ""}%>
44
42
  </div>
45
-
46
43
  </div>
47
44
 
48
- </fieldset>
49
-
50
-
51
-
45
+ <div class="form-group">
46
+ <div class="col-sm-offset-2 col-sm-10">
47
+ <%= f.submit "Save Menu Item", :class => "btn btn-primary" %>
48
+ <%= link_to "Cancel", admin_menu_menu_items_path, :class => "btn btn-default" %>
49
+ </div>
50
+ </div>
@@ -1,22 +1,14 @@
1
- <div class="page_row" menu_item_id="<%=menu_item.id%>">
2
-
3
- <span class="row_meta"><%=prefix if defined? prefix%><%=link_to menu_item.name,edit_admin_menu_menu_item_path(:id => menu_item.id)%></span>
4
-
5
- <span class="edit_controls"><%=link_to "Edit",edit_admin_menu_menu_item_path(:id => menu_item.id), :title => "Edit Menu Item",:class => 'btn'%>&nbsp;&nbsp;<%=link_to "Remove",admin_menu_menu_item_path(:id => menu_item.id),:method => :delete,:class => 'btn btn-danger', :data => {:confirm => "Are you sure you want to remove this menu item?"}%></span>
6
- <br style="clear:both;"/>
7
- </div>
8
- <ul class="menu_list subitem sortable connectedSortable">
9
-
10
- <% if menu_item.spud_menu_items.length > 0 %>
11
-
12
-
13
- <%menu_item.spud_menu_items.order(:menu_order).each do |menu_item|%>
14
- <li>
15
- <%=render :partial => 'menu_item_row',:locals => {:menu_item => menu_item}%>
16
- </li>
17
- <%end%>
18
-
19
-
20
-
21
- <%end%>
22
- </ul>
1
+ <tr>
2
+ <td>
3
+ <%= table_nesting_indicator(depth) %>
4
+ <%= menu_item.name %>
5
+ </td>
6
+ <td><%= link_to menu_item.get_url, menu_item.get_url %></td>
7
+ <td class="table-actions">
8
+ <%=link_to 'Edit', edit_admin_menu_menu_item_path(:id => menu_item.id), :title => "Edit Menu Item", :class => 'btn btn-default btn-sm' %>
9
+ <%=link_to 'Delete', admin_menu_menu_item_path(:id => menu_item.id), :method => :delete, :class => 'btn btn-danger btn-sm', :data => {:confirm => "Are you sure you want to remove this menu item?"} %>
10
+ </td>
11
+ </tr>
12
+ <% menu_item.spud_menu_items.each do |item| %>
13
+ <%= render :partial => 'menu_item_row', :locals => {:menu_item => item, :depth => depth+1} %>
14
+ <% end %>
@@ -1,10 +1,3 @@
1
-
2
-
3
-
4
- <%=form_for @menu_item,:url => admin_menu_menu_item_path(:id => @menu_item.id),:html=>{:class=>"form-horizontal"} do |f|%>
5
- <%=render :partial => "form",:locals => {:f => f}%>
6
- <div class="form-actions">
7
- <%=f.submit "Save Menu Item", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menu_menu_items_path,:class => "btn"%>
8
- </div>
9
- <%end%>
10
-
1
+ <%= form_for @menu_item, :url => admin_menu_menu_item_path(:id => @menu_item.id), :html => {:class=>"form-horizontal"} do |f| %>
2
+ <% render :partial => "form",:locals => {:f => f}%>
3
+ <% end %>
@@ -1,17 +1,27 @@
1
- <%=content_for :data_controls do%>
2
- <%=link_to "New Menu Item",new_admin_menu_menu_item_path(),:class => "btn btn-primary",:title => "New Menu Item"%>
3
- <%end%>
4
- <%=content_for :detail do%>
5
- <ul id="root_menu_list" class="menu_list page_list sortable connectedSortable">
6
- <%@menu_items.each do |menu_item|%>
7
- <li>
8
- <%=render :partial => "menu_item_row",:locals => {:menu_item => menu_item}%>
9
- </li>
10
- <%end%>
1
+ <% content_for :data_controls do %>
2
+ <%= link_to "New Menu Item", new_admin_menu_menu_item_path(), :class => "btn btn-primary", :title => "New Menu Item" %>
3
+ <% end %>
11
4
 
12
- </ul>
5
+ <% content_for :detail do %>
6
+ <div class="table-responsive">
7
+ <table class="table table-striped table-hover">
8
+ <thead>
9
+ <tr>
10
+ <th>Name</th>
11
+ <th>URL</th>
12
+ <th>&nbsp;</th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <% @menu_items.each do |item| %>
17
+ <%= render :partial => 'menu_item_row', :locals => {:menu_item => item, :depth => 0} %>
18
+ <% end %>
19
+ </tbody>
20
+ </table>
21
+ </div>
13
22
 
14
23
  <script type="text/javascript">
15
- $(document).ready(function() { spud.admin.cms.menu_items.init();})
24
+ $(document).ready(function() { spud.admin.cms.menu_items.init();})
16
25
  </script>
17
- <%end%>
26
+
27
+ <% end %>
@@ -1,12 +1,3 @@
1
-
2
-
3
-
4
- <%=form_for @menu_item,:url => admin_menu_menu_items_path,:html=>{:class=>"form-horizontal"} do |f|%>
5
- <%=render :partial => "form",:locals => {:f => f}%>
6
- <div class="form-actions">
7
- <%=f.submit "Create Menu Item", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menu_menu_items_path,:class => "btn"%>
8
- </div>
9
- <%end%>
10
-
11
-
12
-
1
+ <%= form_for @menu_item, :url => admin_menu_menu_items_path, :html => {:class=>"form-horizontal"} do |f| %>
2
+ <%= render :partial => "form",:locals => {:f => f} %>
3
+ <% end %>
@@ -1,11 +1,15 @@
1
- <%=error_messages_for(f.object)%>
2
- <fieldset>
3
- <div class="control-group">
4
- <%=f.label :name, :required=>true,:class => "control-label"%>
5
- <div class="controls">
6
- <%=f.text_field :name,:title => "",:size=>40%>
7
- </div>
1
+ <%=tb_form_errors(f.object)%>
8
2
 
3
+ <div class="form-group">
4
+ <%= f.label :name, nil, :class=>"col-sm-2 control-label" %>
5
+ <div class="col-sm-10">
6
+ <%= f.text_field :name, :class => "form-control" %>
7
+ </div>
9
8
  </div>
10
- </fieldset>
11
9
 
10
+ <div class="form-group">
11
+ <div class="col-sm-offset-2 col-sm-10">
12
+ <%= f.submit "Save Menu", :class => "btn btn-primary" %>
13
+ <%= link_to "Cancel", admin_menus_path, :class => "btn btn-default" %>
14
+ </div>
15
+ </div>
@@ -1,13 +1,3 @@
1
-
2
-
3
-
4
- <%=form_for @menu,:url => admin_menu_path(:id => @menu.id),:html=>{:class=>"form-horizontal"} do |f|%>
5
- <%=render :partial => "form",:locals => {:f => f}%>
6
- <div class="form-actions">
7
- <%=f.submit "Save Menu", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menus_path,:class => "btn"%>
8
- </div>
9
-
10
- <%end%>
11
-
12
-
13
-
1
+ <%=form_for @menu,:url => admin_menu_path(:id => @menu.id),:html=>{:class=>"form-horizontal"} do |f|%>
2
+ <%= render :partial => "form",:locals => {:f => f} %>
3
+ <% end %>
@@ -1,21 +1,31 @@
1
1
  <% content_for :data_controls do%>
2
- <%= link_to "New Menu",new_admin_menu_path(),:class => "btn btn-primary",:title => "New Menu" %>
2
+ <%= link_to "New Menu", new_admin_menu_path(), :class => "btn btn-primary", :title => "New Menu" %>
3
3
  <% end %>
4
- <%=content_for :detail do%>
5
- <div class="page_list">
6
- <%@menus.each do |menu|%>
7
- <div class="page_row">
8
-
9
- <span class="row_meta"><%=link_to menu.name,admin_menu_menu_items_path(:menu_id => menu.id)%></span>
10
4
 
11
- <span class="edit_controls">
12
- <%=link_to "Edit",edit_admin_menu_path(:id => menu.id),:class => 'btn'%>
13
- <%=link_to 'Items', admin_menu_menu_items_path(:menu_id => menu.id), :class => 'btn' %>
14
- <%=link_to "Remove",admin_menu_path(:id => menu.id),:method => :delete,:class => 'btn btn-danger', :data => {:confirm => "Are you sure you want to remove this menu and all items associated with it?"}%>
15
- </span>
16
- <br style="clear:both;"/>
17
- </div>
18
- <%end%>
19
- <%=will_paginate @menus%>
20
- </div>
21
- <%end%>
5
+ <% content_for :detail do %>
6
+ <div class="table-responsive">
7
+ <table class="table table-striped table-hover">
8
+ <thead>
9
+ <tr>
10
+ <th>Name</th>
11
+ <th># Items</th>
12
+ <th>&nbsp;</th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <% @menus.each do |menu| %>
17
+ <tr>
18
+ <td><%= menu.name %></td>
19
+ <td><%= menu.spud_menu_items.count %></td>
20
+ <td class="table-actions">
21
+ <%= link_to 'Items', admin_menu_menu_items_path(:menu_id => menu.id), :class => 'btn btn-default btn-sm' %>
22
+ <%= link_to 'Edit', edit_admin_menu_path(:id => menu.id), :class => 'btn btn-default btn-sm' %>
23
+ <%= link_to 'Delete', admin_menu_path(:id => menu.id), :method => :delete, :data => {:confirm => 'Are you sure?"'}, :class => 'btn btn-danger btn-sm' %>
24
+ </td>
25
+ </tr>
26
+ <% end %>
27
+ </tbody>
28
+ </table>
29
+ </div>
30
+ <%= will_paginate @menus, :renderer => BootstrapPagination::Rails %>
31
+ <% end %>
@@ -1,7 +1,3 @@
1
- <%=form_for @menu,:url => admin_menus_path,:html=>{:class=>"form-horizontal"} do |f|%>
2
- <%=render :partial => "form",:locals => {:f => f}%>
3
- <div class="form-actions">
4
- <%=f.submit "Create Menu", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menus_path,:class => "btn"%>
5
- </div>
6
-
7
- <%end%>
1
+ <%= form_for @menu,:url => admin_menus_path,:html=>{:class=>"form-horizontal"} do |f| %>
2
+ <%= render :partial => "form",:locals => {:f => f} %>
3
+ <% end %>
@@ -1,97 +1,97 @@
1
- <%=error_messages_for(f.object)%>
2
- <fieldset>
3
- <div class="control-group">
4
- <legend>Page Title</legend>
5
- <%=f.label :name, :required=>true,:style =>"display:none;", :class=>"control-label"%>
1
+ <%= tb_form_errors(f.object) %>
6
2
 
7
- <%=f.text_field :name, :class => "full-width"%>
3
+ <h4>Page Title</h4>
8
4
 
5
+ <div class="form-group">
6
+ <%= f.label :name, :required => true, :style =>"display:none;", :class=>"form-label" %>
7
+ <div class="col-lg-12">
8
+ <%= f.text_field :name, :class => "form-control" %>
9
9
  </div>
10
- </fieldset>
10
+ </div>
11
+
12
+ <h4>Page Content</h4>
13
+
11
14
  <div id="page_partials_form" class="formtabs tab-content">
12
15
  <ul class="formtab_buttons nav nav-tabs">
13
16
  </ul>
14
17
  <%= f.fields_for :spud_page_partials do |b| %>
15
18
  <div class="formtab tab-pane">
16
- <%= b.hidden_field :name,:class => "tab_name" %>
17
- <%= b.text_area :content,:class => "tinymce" %>
19
+ <%= b.hidden_field :name, :class => "tab_name" %>
20
+ <%= b.text_area :content, :class => "tinymce" %>
18
21
  </div>
19
22
  <% end %>
20
23
  </div>
21
- <br />
22
- <fieldset>
23
- <legend>Advanced Settings (optional)</legend>
24
24
 
25
- <div class="control-group">
25
+ <h4>Advanced Settings</h4>
26
26
 
27
- <%=f.label :layout, "Template", :class=>"control-label"%>
28
- <div class="controls">
29
- <%=f.select :layout, options_for_select(layout_options,@page.layout),{},{:title => "", 'data-source' => page_parts_admin_pages_path(:page => @page.id) }%>
30
- <span class="help-inline">Use this to control the layout template to be used for this page if they are available.</span>
31
- </div>
32
- </div>
27
+ <div class="form-group">
28
+ <%= f.label :layout, "Template", :class=>"col-lg-2 control-label"%>
29
+ <div class="col-lg-10">
30
+ <%= f.select :layout, options_for_select(layout_options,@page.layout),{},{:title => "", 'data-source' => page_parts_admin_pages_path(:page => @page.id), class: 'form-control' }%>
31
+ <span class="help-block">Use this to control the layout template to be used for this page if they are available.</span>
32
+ </div>
33
+ </div>
33
34
 
34
- <div class="control-group">
35
+ <div class="form-group">
36
+ <%= f.label :spud_page_id, "Parent Page", :class=>"col-lg-2 control-label"%>
37
+ <div class="col-lg-10">
38
+ <%= f.select :spud_page_id,options_for_select(SpudPage.options_tree_for_page(:filter => @page,:site_id => session[:admin_site]),@page.spud_page_id),{:include_blank => 'None'},{:title => "", :class=>'form-control' }%>
39
+ </div>
40
+ </div>
35
41
 
36
- <%=f.label :spud_page_id, "Parent Page", :class=>"control-label"%>
37
- <div class="controls">
38
- <%=f.select :spud_page_id,options_for_select(SpudPage.options_tree_for_page(:filter => @page,:site_id => session[:admin_site]),@page.spud_page_id),{:include_blank => 'None'},{:title => ""}%>
42
+ <div class="form-group">
43
+ <%= f.label :url_name, "Perma Link",:disabled => true, :class=>"col-lg-2 control-label"%>
44
+ <div class="col-lg-10">
45
+ <%= root_url %>
46
+ <%= f.text_field :url_name, :title => "", :size=>20, :class=>'form-inline' %>
47
+ </div>
48
+ <div class="col-lg-10">
49
+ <%= f.check_box :use_custom_url_name, :onchange => "$('#spud_page_url_name').attr('disabled',!this.checked);" %>
50
+ <%= f.label :use_custom_url_name, 'Customize this pages url' %>
51
+ </div>
52
+ </div>
39
53
 
40
- </div>
41
- </div>
42
- <div class="control-group">
54
+ <h4>Meta Information</h4>
55
+ <p>These fields are used to notify search engines about important keywords and the appropriate description to display in a search result.</p>
43
56
 
44
- <%=f.label :url_name, "Perma Link",:disabled => true, :class=>"control-label"%>
45
- <div class="controls">
46
- <%=root_url%><%=f.text_field :url_name,:title => "",:size=>20%>
47
- <label class="checkbox inline">
48
- <%=f.check_box :use_custom_url_name,:onchange => "$('#spud_page_url_name').attr('disabled',!this.checked);"%>
49
- Customize this pages url
50
- </label>
51
- </div>
52
- </div>
57
+ <div class="form-group">
58
+ <%= f.label :meta_keywords, "Keywords", :class=>"col-lg-2 control-label" %>
59
+ <div class="col-lg-10">
60
+ <%= f.text_field :meta_keywords, :class=>"form-control" %>
61
+ <span class="help-block">A Comma seperated list of keywords for search engines. Keep it short (no more than 10 keywords)</span>
62
+ </div>
63
+ </div>
53
64
 
54
- </fieldset>
55
- <fieldset>
56
- <legend>Meta Information (optional)</legend>
57
- <p>These fields are used to notify search engines about important keywords and the appropriate description to display in a search result.</p>
65
+ <div class="form-group">
66
+ <%= f.label :meta_description, "Description", :class=>"col-lg-2 control-label" %>
67
+ <div class="col-lg-10">
68
+ <%= f.text_area :meta_description, :class=>"form-control", :rows=>3 %>
69
+ <span class="help-block">A short description of the page. This is what appears on a search engines search result page.</span>
70
+ </div>
71
+ </div>
72
+
73
+ <div class="form-group">
74
+ <%= f.label :visibility, :class=>"col-lg-2 control-label" %>
75
+ <div class="col-lg-10">
76
+ <%= f.select(:visibility, [["Public",0],["Private",1]], {}, {class: 'form-control'})%>
77
+ </div>
78
+ </div>
58
79
 
59
- <div class="control-group">
60
- <%=f.label :meta_keywords,"Keywords", :class=>"control-label"%>
61
- <div class="controls">
62
- <%=f.text_field :meta_keywords,:title => "",:style=>"width:600px;" %>
63
- <span class="help-inline">A Comma seperated list of keywords for search engines. Keep it short (no more than 10 keywords)</span>
64
- </div>
80
+ <div class="form-group">
81
+ <%= f.label :published, "Published", class: "col-lg-2 control-label" %>
82
+ <div class="col-lg-10">
83
+ <%= f.check_box :published %>
84
+ </div>
85
+ </div>
65
86
 
66
- </div>
67
- <div class="control-group">
68
- <%=f.label :meta_description,"Description", :class=>"control-label"%>
69
- <div class="controls">
70
- <%=f.text_area :meta_description,:style =>"width:600px;height:40px;"%>
71
- <span class="help-inline">A short description of the page. This is what appears on a search engines search result page.</span>
72
- </div>
73
- </div>
74
- <div class="control-group">
75
- <%=f.label :visibility, :class=>"control-label"%>
76
- <div class="controls">
77
- <%=f.select :visibility, [["Public",0],["Private",1]]%>
78
- </div>
79
- </div>
80
- <div class="control-group">
81
- <%=f.label :published, :class=>"control-label"%>
82
- <div class="controls">
83
- <%=f.check_box :published%>
84
- </div>
85
- </div>
86
- <div class="control-group">
87
- <%=f.label :notes,"Notes", :class=>"control-label"%>
88
- <div class="controls">
89
- <%=f.text_area :notes,:style =>"width:400px;height:40px;"%>
90
- <span class="help-inline">Have a note to make about this page while you work? Place it here for later.</span>
91
- </div>
92
- </div>
93
- <%= hidden_field_tag "preview", 0 %>
94
- </fieldset>
87
+ <div class="form-group">
88
+ <%= f.label :notes, "Notes", class: "col-lg-2 control-label" %>
89
+ <div class="col-lg-10">
90
+ <%= f.text_area :notes, :class=>"form-control", :rows=>2 %>
91
+ <span class="help-block">Have a note to make about this page while you work? Place it here for later.</span>
92
+ </div>
93
+ </div>
94
+ <%= hidden_field_tag "preview", 0 %>
95
95
 
96
96
  <script type="text/javascript">
97
97
  $(document).ready(spud.admin.cms.pages.edit);
@@ -1,18 +1,15 @@
1
- <div class="page_row">
2
- <span class="row_meta">
3
- <%=prefix if defined? prefix%><%=link_to page.name,edit_admin_page_path(:id => page.id)%>
4
- </span>
5
- <span class="edit_controls">
6
- <%=link_to "Preview",admin_page_path(:id => page.id), :title => "Preview",:class => 'btn btn-mini'%>
7
- <%=link_to "Remove",admin_page_path(:id => page.id),:method => :delete,:class => 'btn btn-mini btn-danger', :data =>{:confirm => "Are you sure you want to remove this page?"} %>
8
- </span>
9
- <br style="clear:both;"/>
10
- </div>
11
-
12
- <% if !page.spud_pages.load.blank? %>
13
- <div class="left_guide">
14
- <% page.spud_pages.each do |spud_page| %>
15
- <%= render :partial => 'page_row', :locals => {:page => spud_page} %>
16
- <%end%>
17
- </div>
1
+ <tr>
2
+ <td>
3
+ <%= table_nesting_indicator(depth) %>
4
+ <%= page.name %>
5
+ </td>
6
+ <td><%= link_to page_path(page.url_name), page_path(page.url_name) %></td>
7
+ <td class="table-actions">
8
+ <%= link_to 'View', page_path(page.url_name), :class => 'btn btn-default btn-sm' %>
9
+ <%= link_to 'Edit', edit_admin_page_path(page), :class => 'btn btn-default btn-sm' %>
10
+ <%= link_to 'Delete', admin_page_path(page), :method => :delete, :data => {:confirm => 'Are you sure?"'}, :class => 'btn btn-danger btn-sm' %>
11
+ </td>
12
+ </tr>
13
+ <% page.spud_pages.each do |page| %>
14
+ <%= render :partial => 'page_row', :locals => {:depth => depth+1, :page => page} %>
18
15
  <% end %>
@@ -1,7 +1,10 @@
1
- <%=form_for @page,:url => admin_page_path(:id => @page.id),:html=>{:class=>"form-horizontal page_form"} do |f|%>
2
- <%=render :partial => "form",:locals => {:f => f}%>
3
- <div class="form-actions">
4
- <%=f.submit "Save Page", :class=>"btn btn-primary btn-save" %>&nbsp;<%=f.submit "Preview", :class=>"btn btn-info btn-preview"%> or <%=link_to "cancel",admin_pages_path,:class => "btn"%>
1
+ <%= form_for @page,:url => admin_page_path(:id => @page.id),:html=>{:class=>"form-horizontal page_form"} do |f| %>
2
+ <%= render :partial => "form",:locals => {:f => f} %>
3
+ <div class="row">
4
+ <div class="col-lg-10 col-offset-2">
5
+ <%= f.submit "Save Page", :class => "btn btn-primary btn-save" %>
6
+ <%= f.submit "Preview", :class => "btn btn-info btn-preview" %> or
7
+ <%= link_to "cancel", admin_pages_path, :class => "btn btn-link" %>
8
+ </div>
5
9
  </div>
6
- <%end%>
7
- <br />
10
+ <% end %>
@@ -1,13 +1,22 @@
1
- <%=content_for :data_controls do%>
2
- <%=link_to "New Page",new_admin_page_path(),:class => "btn btn-primary",:title => "New Page"%>&nbsp;<%=link_to "Clear Cache",clear_admin_pages_path(),:class => "btn btn-warning",:title => "Clear Page Cache" if Spud::Cms.cache_mode %>
3
- <%end%>
1
+ <% content_for :data_controls do%>
2
+ <%=link_to "New Page",new_admin_page_path(),:class => "btn btn-primary",:title => "New Page"%>&nbsp;
3
+ <% end %>
4
4
 
5
- <%=content_for :detail do%>
6
- <div class="page_list">
7
- <%@pages.each do |page|%>
8
- <%=render :partial => "page_row",:locals => {:page => page}%>
9
- <%end%>
10
- <%=will_paginate @pages%>
11
- </div>
12
-
13
- <%end%>
5
+ <%= content_for :detail do %>
6
+ <div class="table-responsive">
7
+ <table class="table table-striped table-hover">
8
+ <thead>
9
+ <tr>
10
+ <th>Name</th>
11
+ <th>URL</th>
12
+ <th>&nbsp;</th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <% @pages.each do |page| %>
17
+ <%= render :partial => 'page_row', :locals => {:depth => 0, :page => page} %>
18
+ <% end %>
19
+ </tbody>
20
+ </table>
21
+ </div>
22
+ <% end %>
@@ -1,7 +1,9 @@
1
- <%=form_for @page,:url => admin_pages_path(),:html=>{:class=>"form-horizontal page_form"} do |f|%>
2
- <%=render :partial => "form",:locals => {:f => f}%>
3
- <div class="form-actions">
4
- <%=f.submit "Create Page", :class=>"btn btn-primary form-btn btn-save","data-loading-text"=>"Saving..."%>&nbsp;<%=f.submit "Preview", :class=>"btn btn-primary btn-preview"%> or <%=link_to "cancel",admin_pages_path,:class => "btn"%>
1
+ <%= form_for @page,:url => admin_pages_path(), :html => {:class => "form-horizontal page_form"} do |f| %>
2
+ <%= render :partial => "form",:locals => {:f => f} %>
3
+ <div class="row">
4
+ <div class="col-lg-10 col-offset-2">
5
+ <%= f.submit "Create Page", :class => "btn btn-primary form-btn btn-save", "data-loading-text" => "Saving..." %>
6
+ <%= f.submit "Preview", :class => "btn btn-primary btn-preview" %> or <%=link_to "cancel", admin_pages_path,:class => "btn btn-link" %>
5
7
  </div>
6
-
7
- <%end%>
8
+ </div>
9
+ <% end %>
@@ -3,11 +3,11 @@
3
3
  <meta name="description" content="<%=@page.meta_description%>" />
4
4
 
5
5
  <meta name="keywords" content="<%=@page.meta_keywords%>" />
6
- <%end%>
6
+ <% end %>
7
7
 
8
8
  <%if !@inline.blank?%>
9
9
  <%=render :inline => @inline%>
10
- <%end%>
10
+ <% end %>
11
11
  <%@page.spud_page_partials.each do |page_partial|%>
12
12
 
13
13
  <%if(page_partial.name.downcase == 'body' && Spud::Cms.yield_body_as_content_block == false)%>
@@ -15,6 +15,6 @@
15
15
  <%else%>
16
16
  <%=content_for page_partial.name.parameterize.underscore.to_sym do%>
17
17
  <%=page_partial.postprocess_content.html_safe%>
18
- <%end%>
19
- <%end%>
20
- <%end%>
18
+ <% end %>
19
+ <% end %>
20
+ <% end %>
@@ -1,8 +1,16 @@
1
- <fieldset>
2
- <%= f.label :name, :required=>true,:style =>"display:none;" %>
3
- <%= f.text_field :name, :class => "full-width",:placeholder=>"Enter title here" %>
4
- </fieldset>
5
- <br/>
6
- <div>
1
+ <%= tb_form_errors(f.object)%>
2
+
3
+ <div class="form-group">
4
+ <%= f.label :name, :required => true, :class => "control-label" %>
5
+ <%= f.text_field :name, :title => "", :class=>"form-control" %>
6
+ </div>
7
+
8
+ <div class="form-group">
9
+ <%= f.label :content, :required => true, :class => "control-label" %>
7
10
  <%= f.text_area :content,:style => "width:100%;", :class => 'tinymce full-width' %>
8
11
  </div>
12
+
13
+ <div class="form-group">
14
+ <%= f.submit "Save Snippet", :class => "btn btn-primary" %>
15
+ <%= link_to "Cancel", admin_snippets_path, :class => "btn btn-default" %>
16
+ </div>
@@ -1,7 +1,3 @@
1
- <%=form_for @snippet,:url => admin_snippet_path(@snippet),:html=>{:class=>"form-horizontal"} do |f|%>
2
- <%=render :partial => "form",:locals => {:f => f}%>
3
- <div class="form-actions">
4
- <%=f.submit "Save Snippet", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_snippets_path,:class => "btn"%>
5
- </div>
6
-
7
- <%end%>
1
+ <%= form_for @snippet, :url => admin_snippet_path(@snippet) do |f| %>
2
+ <%= render :partial => "form", :locals => {:f => f} %>
3
+ <% end %>
@@ -1,24 +1,27 @@
1
- <%=content_for :data_controls do%>
2
- <%=link_to "New Snippet",new_admin_snippet_path(),:class => "btn btn-primary",:title => "New Snippet"%>
3
- <%end%>
4
- <%=content_for :detail do%>
5
- <div class="page_list">
6
- <%@snippets.each do |snippet|%>
7
- <div class="page_row">
8
-
9
- <span class="row_meta"><%=link_to snippet.name,edit_admin_snippet_path(:id => snippet.id)%></span>
10
-
11
- <span class="edit_controls">
12
-
13
- <%=link_to "Remove",admin_snippet_path(:id => snippet.id),:method => :delete,:class => 'btn btn-danger', :data => {:confirm => "Are you sure you want to remove this snippet?"} %>
14
- </span>
15
- <br style="clear:both;"/>
16
- </div>
17
- <%end%>
18
- <%=will_paginate @snippets%>
1
+ <% content_for :data_controls do %>
2
+ <%= link_to "New Snippet",new_admin_snippet_path, :class => "btn btn-primary", :title => "New Snippet" %>
3
+ <% end %>
19
4
 
5
+ <% content_for :detail do %>
6
+ <div class="table-responsive">
7
+ <table class="table table-striped table-hover">
8
+ <thead>
9
+ <tr>
10
+ <th>Name</th>
11
+ <th>&nbsp;</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+ <% @snippets.each do |snippet| %>
16
+ <tr>
17
+ <td><%= snippet.name %></td>
18
+ <td class="table-actions">
19
+ <%= link_to 'Edit', edit_admin_snippet_path(snippet), :class => 'btn btn-sm btn-default' %>
20
+ <%= link_to 'delete', admin_snippet_path(snippet), :method => :delete, :class => 'btn btn-sm btn-danger', :data => {:confirm => 'Are you sure you want to delete this snippet?'} %>
21
+ </td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
20
26
  </div>
21
-
22
-
23
-
24
- <%end%>
27
+ <% end %>
@@ -1,7 +1,3 @@
1
- <%=form_for @snippet,:url => admin_snippets_path,:html=>{:class=>"form-horizontal"} do |f|%>
2
- <%=render :partial => "form",:locals => {:f => f}%>
3
- <div class="form-actions">
4
- <%=f.submit "Create Snippet", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_snippets_path,:class => "btn"%>
5
- </div>
6
-
7
- <%end%>
1
+ <%= form_for @snippet, :url => admin_snippets_path do |f| %>
2
+ <%= render :partial => "form",:locals => {:f => f} %>
3
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Cms
3
- VERSION = "1.1.5"
3
+ VERSION = "1.2.0.beta1"
4
4
  end
5
5
  end
@@ -16,9 +16,8 @@ describe Cms::SitemapsController do
16
16
  end
17
17
 
18
18
  it "should only respond to an XML format" do
19
- expect {
20
- get :show
21
- }.to raise_exception(ActionController::UnknownFormat)
19
+ get :show, :format => :html
20
+ response.response_code.should == 404
22
21
  end
23
22
 
24
23
  describe :multisite do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Westlake Design
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-21 00:00:00.000000000 Z
11
+ date: 2014-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.2'
33
+ version: 1.3.0.beta1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.2'
40
+ version: 1.3.0.beta1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tb_permalinks
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -363,9 +363,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
363
363
  version: '0'
364
364
  required_rubygems_version: !ruby/object:Gem::Requirement
365
365
  requirements:
366
- - - ">="
366
+ - - ">"
367
367
  - !ruby/object:Gem::Version
368
- version: '0'
368
+ version: 1.3.1
369
369
  requirements: []
370
370
  rubyforge_project:
371
371
  rubygems_version: 2.2.1