Merge branch 'szzh' into develop
This commit is contained in:
commit
26e3d6f863
|
@ -100,4 +100,13 @@ class OrganizationsController < ApplicationController
|
|||
def members
|
||||
@members = OrgMember.where("organization_id =?", @organization.id)
|
||||
end
|
||||
|
||||
def more_org_projects
|
||||
@organization = Organization.find params[:id]
|
||||
@page = params[:page]
|
||||
@org_projects = @organization.org_projects.reorder('created_at').page((params[:page].to_i || 1) +1).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<% projects.each do |project|%>
|
||||
<% pro = Project.find project.project_id %>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<%= link_to pro.name, project_path(pro.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => pro.name%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if projects.size == 5%>
|
||||
<li class="homepageLeftMenuMore" id="show_more_org_project">
|
||||
<input type="hidden" value="<%= page%>" id="org_project_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%= more_org_projects_organization_path(org_id)%>');"></a>
|
||||
</li>
|
||||
<% end%>
|
|
@ -50,13 +50,9 @@
|
|||
<% end %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="orgName fl mb5 f14">组织id:<%= @organization.id %></div>
|
||||
<% if User.current.admin_of_org?(@organization) %>
|
||||
<a href="<%= setting_organization_path(@organization) %>" class="pr_join_a c_white"><span class="pr_setting"></span>配置</a>
|
||||
<% end %>
|
||||
|
||||
<div style="clear:both;">
|
||||
<%= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||
<!--<div class="orgName fl mb5 f14">组织id:<%#= @organization.id %></div>-->
|
||||
<div class="orgName fl mb5 f14">
|
||||
<%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||
<% if @organization.is_public? %>
|
||||
<span class="img_private"><%= l(:label_public)%></span>
|
||||
<% else %>
|
||||
|
@ -64,6 +60,19 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if User.current.admin_of_org?(@organization) %>
|
||||
<a href="<%= setting_organization_path(@organization) %>" class="pr_join_a c_white"><span class="pr_setting"></span>配置</a>
|
||||
<% end %>
|
||||
|
||||
<!--<div style="clear:both;">-->
|
||||
<!--<%#= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>-->
|
||||
<!--<%# if @organization.is_public? %>-->
|
||||
<!--<span class="img_private"><%#= l(:label_public)%></span>-->
|
||||
<!--<%# else %>-->
|
||||
<!--<span class="img_private"><%#= l(:label_private)%></span>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="f12 fontGrey3">
|
||||
<%= link_to '文章', organization_org_document_comments_path(@organization) %> (
|
||||
|
@ -76,17 +85,18 @@
|
|||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
|
||||
</div>
|
||||
<!--<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">项目</a><a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a></div>-->
|
||||
<!--<div class="homepageLeftMenuCourses borderBottomNone">-->
|
||||
<!--<ul style="display:none;">-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称一</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称二</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称三</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称四</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称五</a></li>-->
|
||||
<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">项目</a>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a>-->
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses borderBottomNone">
|
||||
<ul >
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>@organization.org_projects.reorder('created_at').limit(5),:org_id=>@organization.id,:page=>1}%>
|
||||
<!--<%#= @organization.org_projects.each do |p|%>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey"><%#= p.name%></a></li>-->
|
||||
<!--<%# end %>-->
|
||||
<!--<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
$("#organization_document_<%= @document.id %>").html("");
|
||||
$("#organization_document_<%= @document.id %>").html("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>");
|
||||
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>");
|
||||
init_activity_KindEditor_data(<%= @document.id %>,"","87%");
|
|
@ -21,6 +21,7 @@
|
|||
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" maxlength="250" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
|
||||
</div>
|
||||
<div id="doc_title_hint"></div>
|
||||
<div class="cl"></div>
|
||||
<div id="org_document_editor" class="mt15" style="">
|
||||
<div class="mt10">
|
||||
<%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org_document_description_editor', :height => "150px" %>
|
||||
|
|
|
@ -16,12 +16,9 @@
|
|||
<% @documents.each do |document| %>
|
||||
<script>
|
||||
$(function() {
|
||||
console.log(111)
|
||||
init_activity_KindEditor_data(<%= document.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<p id="organization_document_<%= document.id %>">
|
||||
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,4 +1,4 @@
|
|||
<div class="resources mt10">
|
||||
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
|
||||
|
@ -6,8 +6,9 @@
|
|||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> |
|
||||
<% if defined?(home_id) %>
|
||||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
||||
|
|
||||
<% if document.organization.home_id == document.id %>
|
||||
<span style="color:#269ac9;">首页</span>
|
||||
<% else %>
|
||||
<span style="color:#269ac9;">组织</span>
|
||||
|
@ -46,10 +47,10 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% comments_for_doc = document.children.reorder("created_at desc") %>
|
||||
<% count = document.children.count() %>
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#show_more_org_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/org_projects',:locals => {:projects => @org_projects,:org_id => @organization, :page => @page} )%>");
|
|
@ -30,9 +30,8 @@
|
|||
init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<p id="organization_document_<%= @organization.home_id %>">
|
||||
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% unless @activities.nil? %>
|
||||
|
@ -52,15 +51,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<p id="organization_document_<%= act.org_act.id %>" style="mt10">
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<ul class="wlist" style=" border:none; padding-top: 15px;">
|
||||
|
@ -69,3 +66,4 @@
|
|||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'clear_org_avatar_temp'
|
||||
put 'set_homepage'
|
||||
get 'members'
|
||||
get 'more_org_projects'
|
||||
end
|
||||
collection do
|
||||
get 'check_uniq'
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20151110011003) do
|
||||
ActiveRecord::Schema.define(:version => 20151112072948) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -960,6 +960,7 @@ ActiveRecord::Schema.define(:version => 20151110011003) do
|
|||
t.datetime "created_on"
|
||||
t.integer "comments_count", :default => 0, :null => false
|
||||
t.integer "course_id"
|
||||
t.integer "sticky", :default => 0
|
||||
end
|
||||
|
||||
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//添加组织成员的提交函数
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
function submit_add_org_members(){
|
||||
$("#org_member_add_form").submit();
|
||||
}
|
||||
|
@ -32,3 +32,14 @@ function observeSearchfield(fieldId, targetId, url) {
|
|||
$this.bind('keyup click mousemove', reset);
|
||||
});
|
||||
}
|
||||
|
||||
//显示更多的项目
|
||||
function show_more_org_project(url){
|
||||
$.get(
|
||||
url,
|
||||
{ page: $("#org_project_page_num").val() },
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue