二级域名帖子列表两种形式区分
This commit is contained in:
parent
6635ded1e8
commit
5fb5a2e8bc
|
@ -1,6 +1,11 @@
|
|||
class SubDomainsController < ApplicationController
|
||||
layout 'base_org'
|
||||
before_filter :find_org_subfield_and_subdomain, :only => [:show, :index]
|
||||
before_filter :find_org_subfield_and_subdomain, :only => [:show, :index, :new]
|
||||
|
||||
def new
|
||||
@subdomain = SubDomain.new
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
if SubDomain.where("org_subfield_id=#{params[:org_subfield_id]} and name=?",params[:name]).count == 0
|
||||
|
@ -24,7 +29,7 @@ class SubDomainsController < ApplicationController
|
|||
|
||||
def show
|
||||
@subfield_content = @organization.org_subfields.order("priority")
|
||||
render layout: 'base_sub_domain'
|
||||
render layout: @organization.switch_type ? 'base_sub_domain' : 'base_org'
|
||||
end
|
||||
|
||||
def index
|
||||
|
|
|
@ -97,8 +97,8 @@
|
|||
<span class="fr">|</span>
|
||||
<a href="javascript:void(0);" class="linkGrey fr ml5 mr5" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
|
||||
<span class="fr">|</span>
|
||||
|
||||
<a href="javascript:void(0);" class="linkGrey fr mr5" onclick="org_submain_new('<%= escape_javascript(render :partial => 'sub_domains/new', :locals => {:organization => @organization, :field => field}).html_safe %>');">添加二级目录</a>
|
||||
<!--escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)-->
|
||||
<a href="javascript:void(0);" class="linkGrey fr mr5" onclick="org_submain_new('<%= escape_javascript new_org_subfield_sub_domain_path(:org_subfield_id => field.id, :field => field) %>');">添加二级目录</a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
@ -220,13 +220,13 @@
|
|||
<% end %>
|
||||
|
||||
<script>
|
||||
function org_submain_new(html) {
|
||||
$('#ajax-modal').html(html);
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","50%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
function org_submain_new(url) {
|
||||
alert(url);
|
||||
$.post(
|
||||
url,
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to document.sub_domain.name, org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id=> @org_subfield.id, :sub_domain_id => document.sub_domain.id), :class => "newsBlue" %>
|
||||
TO <%= link_to document.sub_domain.name, organization_path(@organization), :class => "newsBlue" %>
|
||||
|
|
||||
<span style="color:#269ac9;"><%= document.sub_domain.name %></span>
|
||||
<span style="color:#269ac9;"><%=link_to document.sub_domain.name, org_subfield_sub_domain_sub_document_comment_path(document,:org_subfield_id=> @org_subfield.id, :sub_domain_id => document.sub_domain.id), :class => "newsBlue" %></span>
|
||||
<%# if document.organization.home_id == document.id %>
|
||||
<!--<span class="red_homework_btn_cir ml5">已设为首页</span>-->
|
||||
<%# end %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% if @organization.show_mode %>
|
||||
<% if @organization.switch_type %>
|
||||
<% unless @documents.nil? %>
|
||||
<%= render :partial => 'sub_document_comments/show_sub_document_newstyle', :locals => {:documents => @documents} %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% if @organization.show_mode %>
|
||||
<% if @organization.switch_type %>
|
||||
<%= render :partial => 'sub_document_comments/show_newstyle', :locals => {:document => @document} %>
|
||||
<% else %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"create_kindeditor",'blog' %>
|
||||
|
|
|
@ -1,20 +1,3 @@
|
|||
<div class="org-popup-wrap sn-w300"> <a href="javascript:void(0);" class="org-popup-close"></a>
|
||||
<div class="f16 fb fontBlue mb10">添加二级目录</div>
|
||||
<span class="fontGrey3 fb mb5 mr10">二级栏目名称</span>
|
||||
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
|
||||
<ul class="orgAddRole mb10">
|
||||
<li class="fontGrey3 fb ml24 mr10 fl">栏目类型</li>
|
||||
<li class="fl mr15">
|
||||
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
|
||||
<label for="orgMng">帖子</label>
|
||||
</li>
|
||||
<li class="fl mr15">
|
||||
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
|
||||
<label for="orgMeb">资源</label>
|
||||
</li>
|
||||
<li class="cl"></li>
|
||||
</ul>
|
||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText">确定</a></div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="CodeMirror-cursors">
|
||||
test
|
||||
</div>
|
|
@ -0,0 +1,6 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'sub_domains/new',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","50%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -0,0 +1 @@
|
|||
alert("test");
|
Loading…
Reference in New Issue