wip before i destroy things again

Oleg committed Aug 24, 2011
commit 03c616ffdb157e42a2292fa918d94b84e838dec2
Showing 8 changed files with 88 additions and 4 deletions
app/assets/stylesheets/comfortable_mexican_sofa/content.css +41 -0
@@ @@ -69,6 +69,47 @@
#cms_body #file_uploads #uploaded_files .file:hover a.delete {
color: #9e0b0f;
}
+ /* -- Categories Widget -------------------------------------------------- */
+ #cms_body .categories_widget {
+ margin-bottom: 10px;
+ background-color: #252525;
+ padding: 5px 5px 5px 10px;
+ border-radius: 5px;
+ color: #fff;
+ }
+ #cms_body .categories_widget .label {
+ float: left;
+ width: 100px;
+ }
+ #cms_body .categories_widget .label span {
+ float: left;
+ font: 12px 'Lucida Grande','Tahoma', sans-serif;
+ }
+ #cms_body .categories_widget a.action_link.edit {
+ float: right;
+ margin-left: 10px;
+ padding: 2px 4px;
+ border: 0px;
+ border-radius: 2px;
+ }
+ #cms_body .categories_widget .categories {
+ overflow: hidden;
+ margin: 0px 50px 0px 110px;
+ }
+ #cms_body .categories_widget .category {
+ float: left;
+ background-color: #484848;
+ border-radius: 3px;
+ color: #fff;
+ padding: 3px 5px;
+ margin: 0px 3px 0px 3px;
+ }
+ #cms_body .categories_widget .category a {
+ display: block;
+ color: #a3a3a3;
+ font: 9px/9px 'Arial', serif;
+ text-transform: uppercase;
+ }
/* -- Listings ----------------------------------------------------------- */
#cms_body ul.list li .item {
app/assets/stylesheets/comfortable_mexican_sofa/form.css +3 -2
@@ @@ -123,9 +123,10 @@
#cms_body .form_element.categories .value label {
display: inline-block;
padding: 3px 5px;
- background-color: #9f9f9f;
+ background-color: #484848;
border-radius: 3px;
- font: 9px/14px 'Lucida Grande', 'Tahoma', serif;
+ font: 9px/14px 'Arial', serif;
text-transform: uppercase;
color: #fff;
+ margin-bottom: 3px;
}
\ No newline at end of file
app/assets/stylesheets/comfortable_mexican_sofa/structure.css +3 -0
@@ @@ -85,12 +85,14 @@ html, body#cms_body {
#cms_body input[type='reset'],
#cms_body input[type='file'],
#cms_body .action_links a,
+ #cms_body a.action_link,
#cms_body a.ui-dialog-titlebar-close {
margin-left: 3px;
background-color: #b4b4b4;
color: #1b1b1b;
padding: 3px 5px;
font: 9px Arial, sans-serif;
+ letter-spacing: 0.3px;
text-transform: uppercase;
border-radius: 3px;
-moz-border-radius: 3px;
@@ @@ -106,6 +108,7 @@ html, body#cms_body {
#cms_body input[type='reset']:hover,
#cms_body input[type='file']:hover,
#cms_body .action_links a:hover,
+ #cms_body a.action_link:hover,
#cms_body a.ui-dialog-titlebar-close:hover {
box-shadow: inset 0px 0px 5px #aaa;
-moz-box-shadow: inset 0px 0px 5px #aaa;
app/views/cms_admin/categories/_form.html.erb +1 -1
@@ @@ -1,6 +1,6 @@
<% object = form.object %>
<% if (categories = Cms::Category.of_type(object.class.to_s)).present? %>
- <%= form.simple_field t('.categories'), nil, :class => 'categories' do %>
+ <%= form.simple_field t('.label'), nil, :class => 'categories' do %>
<% categories.each do |category| %>
<%= hidden_field_tag "#{object.class.to_s.demodulize.downcase}[category_ids][#{category.id}]", 0, :id => nil %>
<label>
app/views/cms_admin/categories/_index.html.erb +28 -0
@@ @@ -0,0 +1,28 @@
+ <% type ||= index %>
+
+ <div class='categories_widget'>
+
+ <div class='label'>
+ <span><%= t('.label') %></span>
+ </div>
+
+ <%= link_to t('.edit'), '#', :class => 'action_link edit' %>
+
+ <div class='categories'>
+ <div class='category all'>
+ <%= link_to t('.all'), '' %>
+ </div>
+ <% Cms::Category.of_type(type).each do |category| %>
+ <div class='category' id="<%= dom_id(category)%>">
+ <%= link_to category.label, '' %>
+ </div>
+ <% end %>
+ <!-- >
+ <%= form_for :category, :url => cms_admin_site_categories_path(@site), :remote => true do |form| %>
+ <%= form.text_field :label %>
+ <%= form.submit t('.add') %>
+ <% end %>
+ < -->
+ </div>
+
+ </div>
\ No newline at end of file
app/views/cms_admin/snippets/index.html.erb +2 -0
@@ @@ -5,6 +5,8 @@
<%= render :partial => 'cms_admin/sites/mirrors' %>
<% end %>
+ <%= render :partial => 'cms_admin/categories/index', :object => 'Cms::Snippet' %>
+
<ul class='list'>
<% @snippets.each do |snippet| %>
<li id='cms_snippet_<%= snippet.id %>'>
config/locales/en.yml +8 -0
@@ @@ -196,4 +196,12 @@ en:
form:
create: Upload File
update: Update File
+
+ categories:
+ index:
+ label: Categories
+ edit: Edit
+ all: All
+ form:
+ label: Categories
\ No newline at end of file
config/routes.rb +2 -1
@@ @@ -21,11 +21,12 @@ Rails.application.routes.draw do
put :revert, :on => :member
end
end
- resources :snippets do
+ resources :snippets do
resources :revisions, :only => [:index, :show, :revert] do
put :revert, :on => :member
end
end
+ resources :categories
end
end unless ComfortableMexicanSofa.config.admin_route_prefix.blank?