Orbit Member Module
This commit is contained in:
parent
a307120e1f
commit
679e75cffe
|
@ -0,0 +1,7 @@
|
|||
.bundle/
|
||||
log/*.log
|
||||
pkg/
|
||||
test/dummy/db/*.sqlite3
|
||||
test/dummy/log/*.log
|
||||
test/dummy/tmp/
|
||||
test/dummy/.sass-cache
|
|
@ -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'
|
|
@ -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.
|
|
@ -0,0 +1,3 @@
|
|||
= Member
|
||||
|
||||
This project rocks and uses MIT-LICENSE.
|
|
@ -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
|
|
@ -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();
|
||||
});
|
|
@ -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%;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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'
|
||||
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td><%= rf.title %></td>
|
||||
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||
</tr>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<%= render :partial => 'show_sub_role',:collection=> @member.get_sub_roles_by_role(show_roles)%>
|
||||
|
|
@ -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?
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td><%= item.title %></td>
|
||||
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(item).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||
</tr>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<% end -%>
|
|
@ -0,0 +1,111 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
<% if !@member_lists.blank? %>
|
||||
|
||||
<% @job_title_field = @member_lists.get_member_list_attribute_field("teacher","job_title") %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
<div class="main">
|
||||
|
||||
<% if !@member_list_categorys.blank? %>
|
||||
<ul class="o-members-nav">
|
||||
<% @member_list_categorys.each do |mc| %>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s or @mcs.to_s == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% if @item.frontend_style == 'Single' %>
|
||||
|
||||
<div class="o-members">
|
||||
|
||||
<%# @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 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
<ul class="o-members-list">
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each do |member| %>
|
||||
|
||||
<li class="odd">
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<% @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?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||
<% if !member.office_tel.blank? %>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% elsif @item.frontend_style == 'Two' or @item.frontend_style.blank? %>
|
||||
|
||||
<div class="o-members view-columns">
|
||||
|
||||
<%# @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 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
<ul class="o-members-list">
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
|
||||
|
||||
<li <%= ( (i + 1) % 2 != 0 ) ? "class=odd" : '' %>>
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<% @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?
|
||||
%>
|
||||
<li><b class="o-members-label"><%= @job_title_field.title %></b><%= @job_title %></li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
|
||||
<% if !member.office_tel.blank? %>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%#= stylesheet_link_tag "member/members" %>
|
|
@ -0,0 +1 @@
|
|||
alert('bob');
|
|
@ -0,0 +1,132 @@
|
|||
<div class="default_member">
|
||||
<div class="member-data">
|
||||
<table>
|
||||
<tbody>
|
||||
|
||||
<% @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?
|
||||
%>
|
||||
<tr>
|
||||
<td><%= t('category')%></td>
|
||||
<td><%= show_attribute_value(@member.role_categorys.where(:role_id=>@member_role[0]['_id']).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
|
||||
</tr>
|
||||
|
||||
<% 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
|
||||
%>
|
||||
<tr>
|
||||
<td><%= @job_title_field.title %></td>
|
||||
<td><%= @job_title %></td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
|
||||
<tr>
|
||||
<td><%= t('users.name')%></td>
|
||||
<td><%= @member.name%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t('users.email')%></td>
|
||||
<td><a href="mailto:<%= @member.email %>"><%= @member.email %></a></td>
|
||||
</tr>
|
||||
<% if !@member.office_tel.blank? %>
|
||||
<tr>
|
||||
<td><%= t('users.office_tel')%></td>
|
||||
<td><%= @member.office_tel%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% @profile_data.each do |item| %>
|
||||
<% if !item[:value].blank? %>
|
||||
<tr>
|
||||
<td><%= item[:name] %></td>
|
||||
<td><%= show_attribute_value(item[:value]) %></td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<%= render :partial=> "show_roles",:collection=>@member_role %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="member-pic">
|
||||
<%= image_tag(@member.avatar) %>
|
||||
</div>
|
||||
|
||||
<div class="member-module">
|
||||
<div class="module-nav">
|
||||
<ul>
|
||||
<%
|
||||
@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? %>
|
||||
<li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<% if !@data.blank? %>
|
||||
<li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<%
|
||||
@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? %>
|
||||
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
|
||||
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<% if !@data.blank? %>
|
||||
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
|
||||
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<%= stylesheet_link_tag "member/default_member" %>
|
||||
|
||||
<%= javascript_include_tag "member/moduletab" %>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
en:
|
||||
|
||||
member:
|
||||
member: Teacher
|
||||
frontend:
|
||||
member: Teacher Front-end
|
||||
widget:
|
||||
index: Teacher Widget
|
|
@ -0,0 +1,8 @@
|
|||
zh_tw:
|
||||
|
||||
member:
|
||||
member: 教師
|
||||
frontend:
|
||||
member: 教師前台
|
||||
widget:
|
||||
index: 教師Widget
|
|
@ -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
|
|
@ -0,0 +1,4 @@
|
|||
require "member/engine"
|
||||
|
||||
module Member
|
||||
end
|
|
@ -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
|
|
@ -0,0 +1,3 @@
|
|||
module Member
|
||||
VERSION = "0.0.1"
|
||||
end
|
|
@ -0,0 +1,4 @@
|
|||
# desc "Explaining what the task does"
|
||||
# task :member do
|
||||
# # Task goes here
|
||||
# end
|
|
@ -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
|
|
@ -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'
|
Loading…
Reference in New Issue