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

Conflicts:
	app/controllers/admin/users_new_interface_controller.rb
	app/views/admin/users_new_interface/show.html.erb
This commit is contained in:
Matthew K. Fu JuYuan committed 2012-10-12 18:17:05 +08:00
commit b5571dbc43
894 files changed
+23695 -2108

No files matched your search

+2031 -1740
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -195,6 +195,7 @@ legend {
padding: 0 8px;
vertical-align: inherit;
position: relative;
position/**/: static;
}
.sort-header th a {
display: block;
+3
View File
@@ -69,6 +69,9 @@
#orbit-bar .orbit-logo .dropdown-menu {
left: -15px;
}
#orbit-bar .orbit-logo .dropdown-menu>li>a:hover>i {
background-image: url(<%= asset_path 'icons_pack_white.png' %>);
}
#orbit-bar .nav > li {
height: 28px;
}
+2 -2
View File
@@ -280,7 +280,7 @@
.filter .accordion-heading {
border-bottom: none;
border-top: none;
border-left: 1px solid rgba(0,0,0,0.07);
border-left: 1px solid #E9E9E9;
border-right: none;
-moz-border-radius: 0;
-webkit-border-radius: 0;
@@ -291,7 +291,7 @@
top: 0;
}
.filter li:last-child .accordion-heading {
border-right: 1px solid rgba(0,0,0,0.07);
border-right: 1px solid #E9E9E9;
}
.accordion-group .accordion-toggle .caret {
border-top-color: #0088CC;
+1 -1
View File
@@ -4,7 +4,7 @@ class Admin::PluginsController < ApplicationController
def index
@module_apps = ModuleApp.excludes(widgets: nil).where(has_plugin: true).order_by(:title, :asc)
@plugins = ModuleApp.where(has_plugin: true).order_by(:title, :asc)
end
@@ -26,6 +26,8 @@ class Admin::UsersNewInterfaceController < ApplicationController
def show
@user = User.find(params[:id])
@plugins = OrbitApp::Module::Registration.all
@profile_data = []
@teacher_data = []
@student_data = []
@@ -47,6 +49,13 @@ class Admin::UsersNewInterfaceController < ApplicationController
@staff_data.push({:name => att_val.attribute_field.title,:value => att_val.get_value_by_locale(I18n.locale) }) if att_val.attribute_field.role.key=="staff_data"rescue false
}
if(!params[:show_plugin_profile].nil?)
@right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary'
else
@right_partial = "plugin_summary"
end
# @user.attribute_values.each{|att_val|
# @teacher_data.push({:name => att_val.attribute_field.title,:value =>att_val[I18n.locale]})
# }
+1 -1
View File
@@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base
layout :layout_by_resource
helper :all
helper :admin
before_filter :set_locale, :set_site
def set_current_user
@@ -1,4 +1,4 @@
module Admin::AdBannerHelper
module Admin::AdBannersHelper
def preview_block_ad_images_helper(ad_banner)
printable_ad_images = []
ad_banner.ad_images.each do |ad_image|
-3
View File
@@ -1,3 +0,0 @@
module Admin::AdImagesHelper
end
@@ -1,4 +1,4 @@
module Admin::AppAuthHelper
module Admin::AppAuthsHelper
def on_off_switch(attribute,attribute_type)
link_to t(:enable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch'
link_to t(:disable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch'
@@ -1,4 +1,4 @@
module Admin::AssetHelper
module Admin::AssetsHelper
def show_all_fields(asset, field)
a = []
@@ -1,4 +1,4 @@
module Admin::DashboardHelper
module Admin::DashboardsHelper
def get_link(title)
case title
@@ -1,4 +1,4 @@
module Admin::ItemHelper
module Admin::ItemsHelper
def render_node_and_children(node)
ret = ''
@@ -1,4 +1,4 @@
module Admin::ModuleAppHelper
module Admin::ModuleAppsHelper
def if_permit_to_delete(item)
case item.downcase
-18
View File
@@ -1,18 +0,0 @@
module Admin::PageContentHelper
include ActionView::Helpers::UrlHelper
def show_page_context_edit_auth_link(page_context)
type = 'Edit'
# debugger
# a=1
oa = page_context.get_object_auth_by_title(type)
if oa.nil?
page_context.object_auths.new(title: type ).save rescue
oa = page_context.get_object_auth_by_title(type)
end
# link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa)
link_to t('admin.page_context.ob_auth.edit'),admin_object_auth_ob_auth_path(oa)
end
end
+30
View File
@@ -0,0 +1,30 @@
module Admin::PluginsHelper
def render_plugin_list
ret = ''
ret << "<div class=\"subnav\">"
ret << "<div id=\"module-nav\">"
ret << "<div class=\"arrow_next pull-right\"><i class=\"icon-chevron-right\"></i></div>"
ret << "<div class=\"arrow_prev pull-left\"><i class=\"icon-chevron-left\"></i></div>"
ret << "<div class=\"module-nav-view\">"
ret << "<ul class=\"nav nav-pills\">"
@plugins.each do |plugin|
ret << "<li>"
ret << (link_to eval("#{plugin.title}") , eval("panel_#{plugin.title}_back_end_#{plugin.object}s_path"))
ret << "</li>"
end
ret << "</ul>"
ret << "</div>"
ret << "</div>"
ret << "</div>"
ret.html_safe
end
end
@@ -1,4 +1,4 @@
module Admin::UserHelper
module Admin::UsersHelper
def show_attribute(object, field_id, locale = '')
attribute = object.attribute_values.detect {|av| av.attribute_field_id.eql?(field_id) || av[locale.to_s].eql?(locale.to_s) } rescue nil
-11
View File
@@ -1,11 +0,0 @@
module Admin::WebLinkHelper
def show_web_link_permission_link(web_link)
type = 'edit'
oa = web_link.get_object_auth_by_title(type)
if oa.nil?
web_link.object_auths.new(title: type ).save
oa = web_link.get_object_auth_by_title(type)
end
link_to t('web_resource.cate_auth'),admin_object_auth_ob_auth_path(oa)
end
end
@@ -1,7 +1,7 @@
#encoding: utf-8
# require ActionView::Helpers::FormTagHelper
module AttributeFieldHelper
module AttributeFieldsHelper
include ActionView::Helpers::FormTagHelper
include ActionView::Helpers::FormOptionsHelper
include ActionView::Helpers::DateHelper
-24
View File
@@ -1,24 +0,0 @@
module CalendarHelper
def month_link(month_date)
link_to(I18n.localize(month_date, :format => "%B"), {:month => month_date.month, :year => month_date.year})
end
# custom options for this calendar
def event_calendar_opts
{
:year => @year,
:month => @month,
:event_strips => @event_strips,
:month_name_text => I18n.localize(@shown_month, :format => "%B %Y"),
:previous_month_text => "<< " + month_link(@shown_month.prev_month),
:next_month_text => month_link(@shown_month.next_month) + " >>" }
end
def event_calendar
# args is an argument hash containing :event, :day, and :options
calendar event_calendar_opts do |args|
event = args[:event]
%(<a href="/events/#{event.id}" title="#{h(event.name)}">#{h(event.name)}</a>)
end
end
end
-4
View File
@@ -1,4 +0,0 @@
module DesignHelper
end
-2
View File
@@ -1,2 +0,0 @@
module SitesHelper
end
+61
View File
@@ -0,0 +1,61 @@
class GprsUploader < CarrierWave::Uploader::Base
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
# storage :file
# storage :s3
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"gprs/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end
# Process files as they are uploaded:
# process :scale => [200, 300]
#
# def scale(width, height)
# # do something
# end
# Create different versions of your uploaded files:
# version :thumb do
# process :scale => [50, 50]
# end
version :thumb do
process :resize_to_fill => [150, 120]
end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
# def extension_white_list
# %w(jpg jpeg gif png)
# end
# Override the filename of the uploaded files:
# def filename
# "something.jpg" if original_filename
# end
# def manipulate!
# raise current_path.inspect
# image = ::MiniMagick::Image.open(current_path)
# image = yield(image)
# image.write(current_path)
# ::MiniMagick::Image.open(current_path)
# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
# end
end
-27
View File
@@ -1,27 +0,0 @@
<div id="module-nav">
<div class="arrow_next pull-right"><i class="icon-chevron-right"></i></div>
<div class="arrow_prev pull-left"><i class="icon-chevron-left"></i></div>
<div class="module-nav-view">
<ul class="nav nav-pills">
<li class="active">
<a href="#">All</a>
</li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">研究計畫</a></li>
<li><a href="#">期刊論文</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">研究計畫</a></li>
<li><a href="#">期刊論文</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">研究計畫</a></li>
<li><a href="#">期刊論文</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">期刊論文</a></li>
</ul>
</div>
</div>
+1 -3
View File
@@ -1,4 +1,2 @@
<div class="subnav">
<%= render :partial => 'plugin', :collection => @plugins %>
</div>
<%= render_plugin_list %>
@@ -0,0 +1,6 @@
<div class="member-plugin">
<% #binding.pry%>
<%= render :partial=> 'plugin_summary'%>
<%= render :partial=> 'plugin_summary'%>
<%= render :partial=> 'plugin_summary'%>
</div>
@@ -6,22 +6,20 @@
<div class="arrow_prev pull-left"><i class="icon-chevron-left"></i></div>
<div class="module-nav-view">
<ul class="nav nav-pills">
<li class="active">
<a href="#"><%= t("admin.new_admin.users.all_plugin_summary")%></a>
</li>
<li><a href="#">學歷</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">學歷</a></li>
<%= content_tag :li,:class=>(params[:show_plugin_profile].nil? ? "active" : nil) do %>
<%= link_to t("admin.new_admin.users.all_plugin_summary")%>
<%end -%>
<% @plugins.each do |plugin|%>
<%= content_tag :li,:class=>(params[:show_plugin_profile]==plugin.name ? "active" : nil) do %>
<%= link_to plugin.name,:show_plugin_profile=> plugin.name %>
<% end -%>
<%end -%>
</ul>
</div>
</div>
<div class="member-plugin">
<%= render :partial=> 'plugin_summary'%>
<%= render :partial=> 'plugin_summary'%>
<%= render :partial=> 'plugin_summary'%>
</div>
<%=render :partial=> @right_partial%>
</div>
<div class="user-info">
<div id="brand" class="clear">
+47 -1
View File
@@ -105,7 +105,7 @@
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('cals','calendar_categories') || active_for_app_auth("calendar") do -%>
<%= content_tag :li, :class => active_for_controllers('cals') || active_for_app_auth("calendar") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-calendar') + content_tag(:span, t('admin.calendar')), panel_calendar_back_end_cals_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('cals','calendar_categories') ) do -%>
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
@@ -116,6 +116,17 @@
<%#= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
<%= content_tag :li, :class => active_for_controllers('locations') || active_for_app_auth("gprs") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + content_tag(:span, t('admin.gprs')), panel_gprs_back_end_locations_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('locations') ) do -%>
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
<%#= content_tag :li, link_to((t('calendar.calendars') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_calendar_back_end_cal_path), :class => active_for_action('cals','new') %>
<%#= content_tag :li, link_to(t('gallery.tags'), panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') %>
<%#= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
<%= content_tag :li, :class => (active_for_controllers('writing_journals', '/panel/personal_journal/back_end/tags', 'writing_journal_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-personal_journal') + t('admin.personal_journal'), panel_personal_journal_back_end_writing_journals_path %>
@@ -157,6 +168,41 @@
<% end -%>
<%= content_tag :li, :class => (active_for_controllers('researchs', '/panel/personal_research/back_end/tags', 'research_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-personal_research') + t('admin.personal_research'), panel_personal_research_back_end_researchs_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('researchs', '/panel/personal_research/back_end/tags', 'research_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_research.all_articles'), panel_personal_research_back_end_researchs_path), :class => active_for_action('researchs', 'index') %>
<%#= content_tag :li, link_to(t('personal_research.setting'), panel_personal_research_back_end_research_setting_path), :class => active_for_action('research_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_research.tags'), panel_personal_research_back_end_tags_path), :class => active_for_action('/panel/personal_research/back_end/tags', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => (active_for_controllers('projects', '/panel/personal_project/back_end/tags', 'project_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-personal_project') + t('admin.personal_project'), panel_personal_project_back_end_projects_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('projects', '/panel/personal_project/back_end/tags', 'project_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_project.all_articles'), panel_personal_project_back_end_projects_path), :class => active_for_action('projects', 'index') %>
<%= content_tag :li, link_to(t('personal_project.setting'), panel_personal_project_back_end_project_setting_path), :class => active_for_action('project_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_project.project_category'), panel_personal_project_back_end_project_categorys_path), :class => active_for_action('project_categorys', 'index') %>
<%= content_tag :li, link_to(t('personal_project.tags'), panel_personal_project_back_end_tags_path), :class => active_for_action('/panel/personal_project/back_end/tags', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => (active_for_controllers('writing_patents', '/panel/personal_patent/back_end/tags', 'writing_patent_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-personal_patent') + t('admin.personal_patent'), panel_personal_patent_back_end_writing_patents_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_patents', '/panel/personal_patent/back_end/tags', 'writing_patent_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_patent.all_articles'), panel_personal_patent_back_end_writing_patents_path), :class => active_for_action('writing_patents', 'index') %>
<%= content_tag :li, link_to(t('personal_patent.setting'), panel_personal_patent_back_end_writing_patent_setting_path), :class => active_for_action('writing_patent_setting', 'index') %>
<%#= content_tag :li, link_to(t('personal_patent.writing_patent_category'), panel_personal_patent_back_end_writing_patent_categorys_path), :class => active_for_action('writing_patent_categorys', 'index') %>
<%= content_tag :li, link_to(t('personal_patent.tags'), panel_personal_patent_back_end_tags_path), :class => active_for_action('/panel/personal_patent/back_end/tags', 'index') %>
<% end -%>
<% end -%>
<div class="content">
<% flash.each do |key, msg| %>
<%= content_tag :span, msg, :class => [key, "notice label label-warning"] %>