New UI changes(tags, categories, authorisations, module index…)

To run:
  - ruby lib/remove_old_tags.rb DB_NAME
  - rake new_ui:migrate_tags
  - rake new_ui:migrate_categories['APP_KEY,''MODEL_NAME'] (check new_ui.rake for more details)
This commit is contained in:
chris committed 2013-07-02 16:46:44 +08:00
1 parent 07b3857465
commit 856898016b
1495 files changed
+52132 -9876

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
module Admin::CategoriesHelper
include ActionView::Helpers::UrlHelper
def show_permission_link(category)
type = 'submit'
oa = category.get_object_auth_by_title(type)
if oa.nil?
category.object_auths.new(title: type ).save
oa = category.get_object_auth_by_title(type)
end
link_to t(:category_auth), admin_object_auth_ob_auth_path(oa)
end
end
+10 -1
View File
@@ -40,5 +40,14 @@ module Admin::ItemsHelper
''
end
end
def get_item_module_infos(item)
if module_app = item.module_app
app = OrbitApp::Module::Registration.find_by_key(module_app.key)
[t(app.get_label_i18n), (app.get_icon_class rescue 'icons-daniel-bruce-2')]
else
[t(:no_app), 'icons-daniel-bruce-2']
end
end
end
+27
View File
@@ -0,0 +1,27 @@
module Admin::TagsHelper
def get_module_app_icon(module_app)
app = OrbitApp::Module::Registration.find_by_key(module_app.key)
app.get_icon_class rescue 'icons-daniel-bruce-2'
end
def show_names_slash(tag)
span_names = @site_valid_locales.inject([]) do |names, locale|
names << content_tag(:span, tag.name_translations[locale], class: "tag")
end
span_names.join(" / ").html_safe
end
def get_tagging_count(module_tag)
if module_tag.is_default && module_tag.parent.blank?
count = module_tag.children.inject(0) do |count, child|
count += child.tag.taggings.count
count
end
else
count = module_tag.tag.taggings.count
end
count
end
end