组织新版样式,及方法优化

This commit is contained in:
huang 2016-06-03 12:42:02 +08:00
parent a0f722837b
commit 3af115ee54
6 changed files with 24 additions and 12 deletions

View File

@ -25,8 +25,6 @@ class OrgSubfieldsController < ApplicationController
# status类型说明详见SubField
def update_status_by_type subfield, type
case type
when "activity"
subfield.update_attribute(:status, 0)
when "Resource"
subfield.update_attribute(:status, 6)
when "Comptec"

View File

@ -102,6 +102,19 @@ module OrganizationsHelper
end
end
def org_time_by_type obj
case obj.act_type
when "Message"
time = obj.act.updated_on
when "News"
user = obj.act.created_on
when "HomeworkCommon"
user = obj.act.updated_at
when "Issue"
user = obj.act.updated_on
end
end
#排列下拉框
def subfield_status_option
type = []

View File

@ -18,9 +18,9 @@ class Organization < ActiveRecord::Base
end
def add_default_subfields
OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1)
OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2)
OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3)
OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1, :status => 0)
OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2, :status => 2)
OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3, :status => 2)
end
def switch_type

View File

@ -9,7 +9,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'org_custom', 'new_user', 'public','jquery/jquery-ui-1.9.2' %>
<%= stylesheet_link_tag 'new_user', 'public', 'org_custom','jquery/jquery-ui-1.9.2' %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->

View File

@ -8,23 +8,24 @@
<% user = org_user_by_type(obj) %>
<% title = org_title_by_type(obj) %>
<% content = org_content_by_type(obj) %>
<% time = org_time_by_type(obj) %>
<li>
<%= link_to image_tag(url_to_avatar(user),:width => "43", :height => "43", :class => "por_users_img"), user_path(user), :target => "_blank", :class => "fl" %>
<div class="por_news_txt fl">
<p class="por_news_p fl">
<%= link_to user.show_name, user_path(user), :class => "por_hot_name link-blue fl", :target => "_blank" %>
<span class="fl">&nbsp;:&nbsp;</span>
<% if obj.act_type = "Message" %>
<% if obj.act_type == "Message" %>
<%= link_to title, board_message_path(obj.act.board.id, obj.act.id) %>
<% elsif obj.act_type = "News" %>
<% elsif obj.act_type == "News" %>
<%= link_to title, news_path(obj.act.id) %>
<% elsif obj.act_type = "HomeworkCommon" %>
<% elsif obj.act_type == "HomeworkCommon" %>
<%= link_to title, student_work_index_url_in_org(obj.act.id) %>
<% elsif obj.act_type = "Issue" %>
<% elsif obj.act_type == "Issue" %>
<%= link_to title, issue_path(obj.act.id) %>
<% end %>
</p>
<p><span class="por_time fl"><%= time_from_now(obj.act.created_on) %> </span>
<p><span class="por_time fl"><%= time_from_now(time) %> </span>
<!--<a href="javascript:void(0);" target="_blank" class="por_zan fr">50</a>-->
</p>
</div>

View File

@ -23,7 +23,7 @@
<li class="orgListUser" title="<%= name %>"><%= name %></li>
<li class="orgListStatus">默认</li>
<li class="orgListStatusList">
<% if field.name == "activity" %>
<% if field.name == "activity" || field.name == "course" || field.name == "project" %>
默认
<% 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 %>