Merge branch 'design_team' of github.com:Rulingcom/orbit into design_team

This commit is contained in:
Christophe Vilayphiou committed 2012-05-08 17:24:40 +08:00
commit d2e07f537a
19 files changed
+104 -135

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+6 -1
View File
@@ -18,6 +18,7 @@ class Site
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_one :footer, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_one :sub_menu, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_many :site_metas, :autosave => true, :dependent => :destroy
before_save :set_key
@@ -33,7 +34,6 @@ class Site
end
def up_to_date?
p res = %x(git remote show origin)
res = res.split('rails_3_1').pop.gsub('(', '').gsub(')','').strip rescue nil
res.eql?('local out of date') ? false : true
end
@@ -46,6 +46,10 @@ class Site
@footer ||= I18nVariable.first(:conditions => {:key => 'footer', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
end
def sub_menu
@sub_menu ||= I18nVariable.first(:conditions => {:key => 'sub_menu', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
end
METAS.each do |meta|
define_method meta do
fetch_meta = self.site_metas.where(key: meta).limit(1)
@@ -66,6 +70,7 @@ class Site
def set_key
title.key = 'title' if title && (title.key.blank? rescue true)
footer.key = 'footer' if footer && (footer.key.blank? rescue true)
sub_menu.key = 'sub_menu' if sub_menu && (sub_menu.key.blank? rescue true)
end
end
+2
View File
@@ -3,6 +3,8 @@ class Tag
include Mongoid::Document
include Mongoid::Timestamps
field :key
belongs_to :module_app
end
+8
View File
@@ -57,6 +57,14 @@
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'admin.site_sub_menu' %></label>
<div class="controls">
<%= f.fields_for :sub_menu, @site.sub_menu do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
<% end %>
</div>
</div>
<% end %>
<% end %>
</div>
+1
View File
@@ -27,6 +27,7 @@
<%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') %>
<%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %>
<%= content_tag :li, link_to(t('announcement.news_bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_sys_call_for_app('module_apps','edit','news') if (is_admin? rescue nil) %>
<% end -%>
<% end -%>
+1
View File
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title><%= @title || APP_CONFIG['orbit'] %></title>
<link rel="shortcut icon" href="<%= asset_path "ncculogo.ico" %>">
<!--[if lt IE 9]>
<%= javascript_include_tag "html5" %>
<![endif]-->
+1
View File
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<%= page_title(@item).html_safe %>
<link rel="shortcut icon" href="<%= asset_path "ncculogo.ico" %>">
<%= page_metas(@item).html_safe %>
<!--[if lt IE 9]>
<%= javascript_include_tag "html5" %>