From c4316583339226461569c98689cc48424d3882ab Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 31 Mar 2016 16:19:59 +0800 Subject: [PATCH] =?UTF-8?q?setting=E4=B8=AD=E5=90=8E=E5=8F=B0=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 8 +- app/views/layouts/base_org_newstyle.html.erb | 193 +++++++++++------- .../organizations/_subfield_list.html.erb | 23 ++- .../organizations/hide_org_subfield.js.erb | 2 +- .../organizations/show_org_subfield.js.erb | 2 +- db/schema.rb | 4 +- public/stylesheets/org.css | 7 +- public/stylesheets/org_new_style.css | 2 + 8 files changed, 147 insertions(+), 94 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 59f32bda0..84b38e628 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -63,12 +63,12 @@ module OrganizationsHelper def subfield_status_option type = [] option1 = [] - option1 << 0 - option1 << 0 + option1 << "列表" + option1 << "1" type << option1 option2 = [] - option2 << 1 - option2 << 1 + option2 << "图片" + option2 << "0" type << option2 type end diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index 7b3bdb754..f2210ae3a 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -110,75 +110,103 @@ <% if is_default_field?(field) %> <% case field.name %> <% when 'course' %> + + +
- <% if false %> + <% if field.status == 0 %>

课程动态

course activities

-
-
    - <% unless @course_acts_homework.nil? %> -
  • - <% @course_acts_homework.each do |act| %> - <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id, :course_activity => 0} %> - <% end %> -
  • - <% end %> + <% if @course_acts.nil? %> + + <% else %> +
    +
      + <% unless @course_acts_homework.nil? %> +
    • + <% @course_acts_homework.each do |act| %> + <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id, :course_activity => 0} %> + <% end %> +
    • + <% end %> <% unless @course_acts_message.nil? %> -
    • - <% @course_acts_message.each do |act| %> - <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id), :user_activity_id =>act.id} %> - <% end %> -
    • - <% end %> - <% unless @course_acts_news.nil? %> -
    • - <% @course_acts_news.each do |act| %> - <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id), :user_activity_id =>act.id} %> - <% end %> -
    • - <% end %> +
    • + <% @course_acts_message.each do |act| %> + <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id), :user_activity_id =>act.id} %> + <% end %> +
    • + <% end %> + <% unless @course_acts_news.nil? %> +
    • + <% @course_acts_news.each do |act| %> + <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id), :user_activity_id =>act.id} %> + <% end %> +
    • + <% end %> +
      +
    +
    +
    + <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
    -
-
+ <% end %> + +
<% else %>

课程动态

-
+ <% if @course_acts.nil? %> + + <% else %> +
<%= render :partial => 'organizations/org_new_course_act_list', :locals =>{:activities => @course_acts, :field => field, :organization => @organization} %> - -
-
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> -
+ +
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
+ <% end %> + +
<% end %>
<% when 'project' %> - <% if true %> + <% if field.status == 0 %>

项目动态

-
-
    - <% unless @project_acts.nil? %> - - <%= render :partial => 'organizations/org_new_project_pic', :locals => {:activities => @project_acts} %> + <% if @project_acts.nil? %> + + <% else %> +
    +
      + <% unless @project_acts.nil? %> + <%= render :partial => 'organizations/org_new_project_pic', :locals => {:activities => @project_acts} %> + <% end %> +
      + <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
      +
    +
    + <% end %> - <% end %> -
    -
-
<% else %>

<%= field.name %>

-
- <%= render :partial => 'organizations/org_new_project_act_list', :locals =>{:activities => @project_acts, :field => field, :organization => @organization} %> - -
-
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> -
+ <% if @project_acts.nil? %> + + <% else %> +
+ <%= render :partial => 'organizations/org_new_project_act_list', :locals =>{:activities => @project_acts, :field => field, :organization => @organization} %> + +
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
+ <% end %> +
<% end %> @@ -188,31 +216,43 @@ <% message_ats = get_message_org(@organization.id, field.id) %> <% ids = field.org_document_comments.map{|o| o.id}.join(",") %>
- <% if false %> + <% if field.status == 0 %>

<%= field.name %>

-
-
    + <% if message_ats.nil? %> + + <% else %> +
    +
      + + <% message_ats.each do |act| %> + <%= render :partial => 'organizations/org_new_forum_pic', :locals => {:activity => act, :field => field, :organization => @organization} %> + <% end %> +
      +
    + <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
    +
    + <% end %> - <% message_ats.each do |act| %> - <%= render :partial => 'organizations/org_new_forum_pic', :locals => {:activity => act, :field => field, :organization => @organization} %> - <% end %> -
    -
-
<% else %>

<%= field.name %>

-
- <% message_ats.each do |act| %> - <%= render :partial => 'organizations/org_new_forum_list', :locals => {:activity => act, :field => field, :organization => @organization} %> - <% end %> - -
-
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> -
+ <% if message_ats.nil? %> + + <% else %> +
+ <% message_ats.each do |act| %> + <%= render :partial => 'organizations/org_new_forum_list', :locals => {:activity => act, :field => field, :organization => @organization} %> + <% end %> + +
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
+ <% end %> +
<% end %> @@ -221,15 +261,20 @@ <% org_attachs = get_attach_org2(field) %>
-

<%= field.name %>

resource dwonload

-
- <%= render :partial => 'organizations/org_new_resource', :locals => {:org_attachs => org_attachs} %> - -
+

<%= field.name %>

+ <% if org_attachs.nil? %> + + <% else %> +
+ <%= render :partial => 'organizations/org_new_resource', :locals => {:org_attachs => org_attachs} %> + +
+ +
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
+ <% end %> -
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> -
diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 6a405e73a..e16e91486 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -2,7 +2,7 @@
  • 顺序
  • 已有栏目
  • 状态
  • -
  • 排列
  • +
  • 排列
  • 类型
  • 域名目录
  • @@ -22,9 +22,9 @@
  • <%= name %>
  • 默认
  • -
  • +
  • <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %> -
    +
    <%= select( :name,:group_id, subfield_status_option, @@ -33,7 +33,7 @@ <% end %>
  • 默认
  • - <%= field.hide==0?"设为隐藏":"设为可见" %> + <%= field.hide==0?"隐藏":"可见" %>
    <% else %> @@ -53,15 +53,20 @@
  • 新增
  • -
  • +
  • + <% if field.field_type == "Resource" %> + 列表 + <% else %> <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %> -
    +
    <%= select( :name,:group_id, subfield_status_option, { :include_blank => false,:selected => field.status}, - {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:30px;"}) %> + {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:40px;"}) %> <% end %> + + <% end %>
  • <%= field.field_type == "Post" ? "帖子" : "资源" %>
  • <%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %> - <%= field.hide==0?"设为隐藏":"设为可见" %> + <%= field.hide==0?"隐藏":"可见" %> <%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %> 编辑 @@ -195,7 +200,7 @@ $(edit_id).hide(); } function hide(content, id){ - if (content.text() == '设为隐藏') + if (content.text() == '隐藏') $.ajax({ url: "/organizations/hide_org_subfield?org_subfield_id=" + id, type: "post" diff --git a/app/views/organizations/hide_org_subfield.js.erb b/app/views/organizations/hide_org_subfield.js.erb index 18241c269..4affb39fb 100644 --- a/app/views/organizations/hide_org_subfield.js.erb +++ b/app/views/organizations/hide_org_subfield.js.erb @@ -1,2 +1,2 @@ -$("#hide_<%= @org_subfield.id %>").text("设为可见"); +$("#hide_<%= @org_subfield.id %>").text("可见"); $("#org_subfield_<%= @org_subfield.id %>").css("display", "none"); \ No newline at end of file diff --git a/app/views/organizations/show_org_subfield.js.erb b/app/views/organizations/show_org_subfield.js.erb index 165b07afd..78b404b6f 100644 --- a/app/views/organizations/show_org_subfield.js.erb +++ b/app/views/organizations/show_org_subfield.js.erb @@ -1,2 +1,2 @@ -$("#hide_<%= @org_subfield.id %>").text("设为隐藏"); +$("#hide_<%= @org_subfield.id %>").text("隐藏"); $("#org_subfield_<%= @org_subfield.id %>").css("display", "block"); \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 732a42c6f..a3fb50eca 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160331060004) do +ActiveRecord::Schema.define(:version => 20160331063938) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1289,6 +1289,7 @@ ActiveRecord::Schema.define(:version => 20160331060004) do t.datetime "updated_at", :null => false t.string "field_type" t.integer "hide", :default => 0 + t.integer "status", :default => 1 end create_table "organizations", :force => true do |t| @@ -1302,7 +1303,6 @@ ActiveRecord::Schema.define(:version => 20160331060004) do t.boolean "allow_guest_download", :default => true t.integer "visits", :default => 0 t.integer "show_mode", :default => 0 - t.integer "type", :default => 1 end create_table "phone_app_versions", :force => true do |t| diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index f2a3dd3c9..9dad153a3 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -18,12 +18,12 @@ .orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;} a.saveBtn {padding:3px 5px; background-color:#269ac9; color:#ffffff;} a.saveBtn:hover {background-color:#297fb8;} -.orgMemberList {width:460px; float:left;} +.orgMemberList {width:480px; float:left;} .orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;} .orgListUser {width:85px; float:left;} .orgListRole {width:180px; float:left;} .orgOrder {width:30px; float:left;margin-right:10px;text-align:center;} -.orgMemContainer {width:228px;} +.orgMemContainer {width:208px;} .orgMemberAdd {float:right;} .orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} .undis {display:none;} @@ -75,7 +75,8 @@ a.linkGrey8:hover {color:#585858;} #orgUserName {display:inline-block;} .org_login_list a {color:#269ac9;} -.orgListStatus {width:55px; float:left;} +.orgListStatus {width:40px; float:left;} +.orgListStatusList {width:55px; float:left;} .personalUrl {border:1px solid #dddddd; width:75px; outline:none; white-space:nowrap; padding-left:2px;} .reCon{ margin:5px; width:710px;} .retop{width:710px; height:40px; background:#eaeaea; padding:5px;} diff --git a/public/stylesheets/org_new_style.css b/public/stylesheets/org_new_style.css index eb5a7c088..83fab83eb 100644 --- a/public/stylesheets/org_new_style.css +++ b/public/stylesheets/org_new_style.css @@ -182,6 +182,8 @@ a:hover.more-btn{ background:#29146f; color:#fff;} a:hover.more-btn-center{ background:#29146f; color:#fff;} .mt30{ margin-top:30px;} +.nocontent{ font-size:30px; color:#888; margin:150px auto; text-align:center;} +