企业版模块
This commit is contained in:
parent
f7dbb24d35
commit
d0a675f2b8
|
@ -0,0 +1,3 @@
|
||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
@ -0,0 +1,3 @@
|
||||||
|
// Place all the styles related to the Enterprises controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -0,0 +1,6 @@
|
||||||
|
class EnterprisesController < ApplicationController
|
||||||
|
layout 'project_base'
|
||||||
|
def index
|
||||||
|
@enterprises = Project.find_by_sql("select enterprise_name from projects")
|
||||||
|
end
|
||||||
|
end
|
|
@ -25,6 +25,17 @@ class WelcomeController < ApplicationController
|
||||||
before_filter :entry_select, :only => [:index]
|
before_filter :entry_select, :only => [:index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
unless params[:enterprise].nil?
|
||||||
|
@enterprise = params[:enterprise]
|
||||||
|
@enterprise_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @enterprise])
|
||||||
|
@e_count = @enterprise_projects.count
|
||||||
|
if @e_count < 10
|
||||||
|
part_count = 10 -@e_count
|
||||||
|
# @part_projects = find_all_hot_project part_count, order
|
||||||
|
@part_projects = find_miracle_project(part_count, 3,"score desc")
|
||||||
|
limit = 10 - @e_count
|
||||||
|
end
|
||||||
|
end
|
||||||
if @first_page.nil? || @first_page.sort_type.nil?
|
if @first_page.nil? || @first_page.sort_type.nil?
|
||||||
@projects = find_miracle_project(10, 3,"score desc")
|
@projects = find_miracle_project(10, 3,"score desc")
|
||||||
else
|
else
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
module EnterprisesHelper
|
||||||
|
end
|
|
@ -375,4 +375,8 @@ module ProjectsHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_part_projects e_count, t_count
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Course < ActiveRecord::Base
|
||||||
STATUS_CLOSED = 5
|
STATUS_CLOSED = 5
|
||||||
STATUS_ARCHIVED = 9
|
STATUS_ARCHIVED = 9
|
||||||
|
|
||||||
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student
|
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name
|
||||||
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
|
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
|
||||||
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表
|
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表
|
||||||
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表
|
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表
|
||||||
|
|
|
@ -116,6 +116,7 @@ class Project < ActiveRecord::Base
|
||||||
validates_associated :repository, :wiki
|
validates_associated :repository, :wiki
|
||||||
# validates_length_of :description, :maximum => 255
|
# validates_length_of :description, :maximum => 255
|
||||||
validates_length_of :name, :maximum => 255
|
validates_length_of :name, :maximum => 255
|
||||||
|
validates_length_of :enterprise_name, :maximum => 255
|
||||||
validates_length_of :homepage, :maximum => 255
|
validates_length_of :homepage, :maximum => 255
|
||||||
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH
|
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH
|
||||||
# donwcase letters, digits, dashes but not digits only
|
# donwcase letters, digits, dashes but not digits only
|
||||||
|
@ -760,7 +761,8 @@ class Project < ActiveRecord::Base
|
||||||
'issue_custom_field_ids',
|
'issue_custom_field_ids',
|
||||||
'project_type',
|
'project_type',
|
||||||
'dts_test',
|
'dts_test',
|
||||||
'attachmenttype'
|
'attachmenttype',
|
||||||
|
'enterprise_name'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<div class="enterprise_all">
|
||||||
|
<p>
|
||||||
|
<%= link_to l(:label_all_enterprises) %>
|
||||||
|
<p>
|
||||||
|
<p>
|
||||||
|
<% if @enterprises.count == 0 %>
|
||||||
|
<h3><%= l(:label_enterprise_nil) %></h3>
|
||||||
|
<% else %>
|
||||||
|
<% @enterprises.each do |enterprise| %>
|
||||||
|
<% unless enterprise.enterprise_name.blank? %>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<%= link_to enterprise.enterprise_name, home_path(:enterprise => enterprise.enterprise_name) %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div style="clear: both"></div>
|
||||||
|
<div class="school-index">
|
||||||
|
<ul id="schoollist" style="line-height: 25px"></ul>
|
||||||
|
</div>
|
||||||
|
<% html_title(l(:label_school_all)) -%>
|
|
@ -8,7 +8,7 @@
|
||||||
<p style="padding-right: 20px;">
|
<p style="padding-right: 20px;">
|
||||||
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
|
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
</p><!--by young-->
|
</p><!--by young-->
|
||||||
|
<p><%= f.text_field :enterprise_name, :size => 60, :style => "width:490px;" %></p>
|
||||||
<p style="display: none" ><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH,
|
<p style="display: none" ><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH,
|
||||||
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
|
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
|
||||||
<% unless @project.identifier_frozen? %>
|
<% unless @project.identifier_frozen? %>
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<li style="overflow:hidden;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
|
||||||
|
<div style="float: left;">
|
||||||
|
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
||||||
|
</div>
|
||||||
|
<!-- 上左下右 -->
|
||||||
|
<div style="float: left; margin-left: 10px; width: 380px;">
|
||||||
|
<% unless project.is_public %>
|
||||||
|
<span class="private_project"> <%= l(:label_private) %> </span>
|
||||||
|
<% end %>
|
||||||
|
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||||
|
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
||||||
|
</div>
|
||||||
|
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;min-height: 42px;">
|
||||||
|
<span class='font_lighter' title ='<%= project.short_description%>'> <%=project.description.truncate(90, omission: '...')%> </span>
|
||||||
|
</div>
|
||||||
|
<div >
|
||||||
|
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
|
||||||
|
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
||||||
|
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
||||||
|
:class => "tooltip",
|
||||||
|
:id => "tooltip-#{project.id}" %>
|
||||||
|
</div>
|
||||||
|
</li>
|
|
@ -1,5 +1,5 @@
|
||||||
<h1></h1>
|
<h1></h1>
|
||||||
<p id="errorExplanation">
|
<p id="errorExplanation">
|
||||||
<%= course_title%>
|
<%= course_title %>
|
||||||
</p>
|
</p>
|
||||||
<h1></h1>
|
<h1></h1>
|
|
@ -2,24 +2,23 @@
|
||||||
<%= stylesheet_link_tag 'welcome' %>
|
<%= stylesheet_link_tag 'welcome' %>
|
||||||
<%= javascript_include_tag 'welcome' %>
|
<%= javascript_include_tag 'welcome' %>
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
|
$(function() {
|
||||||
|
$("#main").find("a").attr("target", "_blank");
|
||||||
|
setCss();
|
||||||
|
});
|
||||||
|
//设置div居中
|
||||||
|
function setCss() {
|
||||||
|
var mainBar = $('#main-content-bar')[0];
|
||||||
|
var topHeight = mainBar.offsetHeight;
|
||||||
|
var welcomeLeft = $('#welcome_left')[0];
|
||||||
|
var leftHeight = welcomeLeft.offsetHeight;
|
||||||
|
var searchbar = $('#search-bar')[0];
|
||||||
|
var searchHeight = searchbar.offsetHeight;
|
||||||
|
welcomeLeft.style.marginTop = (topHeight - leftHeight) / 2 + "px";
|
||||||
|
searchbar.style.marginTop = (topHeight - searchHeight) / 2 + "px";
|
||||||
|
//alert((topHeight - leftHeight)/2 );
|
||||||
|
}
|
||||||
|
|
||||||
$(function(){
|
|
||||||
$("#main").find("a").attr("target", "_blank");
|
|
||||||
setCss();
|
|
||||||
});
|
|
||||||
//设置div居中
|
|
||||||
function setCss()
|
|
||||||
{
|
|
||||||
var mainBar = $('#main-content-bar')[0];
|
|
||||||
var topHeight = mainBar.offsetHeight;
|
|
||||||
var welcomeLeft = $('#welcome_left')[0];
|
|
||||||
var leftHeight = welcomeLeft.offsetHeight;
|
|
||||||
var searchbar = $('#search-bar')[0];
|
|
||||||
var searchHeight = searchbar.offsetHeight;
|
|
||||||
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
|
|
||||||
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
|
|
||||||
//alert((topHeight - leftHeight)/2 );
|
|
||||||
}
|
|
||||||
// 给主页用户弹新页面
|
// 给主页用户弹新页面
|
||||||
$(document).ready(function($) {
|
$(document).ready(function($) {
|
||||||
$("#loggedas").find("a").attr("target", "_blank");
|
$("#loggedas").find("a").attr("target", "_blank");
|
||||||
|
@ -28,168 +27,144 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class='top_bar'>
|
<div class='top_bar'>
|
||||||
<%#= render partial: 'wei_xin' %>
|
<%#= render partial: 'wei_xin' %>
|
||||||
<div class="main-content-bar" id="main-content-bar">
|
<div class="main-content-bar" id="main-content-bar">
|
||||||
<div style="float: left;padding-left:15px ">
|
<div style="float: left;padding-left:15px ">
|
||||||
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
|
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
|
||||||
<% if get_avatar?(@first_page) %>
|
<% if @enterprise.nil? %>
|
||||||
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
|
<% if get_avatar?(@first_page) %>
|
||||||
<% else %>
|
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
|
||||||
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
|
<% else %>
|
||||||
<% end %>
|
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag '/images/avatars/Project/0', width:@first_page.image_width,height: @first_page.image_height %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="welcome_left" id="welcome_left">
|
<div class="welcome_left" id="welcome_left">
|
||||||
<% unless @first_page.nil? %>
|
<% if @enterprise.nil? %>
|
||||||
<%= @first_page.description.html_safe %>
|
<% unless @first_page.nil? %>
|
||||||
<% end %>
|
<%= @first_page.description.html_safe %>
|
||||||
</div>
|
<% end %>
|
||||||
<div class="search-bar" id="search-bar">
|
<% else %>
|
||||||
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
|
|
||||||
</div>
|
<span class="font_welcome_school" style="color: #E8770D"> <%= link_to @enterprise, options={:action => 'index', :enterprise => @enterprise}, html_options={ :method => 'get', :style => "color: #E8770D"} %> </span>
|
||||||
<div style="clear: both;"></div>
|
<br/>
|
||||||
|
<span class="font_welcome_trustie"> <%= @first_page.title %> </span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="search-bar" id="search-bar">
|
||||||
|
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
|
||||||
|
</div>
|
||||||
|
<div style="clear: both;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="clear:both"></div>
|
<div style="clear:both"></div>
|
||||||
|
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-hot">
|
<div id="J_Slide" class="d-p-index-box d-p-index-hot">
|
||||||
<h3 style="margin-left: 5px; color: #e8770d;">
|
<h3 style="margin-left: 5px; color: #e8770d;"><strong> <%= l(:lable_hot_projects)%> </strong></h3>
|
||||||
<strong>
|
<span style="margin-top: -20px;float: right; display: block;"> <% if User.current.logged? %>
|
||||||
<%= l(:lable_hot_projects)%>
|
<%= link_to(l(:label_project_new), {:controller => 'projects',
|
||||||
</strong>
|
:action => 'new',
|
||||||
</h3>
|
:course => 0,
|
||||||
<span style="margin-top: -20px;float: right; display: block;">
|
:project_type =>( @project_type||=0)},
|
||||||
<% if User.current.logged? %>
|
:class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
|
||||||
<%= link_to(l(:label_project_new), {:controller => 'projects',
|
|
||||||
:action => 'new',
|
<%= link_to l(:label_join_project), join_project_projects_path ,:remote => true, :class => 'icon icon-add' %>
|
||||||
:course => 0,
|
|
||||||
:project_type =>( @project_type||=0)},
|
<% end %> </span>
|
||||||
:class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
|
|
||||||
|
|
||||||
<%= link_to l(:label_join_project), join_project_projects_path ,:remote => true, :class => 'icon icon-add' %>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
<div class="d-p-projectlist-box">
|
<div class="d-p-projectlist-box">
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
<% @projects.map do |project| %>
|
<!-- 如果企业版参数正确,这进入企业版页面 -->
|
||||||
<li style="overflow:hidden;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
|
<% if @enterprise.nil? %>
|
||||||
<div style="float: left;">
|
<% @projects.map do |project| %>
|
||||||
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
</div>
|
<% end; reset_cycle %>
|
||||||
<!-- 上左下右 -->
|
<!-- 企业版项目 -->
|
||||||
<div style="float: left; margin-left: 10px; width: 380px;">
|
<% else %>
|
||||||
<% unless project.is_public %>
|
<% if @e_count == 0 %>
|
||||||
<span class="private_project">
|
<p id="errorExplanation"><%= l(:label_enterprise_tips) %></p>
|
||||||
<%= l(:label_private) %>
|
<% @projects.map do |project| %>
|
||||||
</span>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
<% end %>
|
<% end; reset_cycle %>
|
||||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
<% elsif @e_count < 10 %>
|
||||||
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
<% @enterprise_projects.map do |project| %>
|
||||||
</div>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;min-height: 42px;">
|
<% end %>
|
||||||
<span class='font_lighter' title ='<%=project.short_description%>'>
|
<p id="errorExplanation"><%= l(:label_part_enterprise_tips) %></p>
|
||||||
<%=project.description.truncate(90, omission: '...')%>
|
<% @part_projects.map do |project| %>
|
||||||
</span>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
</div>
|
<% end %>
|
||||||
<div >
|
<% else %>
|
||||||
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
|
<% @part_projects.map do |project| %>
|
||||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
<% end %>
|
||||||
:class => "tooltip",
|
<% end; reset_cycle %>
|
||||||
:id => "tooltip-#{project.id}" %>
|
<% end; reset_cycle %>
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<!--<%#end %> -->
|
|
||||||
<% end; reset_cycle %>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
|
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
|
||||||
<ul class="user-welcome-message-list">
|
<ul class="user-welcome-message-list">
|
||||||
<h3 style="color: rgb(21, 188, 207)">
|
<h3 style="color: rgb(21, 188, 207)"><strong> <%= l(:lable_user_active)%> </strong></h3>
|
||||||
<strong>
|
<div class="user-message-box-list" style="margin-top: 10px;">
|
||||||
<%= l(:lable_user_active)%>
|
<% activities = find_all_activities%>
|
||||||
</strong>
|
<% activities.each do |event| %>
|
||||||
</h3>
|
<li style="display: block;height:60px; padding-bottom: 4px;">
|
||||||
<div class="user-message-box-list" style="margin-top: 10px;">
|
<div class="inner-right" style="float: left; height: 100%; ">
|
||||||
<%activities = find_all_activities%>
|
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||||
<% activities.each do |event| %>
|
</div>
|
||||||
<li style="display: block;height:60px; padding-bottom: 4px;">
|
<div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" >
|
||||||
<div class="inner-right" style="float: left; height: 100%; ">
|
<span style="color: green;"> <%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
|
||||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
:style => "color:green;", :target => "_blank" %> </span>
|
||||||
</div>
|
<%= show_user_content event %>
|
||||||
<div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" >
|
<p style="margin-top: 4px;">
|
||||||
<span style="color: green;">
|
<span style="color: rgb(172, 174, 177)"> <%= l(:field_updated_on) %>
|
||||||
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
|
<%= time_tag_welcome event.event_datetime %>前 </span>
|
||||||
:style => "color:green;", :target => "_blank" %>
|
|
||||||
</span>
|
<span style="float: right; color: rgb(172, 174, 177);"> <%= show_event_reply event %> </span>
|
||||||
<%= show_user_content event %>
|
</p>
|
||||||
<p style="margin-top: 4px;">
|
</div>
|
||||||
<span style="color: rgb(172, 174, 177)">
|
</li>
|
||||||
<%= l(:field_updated_on) %>
|
<% end %>
|
||||||
<%= time_tag_welcome event.event_datetime %>前
|
</div>
|
||||||
</span>
|
</ul>
|
||||||
|
</div>
|
||||||
<span style="float: right; color: rgb(172, 174, 177);">
|
|
||||||
<%= show_event_reply event %>
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="right" style="float: right; width: 48%; ">
|
<div class="right" style="float: right; width: 48%; ">
|
||||||
<ul class="welcome-message-list">
|
<ul class="welcome-message-list">
|
||||||
<!--<%# cache 'forum_links' do %> -->
|
<!--<%# cache 'forum_links' do %> -->
|
||||||
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
|
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
|
||||||
<h3 style="color: rgb(21, 188, 207);">
|
<h3 style="color: rgb(21, 188, 207);"><strong> <%= l(:lable_bar_active)%> </strong> <%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
||||||
<strong>
|
<%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> </h3>
|
||||||
<%= l(:lable_bar_active)%>
|
<span style="margin-top: -30px;float: right; display: block;"> <%= link_to l(:label_more), forums_path %> </span>
|
||||||
</strong>
|
|
||||||
<%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
|
||||||
<%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
|
||||||
</h3>
|
|
||||||
<span style="margin-top: -30px;float: right; display: block;">
|
|
||||||
<%= link_to l(:label_more), forums_path %>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="welcome-box-list-new memo_activity">
|
<div class="welcome-box-list-new memo_activity">
|
||||||
<% topics = find_new_forum_topics(6) %>
|
<% topics = find_new_forum_topics(6) %>
|
||||||
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
|
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
|
||||||
<!--<%# cache cache_key_for_topic(topic) do %> -->
|
<!--<%# cache cache_key_for_topic(topic) do %> -->
|
||||||
<li class="message-brief-intro">
|
<li class="message-brief-intro">
|
||||||
<div class='memo_title text_nowrap'>
|
<div class='memo_title text_nowrap'>
|
||||||
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %>
|
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %>
|
||||||
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
|
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
|
||||||
</div>
|
</div>
|
||||||
<div class='memo_attr'>
|
<div class='memo_attr'>
|
||||||
<span class='memo_timestamp'>
|
<span class='memo_timestamp'> <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> </span>
|
||||||
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
|
<span class="memo_author"> <%= l(:label_question_sponsor)%>:
|
||||||
</span>
|
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> </span>
|
||||||
<span class="memo_author">
|
<span class="memo_last_person"> <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
|
||||||
<%= l(:label_question_sponsor)%>:
|
<%= l(:label_final_reply)%>:
|
||||||
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
|
<%= link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
|
||||||
</span>
|
<% end %> </span>
|
||||||
<span class="memo_last_person">
|
<span class="memo_reply"> <%= l(:label_reply)%>
|
||||||
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
|
(<%= link_to topic.try(:replies_count), topic.event_url %>) </span>
|
||||||
<%= l(:label_final_reply)%>:
|
</div>
|
||||||
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
|
</li>
|
||||||
<% end %>
|
<!--<%#end %> -->
|
||||||
</span>
|
<!-- cache -->
|
||||||
<span class="memo_reply">
|
<% end %>
|
||||||
<%= l(:label_reply)%>
|
|
||||||
(<%= link_to topic.try(:replies_count), topic.event_url %>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<!--<%#end %> --> <!-- cache -->
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -275,6 +275,7 @@ zh:
|
||||||
label_course_closed_tips: "确定要%{desc}课程?"
|
label_course_closed_tips: "确定要%{desc}课程?"
|
||||||
# end
|
# end
|
||||||
field_name: 名称
|
field_name: 名称
|
||||||
|
field_enterprise_name: 企业名
|
||||||
#added by huang
|
#added by huang
|
||||||
field_tea_name: 教师
|
field_tea_name: 教师
|
||||||
field_couurse_time: 学时
|
field_couurse_time: 学时
|
||||||
|
@ -2313,3 +2314,12 @@ zh:
|
||||||
|
|
||||||
label_technical_support: 技术支持:
|
label_technical_support: 技术支持:
|
||||||
label_feedback: 意见反馈
|
label_feedback: 意见反馈
|
||||||
|
|
||||||
|
# 项目企业模块
|
||||||
|
label_all_enterprises: 所有企业
|
||||||
|
label_my_enterprise: 我的企业
|
||||||
|
label_enterprise_tips: 暂时还没有该企业对应的项目,系统的其它项目您可能会感兴趣!
|
||||||
|
label_part_enterprise_tips: 系统的其它项目您可能也会感兴趣!
|
||||||
|
label_enterprise_nil: 改模块为最新上线模块,目前还未有项目关联到企业!
|
||||||
|
label_enterprises: 名企
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
# Example: :via => :get ====> :via => :get
|
# Example: :via => :get ====> :via => :get
|
||||||
|
|
||||||
RedmineApp::Application.routes.draw do
|
RedmineApp::Application.routes.draw do
|
||||||
|
get "enterprises/index"
|
||||||
|
|
||||||
#match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index'
|
#match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index'
|
||||||
|
|
||||||
mount Mobile::API => '/api'
|
mount Mobile::API => '/api'
|
||||||
|
@ -388,6 +390,7 @@ RedmineApp::Application.routes.draw do
|
||||||
match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get
|
match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get
|
||||||
# match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
|
# match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
|
||||||
match '/homework', :to => 'projects#homework', :as => 'homework', :via => :get
|
match '/homework', :to => 'projects#homework', :as => 'homework', :via => :get
|
||||||
|
match 'enterprise', :to => 'enterprises#index', :as => 'index', :via => :get
|
||||||
|
|
||||||
# match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
|
# match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
|
||||||
# match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
|
# match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddEnterpriseNameToProjects < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :enterprise_name, :string
|
||||||
|
end
|
||||||
|
end
|
41
db/schema.rb
41
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20150123020615) do
|
ActiveRecord::Schema.define(:version => 20150128032421) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -925,6 +925,7 @@ ActiveRecord::Schema.define(:version => 20150123020615) do
|
||||||
t.integer "attachmenttype", :default => 1
|
t.integer "attachmenttype", :default => 1
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "dts_test", :default => 0
|
t.integer "dts_test", :default => 0
|
||||||
|
t.string "enterprise_name"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||||
|
@ -1069,6 +1070,14 @@ ActiveRecord::Schema.define(:version => 20150123020615) do
|
||||||
t.string "description"
|
t.string "description"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "social_groups", :force => true do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.text "description"
|
||||||
|
t.integer "user_id"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "softapplications", :force => true do |t|
|
create_table "softapplications", :force => true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.text "description"
|
t.text "description"
|
||||||
|
@ -1284,6 +1293,36 @@ ActiveRecord::Schema.define(:version => 20150123020615) do
|
||||||
add_index "versions", ["project_id"], :name => "versions_project_id"
|
add_index "versions", ["project_id"], :name => "versions_project_id"
|
||||||
add_index "versions", ["sharing"], :name => "index_versions_on_sharing"
|
add_index "versions", ["sharing"], :name => "index_versions_on_sharing"
|
||||||
|
|
||||||
|
create_table "voting_choices", :force => true do |t|
|
||||||
|
t.integer "poll_id", :null => false
|
||||||
|
t.string "text", :null => false
|
||||||
|
t.datetime "created_on", :null => false
|
||||||
|
t.integer "position", :default => 1
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "voting_choices", ["poll_id"], :name => "choices_poll_id"
|
||||||
|
|
||||||
|
create_table "voting_polls", :force => true do |t|
|
||||||
|
t.integer "project_id", :null => false
|
||||||
|
t.string "question", :null => false
|
||||||
|
t.datetime "created_on", :null => false
|
||||||
|
t.boolean "revote"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "voting_polls", ["project_id"], :name => "polls_project_id"
|
||||||
|
|
||||||
|
create_table "voting_votes", :force => true do |t|
|
||||||
|
t.integer "user_id", :null => false
|
||||||
|
t.integer "poll_id", :null => false
|
||||||
|
t.integer "choice_id", :null => false
|
||||||
|
t.datetime "created_on", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "voting_votes", ["choice_id"], :name => "votes_choice_id"
|
||||||
|
add_index "voting_votes", ["poll_id"], :name => "votes_poll_id"
|
||||||
|
add_index "voting_votes", ["user_id", "poll_id"], :name => "votes_user_poll_unique", :unique => true
|
||||||
|
add_index "voting_votes", ["user_id"], :name => "votes_user_id"
|
||||||
|
|
||||||
create_table "watchers", :force => true do |t|
|
create_table "watchers", :force => true do |t|
|
||||||
t.string "watchable_type", :default => "", :null => false
|
t.string "watchable_type", :default => "", :null => false
|
||||||
t.integer "watchable_id", :default => 0, :null => false
|
t.integer "watchable_id", :default => 0, :null => false
|
||||||
|
|
|
@ -9,6 +9,9 @@ h4, .wiki h3 {font-size: 13px;}
|
||||||
h4 {border-bottom: 1px dotted #bbb;}
|
h4 {border-bottom: 1px dotted #bbb;}
|
||||||
/*huang*/
|
/*huang*/
|
||||||
/*current position*/
|
/*current position*/
|
||||||
|
.enterprise_all{
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
.course_ad{
|
.course_ad{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
visibility:visible;
|
visibility:visible;
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe EnterprisesController do
|
||||||
|
|
||||||
|
describe "GET 'index'" do
|
||||||
|
it "returns http success" do
|
||||||
|
get 'index'
|
||||||
|
response.should be_success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in New Issue