diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1dfe31e --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.bundle/ +log/*.log +pkg/ +test/dummy/db/*.sqlite3 +test/dummy/log/*.log +test/dummy/tmp/ +test/dummy/.sass-cache diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..51758f2 --- /dev/null +++ b/Gemfile @@ -0,0 +1,17 @@ +source "http://rubygems.org" + +# Declare your gem's dependencies in member.gemspec. +# Bundler will treat runtime dependencies like base dependencies, and +# development dependencies will be added by default to the :development group. +gemspec + +# jquery-rails is used by the dummy application +gem "jquery-rails" + +# Declare any dependencies that are still in development here instead of in +# your gemspec. These might include edge Rails or gems from your path or +# Git. Remember to move these dependencies to your gemspec before releasing +# your gem to rubygems.org. + +# To use debugger +# gem 'debugger' diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..5146945 --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2013 YOURNAME + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..3fdca54 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,3 @@ += Member + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..c0c2818 --- /dev/null +++ b/Rakefile @@ -0,0 +1,40 @@ +#!/usr/bin/env rake +begin + require 'bundler/setup' +rescue LoadError + puts 'You must `gem install bundler` and `bundle install` to run rake tasks' +end +begin + require 'rdoc/task' +rescue LoadError + require 'rdoc/rdoc' + require 'rake/rdoctask' + RDoc::Task = Rake::RDocTask +end + +RDoc::Task.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'Member' + rdoc.options << '--line-numbers' + rdoc.rdoc_files.include('README.rdoc') + rdoc.rdoc_files.include('lib/**/*.rb') +end + +APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +load 'rails/tasks/engine.rake' + + + +Bundler::GemHelper.install_tasks + +require 'rake/testtask' + +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = false +end + + +task :default => :test diff --git a/app/assets/images/member/.gitkeep b/app/assets/images/member/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/member/.gitkeep b/app/assets/javascripts/member/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/member/moduletab.js b/app/assets/javascripts/member/moduletab.js new file mode 100644 index 0000000..9f73de0 --- /dev/null +++ b/app/assets/javascripts/member/moduletab.js @@ -0,0 +1,16 @@ +function moduletab() { + $('.module-nav li').each(function(i) { + if(i == 0) { + $(this).addClass('active'); + $('.module-pane').eq(i).addClass('active') + }; + var id = $(this).find('a').attr('href'); + $(this).find('a').on('click', function(event) { + event.preventDefault(); + $(this).closest('li').addClass('active').siblings().removeClass('active').closest('.member-module').find(id).addClass('active').siblings().removeClass('active') + }); + }); +}; +$(function() { + moduletab(); +}); \ No newline at end of file diff --git a/app/assets/stylesheets/member/.gitkeep b/app/assets/stylesheets/member/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/member/default_member.css b/app/assets/stylesheets/member/default_member.css new file mode 100644 index 0000000..0adecda --- /dev/null +++ b/app/assets/stylesheets/member/default_member.css @@ -0,0 +1,125 @@ +.default_member:after { + content: ""; + clear: both; + display: block; + visibility: hidden; +} +.default_member .member-pic { + float: left; + width: 30%; +} +.default_member .member-pic img { + width: 100%; + height: auto; +} +.default_member .member-data { + float: right; + width: 68%; +} +.default_member .member-data table { + width: 100%; + background-color: #fff; +} +.default_member .member-data table td { + padding: 5px; + background-color: #ccc; + border: 1px solid #fff; +} +.default_member .member-data table td + td { + background-color: #ededed; +} +.default_member .member-module { + clear: both; + padding-top: 30px; +} +.default_member .member-module .module-nav ul { + margin: 0; + padding: 0; + list-style: none; + border-bottom: 1px solid #ccc; +} +.default_member .member-module .module-nav ul:after { + content: ""; + clear: both; + display: block; + height: 0; + visibility: hidden; +} +.default_member .member-module .module-nav ul li { + float: left; + display: inline-block; + margin-right: 3px; + margin-bottom: 5px; +} +.default_member .member-module .module-nav ul li a { + padding: 5px 8px; + line-height: 30px; + height: 30px; + border-radius: 3px; + text-decoration: none; + background-color: #DDD; +} +.default_member .member-module .module-nav ul li.active a { + background-color: #0088CE; + color: #FFF; +} +.default_member .member-module .module-content { + position: relative; + margin-bottom: 20px; +} +.default_member .member-module .module-content .module-pane { + display: none; + top: 0; + left: 0; +} +.default_member .member-module .module-content .module-pane table { + width: 100%; +} +.default_member .member-module .module-content .module-pane.active { + display: block; +} + + + + + + +[class*="grid"] + [class*="grid"] { + margin-left: 2.12766%; +} +.grid12 { + width: 100%; +} +.grid11 { + width: 91.4894%; +} +.grid10 { + width: 82.9787%; +} +.grid9 { + width: 74.4681%; +} +.grid8 { + width: 65.9574%; +} +.grid7 { + width: 57.4468%; +} +.grid6 { + width: 48.9362%; +} +.grid5 { + width: 40.4255%; +} +.grid4 { + width: 31.9149%; +} +.grid3 { + width: 23.4043%; +} +.grid2 { + width: 14.8936%; +} +.grid1 { + width: 6.38298%; +} \ No newline at end of file diff --git a/app/assets/stylesheets/member/members.css b/app/assets/stylesheets/member/members.css new file mode 100755 index 0000000..ca22c52 --- /dev/null +++ b/app/assets/stylesheets/member/members.css @@ -0,0 +1,125 @@ +.o-members {} +.o-members-category { + border-left: solid 8px #EEE; + border-bottom: solid 1px #EEE; + margin: 32px 0; + padding: 0 0 0 16px; +} +.o-members-category:first-child { + margin-top: 0; +} +.o-members-nav { + margin: 0 0 10px; + padding: 0; + list-style: none; +} +.o-members-nav:after { + content: ""; + clear: both; + display: block; + height: 0; + visibility: hidden; +} +.o-members-nav li { + float: left; +} +.o-members-nav li + li { + margin-left: 8px; +} +.o-members-nav li a { + display: inline-block; + line-height: 23px; + padding: 5px 8px; + height: 23px; + background-color: #ccc; + border-radius: 3px; +} +.o-members-nav li.active a { + color: #FFF; + background-color: #0088CE; +} +.o-members-list { + list-style: none; + margin: 0; + padding: 0; +} +.o-members-list > li { + margin: 24px 0 0 0; +} +.o-members-list > li.odd {} +.o-members-list > li:after { + display: table; + width: 100%; + content: ""; + clear: both; +} +.o-members-list > li:first-child { + margin: 0; +} +.o-members-pic { + float: left; + margin: 0 16px 0 0; +} +.o-members-pic img { + display: block; + width: 150px; + height: auto; +} +.o-members-info { + list-style: none; + margin: 0; + padding: 0; + float: left; +} +.o-members-info li {} +.o-members-label {} +.o-members-label:after { + display: inline-block; + width: 20px; + content: ":"; +} +.o-members-link { + font-weight: bold; +} + +/* columns view */ +.view-columns.o-members.view-columns {} +.view-columns .o-members-category {} +.view-columns .o-members-list {} +.view-columns .o-members-list:after { + display: table; + width: 100%; + content: ""; + clear: both; +} +.view-columns .o-members-list > li { + border: solid 1px #eee; + float: left; + width: 48%; + margin: 0 0 4% 4%; + + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.view-columns .o-members-list > li.odd { + margin: 0; +} +.view-columns .o-members-pic { + margin: 16px; +} +.view-columns .o-members-pic img { + width: 100px; +} +.view-columns .o-members-info { + padding: 12px; + padding-left: 0; + float: none; +} +.view-columns .o-members-info li {} +.view-columns .o-members-label { + display: none; +} +.view-columns .o-members-link { + font-size: 1.2em; +} diff --git a/app/controllers/.gitkeep b/app/controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..307a4ac --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,23 @@ +class ApplicationController < ActionController::Base + protect_from_forgery + before_filter :set_locale + + # Set I18n.locale + def set_locale + # update session if passed + session[:locale] = params[:locale] if params[:locale] + + # set locale based on session or default + begin + # check if locale is valid for non site pages + if !VALID_LOCALES.include?(session[:locale]) + I18n.locale = I18n.default_locale + else + I18n.locale = session[:locale] + end + rescue + I18n.locale = I18n.default_locale + end + end + +end diff --git a/app/controllers/panel/member/front_end/member_lists_controller.rb b/app/controllers/panel/member/front_end/member_lists_controller.rb new file mode 100644 index 0000000..22d7457 --- /dev/null +++ b/app/controllers/panel/member/front_end/member_lists_controller.rb @@ -0,0 +1,81 @@ +class Panel::Member::FrontEnd::MemberListsController < OrbitWidgetController + + helper MemberHelper + + def initialize + super + @app_title = 'member' + end + + # GET /member_lists + # GET /member_lists.xml + + def index + + @item = Page.find(params[:page_id]) + @title = @item.title + if !@item.frontend_data_count.blank? + @page_num = @item.frontend_data_count + else + @page_num = 10 + end + + date_now = Time.now + + @role_id = RoleStatus.get_role_data("teacher") + + @member_role = Role.where(:_id => @role_id) + + @member_subroles = SubRole.where(:role_id => @role_id, :disabled => false) + + @member_list_categorys = RoleCategory.can_display.any_in(:_id => params[:tag_id]).asc("key") + + @member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key") + + @mlcs = @member_list_categorys.map{|category| category.id.to_s } + + @mcs = params[:mcid].blank? ? @mlcs.first : params[:mcid] + + if !@member_list_categorys.blank? or !@member_status.blank? + + if !@mcs.blank? and @mlcs.include?(@mcs) + @member_lists = User.where(:role_ids => @role_id,:role_category_ids => @mcs).asc(:position) + else + @member_lists = User.where(:role_ids => @role_id).asc(:position) + end + else + # @member_lists = User.where(:role_ids => @role_id) + @member_lists = '' + end + + end + + def show + @member = User.find(params[:id]) + + @plugins = OrbitApp::Plugin::Registration.all + + @ppname = Array.new + @plugins.each do |aa| + @ppname << [aa.sort_number.to_i, [aa.name, aa.app_name, aa.intro_app_name, aa.front_partial_path]] + end + @plugin_shows = @ppname.sort.collect {|v| {"name"=>v[1][0],"app_name"=>v[1][1],"intro_app_name"=>v[1][2],"front_partial_path"=>v[1][3]} } + + + @profile_data = [] + + attribute_values = @member.attribute_values.asc("_id") + attribute_values.each{|att_val| + @profile_data.push({:name => att_val.attribute_field.title,:value =>att_val.get_value_by_locale(I18n.locale.to_s)}) if att_val.attribute_field.attribute.key=="profile" and att_val.attribute_field.to_show != false rescue false + } + + end + + + protected + + # def get_categorys + # @member_list_categorys = MemberListCategory.excludes('disable' => true) + # end + +end diff --git a/app/controllers/panel/member/widget/web_links_controller.rb b/app/controllers/panel/member/widget/web_links_controller.rb new file mode 100644 index 0000000..f4b0af4 --- /dev/null +++ b/app/controllers/panel/member/widget/web_links_controller.rb @@ -0,0 +1,80 @@ +class Panel::WebResource::Widget::WebLinksController < OrbitWidgetController + def initialize + super + @app_title = 'web_resource' + end + + # GET /web_links + # GET /web_links.xml + + + def index + + @part = PagePart.find(params[:part_id]) + + if @part.widget_data_count + @page_num = @part.widget_data_count + else + @page_num = 4 + end + + if @part.widget_field + @widget_fields = @part.widget_field + else + @widget_fields = [] + end + + @widget_style = @part.widget_style + + @category_id = @part.category + + date_now = Time.now + + if !params[:category_id].blank? + @web_links = WebLink.all.can_display.available_for_lang(I18n.locale).any_in(:web_link_category => params[:category_id]).merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :postdate ).page( params[:page_main] ).per(@page_num) + @web_link_categorys = WebLinkCategory.any_in(:_id => params[:category_id]).excludes('disable' => true) + elsif !params[:tag_id].blank? + @web_links = WebLink.all.can_display.available_for_lang(I18n.locale).any_in(:tagged_ids => params[:tag_id]).merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :postdate ).page( params[:page_main] ).per(@page_num) + get_categorys + else + @web_links = WebLink.all.can_display.available_for_lang(I18n.locale).merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :postdate ).page( params[:page_main] ).per(@page_num) + get_categorys + end + + end + + + + def home_list + @title = params[:part_title] + + # deadline + + # @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :title).first + + @web_links = WebLink.widget_datas.available_for_lang(I18n.locale).page(params[:page]).per(5) + + # get_categorys + + module_app = ModuleApp.first(:conditions => {:key => 'web_resource'}) + @tags = module_app.tags + + end + + def reload_web_links + @web_links = WebLink.widget_datas.available_for_lang(I18n.locale).page(params[:page]).per(5) + end + + + protected + + def get_categorys + @web_link_categorys = WebLinkCategory.all + end + + def get_tags + module_app = ModuleApp.first(:conditions => {:key => 'web_resource'}) + @tags = module_app.tags + end + +end diff --git a/app/helpers/.gitkeep b/app/helpers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/.gitkeep b/app/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/panel/member/front_end/member_lists/_show_roles.html.erb b/app/views/panel/member/front_end/member_lists/_show_roles.html.erb new file mode 100644 index 0000000..597eae4 --- /dev/null +++ b/app/views/panel/member/front_end/member_lists/_show_roles.html.erb @@ -0,0 +1,30 @@ + + <% show_roles.attribute_fields.where(:disabled=>false, :to_show.ne => false).asc(:_id).each do |rf| %> + + <% + if !@member.get_attribute_value(rf).blank? + if !@member.get_attribute_value(rf)['val'].blank? + @rodata = @member.get_attribute_value(rf)['val'] + elsif !@member.get_attribute_value(rf)[I18n.locale].blank? + @rodata = @member.get_attribute_value(rf)[I18n.locale] + else + @rodata = nil + end + + if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank? and rf.key != 'job_title' + + %> + + + <%= rf.title %> + <%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %> + + + <% end -%> + + <% end -%> + + <% end -%> + + <%= render :partial => 'show_sub_role',:collection=> @member.get_sub_roles_by_role(show_roles)%> + diff --git a/app/views/panel/member/front_end/member_lists/_show_sub_role.html.erb b/app/views/panel/member/front_end/member_lists/_show_sub_role.html.erb new file mode 100644 index 0000000..612c27c --- /dev/null +++ b/app/views/panel/member/front_end/member_lists/_show_sub_role.html.erb @@ -0,0 +1,28 @@ + + + <% show_sub_role.attribute_fields.where(:disabled=>false).asc(:_id).each do |item| %> + + + <% + + if !@member.get_attribute_value(item).blank? + if !@member.get_attribute_value(item)['val'].blank? + @rodata = @member.get_attribute_value(item)['val'] + elsif !@member.get_attribute_value(item)[I18n.locale].blank? + @rodata = @member.get_attribute_value(item)[I18n.locale] + else + @rodata = nil + end + end + + if !@rodata.blank? and !@member.get_attribute_value(item).get_value_by_locale(I18n.locale).blank? + %> + + + <%= item.title %> + <%= nl2br(show_attribute_value(@member.get_attribute_value(item).get_value_by_locale(I18n.locale))) rescue '' %> + + + <% end -%> + + <% end -%> \ No newline at end of file diff --git a/app/views/panel/member/front_end/member_lists/index.html.erb b/app/views/panel/member/front_end/member_lists/index.html.erb new file mode 100644 index 0000000..80fa140 --- /dev/null +++ b/app/views/panel/member/front_end/member_lists/index.html.erb @@ -0,0 +1,111 @@ +<% # encoding: utf-8 %> + +<% if !@member_lists.blank? %> + + <% @job_title_field = @member_lists.get_member_list_attribute_field("teacher","job_title") %> + +
+ +
+
+ + <% if !@member_list_categorys.blank? %> + + <% end %> + + <% if @item.frontend_style == 'Single' %> + +
+ + <%# @member_lists = @member_lists.where(:role_category_ids => @mcs) if !@mcs.blank? and @mlcs.include?(@mcs) %> + + <% @member_status.each do |ms| %> + + <% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %> + +

<%= ms.title %>

+
    + + <% @member_lists.where(:role_status_ids=>ms.id).each do |member| %> + +
  • +
    <%= show_avatar(member) %>
    +
      +
    • <%= t("users.name")%><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %>
    • + <% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale) + if @job_title != 'NoData' and !@job_title.blank? + %> +
    • + <%= @job_title_field.title %> + <%= @job_title %> +
    • + <% end %> +
    • <%= t("users.email")%><%= member.email %>
    • + <% if !member.office_tel.blank? %> +
    • <%= t("users.office_tel")%><%= member.office_tel %>
    • + <% end %> +
    +
  • + + <% end %> + +
+ + <% end %> + + <% end %> + +
+ + <% elsif @item.frontend_style == 'Two' or @item.frontend_style.blank? %> + +
+ + <%# @member_lists = @member_lists.where(:role_category_ids => @mcs) if !@mcs.blank? %> + + <% @member_status.each do |ms| %> + + <% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %> + +

<%= ms.title %>

+
    + + <% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %> + +
  • > +
    <%= show_avatar(member) %>
    +
      +
    • <%= t("users.name")%><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %>
    • + <% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale) + if @job_title != 'NoData' and !@job_title.blank? + %> +
    • <%= @job_title_field.title %><%= @job_title %>
    • + <% end %> +
    • <%= t("users.email")%> <%= member.email %>
    • + <% if !member.office_tel.blank? %> +
    • <%= t("users.office_tel")%><%= member.office_tel %>
    • + <% end %> +
    +
  • + + <% end %> + +
+ + <% end %> + + <% end %> + +
+ + <% end %> +
+
+ +<% end %> + +<%#= stylesheet_link_tag "member/members" %> diff --git a/app/views/panel/member/front_end/member_lists/index.js.erb b/app/views/panel/member/front_end/member_lists/index.js.erb new file mode 100644 index 0000000..c5efda6 --- /dev/null +++ b/app/views/panel/member/front_end/member_lists/index.js.erb @@ -0,0 +1 @@ +alert('bob'); \ No newline at end of file diff --git a/app/views/panel/member/front_end/member_lists/show.html.erb b/app/views/panel/member/front_end/member_lists/show.html.erb new file mode 100644 index 0000000..1fd954b --- /dev/null +++ b/app/views/panel/member/front_end/member_lists/show.html.erb @@ -0,0 +1,132 @@ +
+
+ + + + <% @job_title_field = User.get_member_list_attribute_field("teacher","job_title") %> + + <% + @member_role = @member.roles.where(:key=>"teacher", :disabled=>false) + @category = @member.role_categorys.where(:role_id=>@member_role[0]['_id']) + + if !@category.blank? + %> + + + + + + <% end -%> + + <% + @job_title = show_attribute_value(User.get_member_list_attribute_value(@member.id,@job_title_field.id).get_value_by_locale(I18n.locale)) + if @job_title != 'NoData' and !@job_title.blank? and @job_title_field.to_show == true + %> + + + + + <% end -%> + + + + + + + + + + <% if !@member.office_tel.blank? %> + + + + + <% end %> + + <% @profile_data.each do |item| %> + <% if !item[:value].blank? %> + + + + + <% end -%> + <% end -%> + + <%= render :partial=> "show_roles",:collection=>@member_role %> + + +
<%= t('category')%><%= show_attribute_value(@member.role_categorys.where(:role_id=>@member_role[0]['_id']).map{|t|t.title.to_s}.join(',')) rescue '' %>
<%= @job_title_field.title %><%= @job_title %>
<%= t('users.name')%><%= @member.name%>
<%= t('users.email')%><%= @member.email %>
<%= t('users.office_tel')%><%= @member.office_tel%>
<%= item[:name] %><%= show_attribute_value(item[:value]) %>
+
+ +
+ <%= image_tag(@member.avatar) %> +
+ +
+
+
    + <% + @plugin_shows.each do |plugin| + + @data = plugin["app_name"].classify.constantize.where(is_hidden: false, :create_user_id=>@member.id) + @intro_data = plugin["intro_app_name"].classify.constantize.where(:user_id=>@member.id).first + %> + + <% if !@intro_data.blank? %> + + <% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %> +
  • "><%= plugin["name"] %>
  • + <% end %> + + <% else %> + + <% if !@data.blank? %> +
  • "><%= plugin["name"] %>
  • + <% end %> + + <% end %> + + <% end %> +
+
+
+ <% + @plugin_shows.each do |plugin| + + @plugin_partial = !plugin["front_partial_path"].blank? ? OrbitApp::Plugin::Registration.find_by_key(plugin["name"]).front_partial_path : nil + + @data = plugin["app_name"].classify.constantize.where(:create_user_id=>@member.id) + @intro_data = plugin["intro_app_name"].classify.constantize.where(:user_id=>@member.id).first + %> + + <% if !@intro_data.blank? %> + + <% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %> +
"> + <%= render :partial => @plugin_partial if !@plugin_partial.blank? %> +
+ <% end %> + + <% else %> + + <% if !@data.blank? %> +
"> + <%= render :partial => @plugin_partial if !@plugin_partial.blank? %> +
+ <% end %> + + <% end %> + + <% end %> + +
+ +
+ +
+ + +<%= stylesheet_link_tag "member/default_member" %> + +<%= javascript_include_tag "member/moduletab" %> + diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..278a324 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,8 @@ +en: + + member: + member: Teacher + frontend: + member: Teacher Front-end + widget: + index: Teacher Widget \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml new file mode 100644 index 0000000..29cba70 --- /dev/null +++ b/config/locales/zh_tw.yml @@ -0,0 +1,8 @@ +zh_tw: + + member: + member: 教師 + frontend: + member: 教師前台 + widget: + index: 教師Widget \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..a43bf97 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,21 @@ +Rails.application.routes.draw do + namespace :panel do + namespace :member do + namespace :back_end do + resources :member_lists do + collection do + get 'delete' + end + end + end + namespace :front_end do + match "member_lists" => "member_lists#index" + resources :member_lists + end + namespace :widget do + match "index" => "member_lists#index" + end + end + end + match "/appfront/*path" => redirect("/panel/*path") +end \ No newline at end of file diff --git a/lib/member.rb b/lib/member.rb new file mode 100644 index 0000000..ce023dd --- /dev/null +++ b/lib/member.rb @@ -0,0 +1,4 @@ +require "member/engine" + +module Member +end diff --git a/lib/member/engine.rb b/lib/member/engine.rb new file mode 100644 index 0000000..ce1f24d --- /dev/null +++ b/lib/member/engine.rb @@ -0,0 +1,28 @@ +module Member + class Engine < ::Rails::Engine + initializer "member" do + OrbitApp.registration "Member",:type=> 'ModuleApp' do + module_label 'member.member' + base_url File.expand_path File.dirname(__FILE__) + + version "0.1" + organization "Rulingcom" + author "RD dep" + intro "I am intro" + update_info 'some update_info' + + front_end do + app_page 'member_lists' do + frontend_i18n "member.frontend.member" + style ["Single","Two"] + end + end + + + widgets do + categories_query 'RoleStatus.where(:role_id=> RoleStatus.get_role_data("teacher") )' + end + end + end + end +end diff --git a/lib/member/version.rb b/lib/member/version.rb new file mode 100644 index 0000000..0550522 --- /dev/null +++ b/lib/member/version.rb @@ -0,0 +1,3 @@ +module Member + VERSION = "0.0.1" +end diff --git a/lib/tasks/member_tasks.rake b/lib/tasks/member_tasks.rake new file mode 100644 index 0000000..a2dcefd --- /dev/null +++ b/lib/tasks/member_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :member do +# # Task goes here +# end diff --git a/member.gemspec b/member.gemspec new file mode 100644 index 0000000..d53f151 --- /dev/null +++ b/member.gemspec @@ -0,0 +1,23 @@ +$:.push File.expand_path("../lib", __FILE__) + +# Maintain your gem's version: +require "member/version" + +# Describe your gem and declare its dependencies: +Gem::Specification.new do |s| + s.name = "member" + s.version = Member::VERSION + s.authors = ["RulingDigital"] + s.email = ["service@rulingcom.com"] + s.homepage = "http://www.rulingcom.com" + s.summary = "" + s.description = "Orbit Member module" + + s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] + s.test_files = Dir["test/**/*"] + + # s.add_dependency "rails", "~> 3.2.12" + # s.add_dependency "jquery-rails" + + s.add_development_dependency "sqlite3" +end diff --git a/script/rails b/script/rails new file mode 100755 index 0000000..7ead364 --- /dev/null +++ b/script/rails @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +ENGINE_ROOT = File.expand_path('../..', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/member/engine', __FILE__) + +require 'rails/all' +require 'rails/engine/commands'