From d48c44fe0ecdc20d5c18cc1657471c5e91fbfddd Mon Sep 17 00:00:00 2001 From: Hulihan Applications Date: Mon, 21 May 2012 17:06:26 -0600 Subject: [PATCH 1/2] Updated buttons & Side menus. --- app/assets/stylesheets/application.css.scss | 26 +++++++-- app/assets/stylesheets/layout.css.scss | 23 +++++++- app/assets/stylesheets/menu.css.scss | 61 ++++++++++++++++----- app/assets/stylesheets/settings.css.scss | 2 +- app/views/admin/_menu.html.erb | 38 ++++++------- app/views/application/_html_allowed.html | 2 +- app/views/settings/_list_settings.html.erb | 9 +-- app/views/settings/_setting.html.erb | 7 ++- app/views/settings/themes.html.erb | 11 ++-- config/locales/en.yml | 1 + 10 files changed, 123 insertions(+), 57 deletions(-) mode change 100644 => 100755 app/assets/stylesheets/layout.css.scss mode change 100644 => 100755 app/assets/stylesheets/menu.css.scss mode change 100644 => 100755 app/assets/stylesheets/settings.css.scss mode change 100644 => 100755 app/views/settings/_setting.html.erb diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index e9d5ccb..e9eee7a 100755 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -15,9 +15,9 @@ @import "compass"; - /* SASS Vars */ - +$default-box-shadow-v-offset: 1px; +$default-box-shadow-blur: 1px; /* Icon Sprites */ @import "icons/*.png"; @@ -113,10 +113,26 @@ input#search_box.selected {background:url(bgs/white_trans_25.png) repeat;border: /* Buttons */ -.button_1, .button_1:visited, .button_1:link {color:#eee;@include text-shadow;;padding:1px 5px 1px 5px;border:1px solid black;background:url(bgs/button_1_bg.png) repeat center center;;font-weight:bold;;cursor:pointer;-moz-border-radius: 3px;-webkit-border-radius: 3px;@include opacity(0.9);} -.button_1:hover, .button_2:hover {@include opacity(1);} +.button_1, .button_1:visited, .button_1:link { + color:#eee; + padding:1px 5px 1px 5px; + font-weight:bold; + cursor:pointer; + @include background(linear-gradient(top, #666 0%, #222)); + @include border-radius; + border: 1px solid #000; + @include box-shadow( + 0px 1px 3px rgba(000,000,000,0.5), + inset 0px 0px 2px rgba(255,255,255,0.7) + ); + @include text-shadow(1px 1px 1px #000); + &:hover, .button_2:hover { + @include background(linear-gradient(top, #777 0%, #333)); + @include opacity(1); + } +} .button_2, .button_2:visited, .button_2:link {color:#eee;@include text-shadow;padding:1px 5px 1px 5px;border:1px solid black;background:url(bgs/button_2_bg.png) repeat center center;;font-weight:bold;;cursor:pointer;-moz-border-radius: 3px;-webkit-border-radius: 3px;@include opacity(0.9);} -.button_1, .button_2, #search_button, #search_box, #top, img.loading {@include box-shadow;} +.button_2, #search_button, #search_box, img.loading {@include box-shadow;} /* Review */ diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss old mode 100644 new mode 100755 index dad911d..2f656f6 --- a/app/assets/stylesheets/layout.css.scss +++ b/app/assets/stylesheets/layout.css.scss @@ -11,12 +11,29 @@ a.extra_options {padding:7px 0px;display:block;border-top:1px solid #ccc;} #wrapper {height:auto !important; height:100%; min-height:100%;position:relative;} #wrapper > #header, #wrapper > #content, #wrapper > #top > table {width: 900px ; margin: 0 auto ;} #wrapper > #top, #wrapper > #footer {color:#ccc;} - #wrapper > #top {background:url(bgs/black_trans_10.png) repeat;padding:5px 0px;text-align:right;border-bottom:1px solid #666;} + #wrapper > #top { + background:#333; + padding:5px 0px; + text-align:right; + border-bottom:1px solid #000; + } #top td {vertical-align:middle;} #top a:visited, #top a:link, #footer a:visited, #footer a:link {color:#ddd} #top a:hover, #footer a:hover {color:#fff} - #wrapper > #header {position:relative;height:95px;background:url(bgs/main_logo_bg.png) no-repeat;background-position:bottom left;} - #wrapper > #content {height:100%;padding:5px;padding-top:10px; padding-bottom:70px;height:100%} + #wrapper > #header { + position:relative; + height:95px; + background:url(bgs/main_logo_bg.png) no-repeat; + background-position:bottom left; + border-top:1px solid #aaa; + } + #wrapper > #content { + height:100%; + padding:5px; + padding-top:10px; + padding-bottom:70px; + height:100%; + } #wrapper > #content.split-one #main {width:100%} #wrapper > #content.split-two #main {float:left;width:660px;} #main .header table {width:100%} diff --git a/app/assets/stylesheets/menu.css.scss b/app/assets/stylesheets/menu.css.scss old mode 100644 new mode 100755 index 7f32a37..d9736e9 --- a/app/assets/stylesheets/menu.css.scss +++ b/app/assets/stylesheets/menu.css.scss @@ -32,20 +32,53 @@ div#side div.menu div.footer {text-align:center} /* Side Menus */ div#side ul.menu li span.count, div#side div.menu, div#side ul.menu li a.selected {-moz-border-radius: 5px;-webkit-border-radius: 5px;} -div#side div.menu {} - div#side ul.menu {} - div#side ul.menu li {font-size:16px;position:relative;margin:0;padding:0;} - div#side ul.menu img.icon {/*display:none;*/} - div#side ul.menu li ul {padding:0;margin:0;display:none;} - div#side ul.menu li ul li {font-size:14px;padding:0px 0px 0px 12px;} - div#side ul.menu li > a {display:block;padding:3px 5px;margin-bottom:3px;display:relative;} - div#side ul.menu li > a.selected {;border:1px solid #ccc;background:#fff;box-shadow: 0px 1px 2px #222;;-moz-box-shadow: 0px 1px 2px #222;; -webkit-box-shadow: 0px 1px 2px #222;} - div#side ul.menu li > a.selected > span.count {background:none;border:none;right:7px;top:3px;} - div#side ul.menu li a span.count {position:absolute;top:0;right:6px;text-align:center;background:#fff;border:1px solid #ccc;padding:3px;font-size:10px;;display:block;min-width:15px;} - div#side ul.menu li.selected {;/*border:1px solid #ccc;background:#fff*/} - div#side ul.menu li.selected > ul, div#side ul.menu li.selected > div.menu ul {display:block;} -div#side div.menu div.footer {border-top:1px solid #aaa;padding-top:5px;margin-top:5px;} - +div#side div.menu { + div.footer {border-top:1px solid #aaa;padding-top:5px;margin-top:5px;} +} +div#side ul.menu { + img.icon {/*display:none;*/} + li { + font-size:16px; + position:relative; + margin:0; + padding:0; + ul { + padding:0;margin:0;display:none; + li {font-size:14px;padding:0px 0px 0px 12px;} + } + a { + span.count { + position:absolute;top:0;right:6px;text-align:center;background:#fff;border:1px solid #ccc;padding:3px;font-size:10px;;display:block;min-width:15px; + } + } + > a { + display:block; + padding:3px 5px; + margin-bottom:3px; + display:relative; + &.selected { + color: #ffffff; + @include background(linear-gradient(top, #444 0%, #222)); + @include border-radius; + border: 1px solid #000; + @include box-shadow( + 0px 1px 3px rgba(000,000,000,0.25), + inset 0px 0px 2px rgba(255,255,255,0.7) + ); + text-shadow: 0px 1px 1px rgba(000,000,000,0.4); + // box-shadow: 0px 1px 2px #222; + // -moz-box-shadow: 0px 1px 2px #222; + // ; -webkit-box-shadow: 0px 1px 2px #222; + > span.count {background:none;border:none;right:7px;top:3px;} + } + } + &.selected { + > ul, > div.menu ul { + display:block; + } + } + } +} /* Record Menus */ div.record {position:relative;} diff --git a/app/assets/stylesheets/settings.css.scss b/app/assets/stylesheets/settings.css.scss old mode 100644 new mode 100755 index 8cc3194..3868405 --- a/app/assets/stylesheets/settings.css.scss +++ b/app/assets/stylesheets/settings.css.scss @@ -4,7 +4,7 @@ div.settings { div.setting { span.name {font-size:0.8em;color:#aaa;padding-left:3px} div.description { - margin-top:10px; + margin-top:3px; } } } \ No newline at end of file diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index dcf966b..d1e0855 100755 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -2,26 +2,24 @@ <%= content_tag :div, :class => "admin menu", :id => "admin-menu" do %> <% end %> diff --git a/app/views/application/_html_allowed.html b/app/views/application/_html_allowed.html index 458d517..8b98e33 100755 --- a/app/views/application/_html_allowed.html +++ b/app/views/application/_html_allowed.html @@ -1,6 +1,6 @@

- <%= t("single.information") %>" class="icon"> + <%= icon(:locked) %> <%= t("single.security") %> <%= t("single.information") %>

<%= t("info.html_allowed", :elements => Rails.configuration.action_view.sanitized_allowed_tags.join(", ") )%> diff --git a/app/views/settings/_list_settings.html.erb b/app/views/settings/_list_settings.html.erb index 17b2869..ab48535 100755 --- a/app/views/settings/_list_settings.html.erb +++ b/app/views/settings/_list_settings.html.erb @@ -6,8 +6,9 @@
<%= content_tag :em, description if defined?(description) %> - - <% for setting in settings %> - <%= render setting %> - <% end %> + <%= content_tag :div, :class => :settings do %> + <% for setting in settings %> + <%= render setting %> + <% end %> + <% end %> \ No newline at end of file diff --git a/app/views/settings/_setting.html.erb b/app/views/settings/_setting.html.erb old mode 100644 new mode 100755 index 13c951a..57f7487 --- a/app/views/settings/_setting.html.erb +++ b/app/views/settings/_setting.html.erb @@ -10,18 +10,19 @@ <% case setting.item_type %> <% when "string" %> + <%= text_field_tag "setting[#{setting.name}]", setting.value %> <% when "bool" %> <%= radio_button_tag "setting[#{setting.name}]", "1", setting.to_bool %> - <%= t("single.positive") %> + <%= label_tag "setting_#{setting.name}_1", t("single.positive") %> <%= radio_button_tag "setting[#{setting.name}]", "0", !setting.to_bool %> - <%= t("single.negative") %> + <%= label_tag "setting_#{setting.name}_0", t("single.negative") %> <% when "option" %> + <% when "special" %> <% if setting.name == "locale" %> <%= render :partial => "select_locale", :locals => {:options => {:input_name => "setting[#{setting.name}]"}} %> diff --git a/app/views/settings/themes.html.erb b/app/views/settings/themes.html.erb index c2af982..257511c 100755 --- a/app/views/settings/themes.html.erb +++ b/app/views/settings/themes.html.erb @@ -18,7 +18,7 @@
<%= form_tag({:action => "update_settings"}) do %> - +
<% for theme in @themes %> <% @class = cycle("row_a", "row_b") %> @@ -33,7 +33,7 @@ <%= t("single.negative") %> <%= t("single.preview") %> <% end %> -
+ <% theme_config_file = Rails.root.to_s + "/public" + "/themes/#{theme}/theme.yml" %> <% if File.exists?(theme_config_file)%> @@ -42,17 +42,16 @@ <%#= theme_file.inspect %>

<%= h theme_file["theme"]["name"] %>

<%= h theme_file["theme"]["description"] %>
-
+ <%= tag :hr %> <%= t("single.by") %> " target="_blank"><%= h theme_file["theme"]["author"] %>
<%= t("single.version") %> : <%= h theme_file["theme"]["version"] %> - + <%= icon :link %> " target="_blank"><%= t("single.theme")%> <%= t("single.website")%> <%= icon("public") %> <%= link_to t("single.preview"), {:action => params[:action], :theme => theme}, :target => "_blank" %> - - <%= link_to t("single.delete"), {:action => "delete_theme", :controller => "settings", :theme_name => theme}, :confirm => t("confirm.general") %> + <%= link_to icon(:delete) + " " + t("single.delete"), {:action => "delete_theme", :controller => "settings", :theme_name => theme}, :confirm => t("confirm.general") %> <% else %> diff --git a/config/locales/en.yml b/config/locales/en.yml index fc510aa..fe653bf 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -118,6 +118,7 @@ en: unknown: Unknown home: Home blog: Blog + overview: Overview # Flash Messages & Notices notice: save_success: Your changes have been successfully saved! From 4a9b6983f7bcf4c3225cabe65a23c4b383c045c8 Mon Sep 17 00:00:00 2001 From: Hulihan Applications Date: Mon, 21 May 2012 17:33:10 -0600 Subject: [PATCH 2/2] Created migration: @RemoveSectionSettings@ and updated views. --- app/assets/stylesheets/layout.css.scss | 2 +- app/views/admin/_menu.html.erb | 2 +- app/views/application/_top.html.erb | 2 +- app/views/browse/index.html.erb | 8 ++++---- app/views/pages/_list_pages.html.erb | 2 +- app/views/pages/_menu.html.erb | 2 +- app/views/settings/index.html.erb | 8 +------- app/views/user/_menu.html.erb | 2 +- app/views/users/show.html.erb | 2 +- db/migrate/20120521230728_remove_section_settings.rb | 11 +++++++++++ db/schema.rb | 4 +--- 11 files changed, 24 insertions(+), 21 deletions(-) create mode 100755 db/migrate/20120521230728_remove_section_settings.rb diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss index 2f656f6..406f232 100755 --- a/app/assets/stylesheets/layout.css.scss +++ b/app/assets/stylesheets/layout.css.scss @@ -25,7 +25,7 @@ a.extra_options {padding:7px 0px;display:block;border-top:1px solid #ccc;} height:95px; background:url(bgs/main_logo_bg.png) no-repeat; background-position:bottom left; - border-top:1px solid #aaa; + // border-top:1px solid #aaa; } #wrapper > #content { height:100%; diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index d1e0855..a008a68 100755 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -7,7 +7,7 @@ <%= link_to(icon("items") + " " + Item.model_name.human(:count => :other), {:action => "all_items", :controller => "items"}, :class => params[:action] == "all_items" ? :selected : nil ) %> <%#= render :partial => "items/all_items_menu" %> <%= render :partial => "items/menu" %> - <% end if @setting[:section_items] %> + <% end %> <%= content_tag(:li, :class => (params[:controller] == "pages") ? :selected : nil) do %> <%= link_to(icon("pages") + " " + Page.model_name.human(:count => :other), {:action => "index", :controller => "pages"}, :class => current_page?(pages_path) && params[:type].blank? ? :selected : nil) %> <%= render :partial => "pages/menu" %> diff --git a/app/views/application/_top.html.erb b/app/views/application/_top.html.erb index 0d82392..f64f231 100755 --- a/app/views/application/_top.html.erb +++ b/app/views/application/_top.html.erb @@ -2,7 +2,7 @@
- <% if @setting[:section_items] %> + <% if true %>
<%= render :partial => "/settings/list_settings", :locals => {:settings => Setting.find(:all, :conditions => ["setting_type = ?", "User"]), :title => User.model_name.human}%> -
-
- <%= render :partial => "/settings/list_settings", :locals => {:settings => Setting.find(:all, :conditions => ["setting_type = ?", "Section"]), :title => t("single.section")}%> -
+
- -
diff --git a/app/views/user/_menu.html.erb b/app/views/user/_menu.html.erb index 58ed244..37ebcc9 100755 --- a/app/views/user/_menu.html.erb +++ b/app/views/user/_menu.html.erb @@ -6,7 +6,7 @@ <% end %> <%= content_tag :li, :class => params[:controller] == "items" ? :selected : nil do %> <%= link_to(icon("items") + " " + Item.model_name.human(:count => :other), {:action => "my", :controller => "items"}, :class => params[:controller] == "items" ? :selected : nil) %> - <% end if (Setting.get_setting_bool("let_users_create_items") || @logged_in_user.is_admin?) && @setting[:section_items] %> + <% end if (Setting.get_setting_bool("let_users_create_items") || @logged_in_user.is_admin?) %> <%= content_tag :li, :class => params[:controller] == "messages" ? :selected : nil do %> <%= link_to(icon("mail") + " " + UserMessage.model_name.human(:count => :other), {:action => "for_me", :controller => "messages"}, :class => params[:controller] == "messages" ? :selected : nil) %> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index d2e2f09..8197d13 100755 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -72,7 +72,7 @@ <%= @user.group.name %> <% end if @logged_in_user.is_admin? %> - <% if @setting[:section_items] && @items.size > 0 %> + <% if @items.size > 0 %> <%= render :partial => "navigation" %>
diff --git a/db/migrate/20120521230728_remove_section_settings.rb b/db/migrate/20120521230728_remove_section_settings.rb new file mode 100755 index 0000000..590c524 --- /dev/null +++ b/db/migrate/20120521230728_remove_section_settings.rb @@ -0,0 +1,11 @@ +class RemoveSectionSettings < ActiveRecord::Migration + def up + Setting.find_by_name("section_items").destroy + Setting.find_by_name("section_blog").destroy + end + + def down + Setting.create(:name => "section_items", :value => "1", :setting_type => "Section", :item_type => "bool") + Setting.create(:name => "section_blog", :value => "1", :setting_type => "Section", :item_type => "bool") + end +end diff --git a/db/schema.rb b/db/schema.rb index c0e3dfc..e287415 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,4 +1,3 @@ -# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. @@ -11,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120311001715) do +ActiveRecord::Schema.define(:version => 20120521230728) do create_table "authentications", :force => true do |t| t.integer "user_id" @@ -139,7 +138,6 @@ t.boolean "display_children", :default => true t.boolean "group_access_only", :default => false t.string "group_ids" - t.text "side" t.string "slug" end