Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

This commit is contained in:
kg 2014-05-01 09:16:43 +08:00
commit 776a9d1e35
25 changed files with 577 additions and 518 deletions

View File

@ -2,14 +2,49 @@ class SchoolController < ApplicationController
before_filter :require_admin, :only => :upload_logo
def upload_logo
def upload
uploaded_io = params[:logo]
school_id = 0
schools = School.where("name = ?", params[:school])
schools.each do |s|
school_id = s.id
end
unless uploaded_io.nil?
File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
s1 = School.find(school_id)
s1.logo_link = '/images/school/'+school_id.to_s+'.png'
s1.save
end
end
def upload_logo
end
def index
end
def get_province
@provinces = School.find_by_sql("select distinct province from schools")
options = ""
@provinces.each do |p|
options << "<option value = '#{p.province}' >#{p.province}</option>"
end
render :text => options
end
def get_options
@school = School.where("province = ?", params[:province])

View File

@ -8,6 +8,30 @@ class SoftapplicationsController < ApplicationController
def index
@softapplications = Softapplication.all
#new added fenyefunction
@limit = 5
@softapplication_count = @softapplications.count
@softapplication_pages = Paginator.new @softapplication_count, @limit, params['page']
@offset ||= @softapplication_pages.offset
#@softapplications = @softapplications[@offset,@limit]
#new added end
#new added sort
if params[:softapplication_sort_type].present?
case params[:softapplication_sort_type]
when '0'
@softapplications = @softapplications[@offset, @limit]
@s_state = 0
when '1'
@softapplications = @softapplications.sort { |x, y| y[:created_at] <=> x[:created_at]}[@offset, @limit]
@s_state = 1
end
else
@softapplications = @softapplications.sort { |x, y| y[:created_at] <=> x[:created_at]}[@offset, @limit]
@s_state = 1
end
#new added end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @softapplications }
@ -16,8 +40,25 @@ class SoftapplicationsController < ApplicationController
# GET /softapplications/1
# GET /softapplications/1.json
def percent_of(num, percent)
num.to_f / percent.to_f * 100.0
end
def show
@softapplication = Softapplication.find(params[:id])
# 打分统计
stars_reates = @softapplication.
rates(:quality)
stars_reates_count = stars_reates.count == 0 ? 1 : stars_reates.count
stars_status = stars_reates.select("stars, count(*) as scount").
group("stars")
@stars_status_map = Hash.new(0.0)
stars_status.each do |star_status|
@stars_status_map["star#{star_status.stars.to_i}".to_sym] =
percent_of(star_status.scount, stars_reates_count).to_s + "%"
end
@jours = @softapplication.journals_for_messages.order('created_on DESC')
@image_results = []
@softapplication.attachments.each do |f|

View File

@ -39,8 +39,36 @@ class WelcomeController < ApplicationController
@courseCount = Project.course_entities.count
@teacherCount = User.teacher.count
@studentCount = User.student.count
@logoLink = logolink()
end
def logolink()
id = params[:school_id]
logo_link = ""
if id.nil? and User.current.user_extensions.school.nil?
logo_link = '/images/transparent.png'
else
if id == "0"
logo_link = '/images/transparent.png'
else
if id.nil?
if School.find(User.current.user_extensions.school.id).logo_link.nil?
logo_link = '/images/transparent.png'
else
logo_link = School.find(User.current.user_extensions.school.id).logo_link
end
else
logo_link = School.find(id).logo_link
end
end
end
return logo_link
end
def contest
end

View File

@ -1,2 +1,18 @@
module SoftapplicationsHelper
def sort_softapplication(state)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '1'}))
content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '0'}, :class=>"selected"), :class=>"selected")
when 1
content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '1'}, :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '0'}))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
end

View File

@ -54,57 +54,111 @@ module UserScoreHelper
watcher_count = Watcher.where("watchable_type = 'principal' AND watchable_id = ?", user.id).count
end
def calculate_skill_count(user)
praise_count = 0
tread_count = 0
praise_count_l0 = 0
praise_count_l1 = 0
praise_count_l2 = 0
tread_count_l0 = 0
tread_count_l1 = 0
tread_count_l2 = 0
issues = Issue.where('author_id = ?', user.id)
issues.each do |i|
ptcs = PraiseTreadCache.where('object_id = ?', i.id)
ptcs.each do |p|
praise_count = praise_count + p.praise_num
tread_count = tread_count + p.tread_num
pts = PraiseTread.where('praise_tread_object_id = ?', i.id)
pts.each do |p|
templevel = calculate_level(User.find(p.user_id))
if templevel.to_i == 0
if p.praise_or_tread == 1
praise_count_l0 = praise_count_l0 + 1
else
tread_count_l0 = tread_count_l0 + 1
end
end
if templevel.to_i == 1
if p.praise_or_tread == 1
praise_count_l1 = praise_count_l1 + 1
else
tread_count_l1 = tread_count_l1 + 1
end
end
if templevel.to_i == 2
if p.praise_or_tread == 1
praise_count_l2 = praise_count_l2 + 1
else
tread_count_l2 + tread_count_l2 + 1
end
end
end
end
bids = Bid.where('author_id = ?', user.id)
bids.each do |b|
ptcs = PraiseTreadCache.where('object_id = ?', b.id)
ptcs = PraiseTread.where('praise_tread_object_id = ?', b.id)
ptcs.each do |p|
praise_count = praise_count + p.praise_num
tread_count = tread_count + p.tread_num
templevel = calculate_level(User.find(p.user_id))
if templevel.to_i == 0
if p.praise_or_tread == 1
praise_count_l0 = praise_count_l0 + 1
else
tread_count_l0 = tread_count_l0 + 1
end
end
if templevel.to_i == 1
if p.praise_or_tread == 1
praise_count_l1 = praise_count_l1 + 1
else
tread_count_l1 = tread_count_l1 + 1
end
end
if templevel.to_i == 2
if p.praise_or_tread == 1
praise_count_l2 = praise_count_l2 + 1
else
tread_count_l2 + tread_count_l2 + 1
end
end
end
end
contests = Contest.where('author_id = ?', user.id)
contests.each do |c|
ptcs = PraiseTreadCache.where('object_id = ?', c.id)
ptcs = PraiseTread.where('praise_tread_object_id = ?', c.id)
ptcs.each do |p|
praise_count = praise_count + p.praise_num
tread_count = tread_count + p.tread_num
templevel = calculate_level(User.find(p.user_id))
if templevel.to_i == 0
if p.praise_or_tread == 1
praise_count_l0 = praise_count_l0 + 1
else
tread_count_l0 = tread_count_l0 + 1
end
end
if templevel.to_i == 1
if p.praise_or_tread == 1
praise_count_l1 = praise_count_l1 + 1
else
tread_count_l1 = tread_count_l1 + 1
end
end
if templevel.to_i == 2
if p.praise_or_tread == 1
praise_count_l2 = praise_count_l2 + 1
else
tread_count_l2 + tread_count_l2 + 1
end
end
end
end
level = calculate_level(user)
skill_score = 0
if level == 0
skill_score = praise_count - 0.5 * tread_count
end
if level == 1
skill_score = 2 * praise_count - 1.5 * tread_count
end
if level == 2
skill_socre = 3 * praise_count - 2.5 * tread_count
end
if level == 3
skill_socre = 4 * praise_count - 3.5 * tread_count
end
if level == 4
skill_socre = 5 * praise_count - 4.5 * tread_count
end
# case level
# when 0 skill_score = praise_count - 0.5 * tread_count
@ -114,12 +168,19 @@ module UserScoreHelper
# when 4 skill_socre = 5 * praise_count - 4.5 * tread_count
# end
skill_score = 2 * praise_count_l0.to_f + 3 * praise_count_l1.to_f + 4 * praise_count_l2.to_f
- 1 * tread_count_l0.to_f - 1.5 * tread_count_l1.to_f - 2 * tread_count_l2.to_f
tread_user_count = PraiseTread.where('praise_or_tread = ? AND user_id = ?', 0, user.id).count
skill_score = skill_score - 0.5 * tread_user_count
skill_score = skill_score.to_f - tread_user_count.to_f
return skill_score
@ -135,7 +196,7 @@ module UserScoreHelper
issues.each do |i|
ptcs = PraiseTreadCache.where('object_id = ?', i.id)
ptcs.each do |p|
if p.praise_num > max_praise_num
if p.praise_num.to_i > max_praise_num.to_i
max_praise_num = p.praise_num
end
end
@ -145,7 +206,7 @@ module UserScoreHelper
bids.each do |b|
ptcs = PraiseTreadCache.where('object_id = ?', b.id)
ptcs.each do |p|
if p.praise_num > max_praise_num
if p.praise_num.to_i > max_praise_num.to_i
max_praise_num = p.praise_num
end
end
@ -155,7 +216,7 @@ module UserScoreHelper
contests.each do |c|
ptcs = PraiseTreadCache.where('object_id = ?', c.id)
ptcs.each do |p|
if p.praise_num > max_praise_num
if p.praise_num.to_i > max_praise_num.to_i
max_praise_num = p.praise_num
end
end

View File

@ -14,7 +14,7 @@
<tr>
<td>简介:</td>
<td>
<%= c_softapplication.softapplication.description %>
<%= c_softapplication.softapplication.description.truncate(90, omission: '...') %>
</td>
</tr></br>
</div>

View File

@ -1,4 +1,132 @@
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
<style>
#ver-zebra, .file_table_des
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 5px 10px;
width: 98%;
text-align: left;
border-collapse: collapse;
line-height: 20px;
font-size: 14px;
}
#ver-zebra th
{
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
text-align: left;
}
#ver-zebra td
{
padding: 8px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
#ver-zebra td.description {
background-color: white;
padding: 0px;
margin: 0px auto;
}
div.tags_area {
padding: 2px 10px 10px 10px;
margin: 0px;
margin-bottom: 10px;
/*border-bottom: 1px dashed #CCCCCC;*/
overflow: hidden;
position: relative;
}
.tags_gradint {
}
.read-more{
padding: 5px;
border-top: 4px double #ddd;
background: #fff;
color: #333;
}
.read-more a{
padding-right: 22px;
background: url() no-repeat 100% 50%;
font-weight: bold;
text-decoration: none;
}
.read-more a:hover{
color: #000;
}
.vzebra-odd
{
background: #eff2ff;
}
.vzebra-even
{
background: #e8edff;
}
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children
{
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action
{
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
.filename{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.pagination{
margin: 10px 0px;
height: 1.5em;
text-align: left;
font-size: 13px;
}
.m5p5{
display: inline-block;
height: auto;
color: white !important;
margin: 8px;
padding: 3px 7px;
}
.m5p5:hover {
text-decoration: none;
/*padding-bottom: 3px;*/
/*border-bottom: 1px solid #666666;*/
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 3px 3px 3px #666666;
}
.relation_file_div{
margin: 0px 25px;
}
.relation_file_div fieldset{
margin: 0px 0px;
padding: 10px;
border-radius: 5px;
transition: all 2s linear 1s;
}
.relation_file_div input#attach_search:focus{
border: 1px solid #1B95C6;
box-shadow: 0px 0px 4px #1B95C6;
width: 200px;
}
.relation_file_div input#attach_search{
width: 150px;
outline: none;
border-radius: 5px;
-webkit-transition: 1s width;
-moz-transition : 1s width;
-o-transition : 1s width;
transition : 1s width;
}
</style>
<span class="borad-title"><%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span>
@ -88,9 +216,7 @@
<td class='description' colspan="5">
<div class="tags_area">
<% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<div id='attach_<%=file.id%>' ><%#需要交由浏览器异步刷新或者一次连表查询n+1 查询问题搞不定%>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
</div>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>

View File

@ -1,6 +1,6 @@
<!--add by huang-->
<div class="clearfix"></div>
<div id="footer" style="margin-left:-5px;padding-top: 50px;clear: both;font-size: 12px;">
<div id="footer" style="margin-left:-5px;padding-top: 150px;clear: both;font-size: 12px;">
<div style="border-top:solid 1px #C6E9F1;"></div>
<div class="base_footer">
<div align="center">

View File

@ -0,0 +1,22 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="305px">
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 25 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/softapplications", :controller=>'softapplications', :action=>'index' %></td>
<td ><%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_softapplication), :controller=>'softapplications', :action=>'index' %>
</td>
</tr>
</table>
</div>

View File

@ -108,22 +108,23 @@
<!-- added by Wen -->
<p style="width:357px;padding-left: 26px;">
<p style="padding-left: 26px;">
<% unless User.current.user_extensions.school.nil? %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province, User.current.user_extensions.school.province), :onclick => "get_options(this.value)" %>
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" />
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span>
<input id="province" name="province" type="text" value="<%=User.current.user_extensions.school.province%>" readonly />
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" />
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<!--<%= select_tag "occupation",
options_for_select([[User.current.user_extensions.school.name, User.current.user_extensions.school.id]]) %>-->
<% else %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onclick => "get_options(this.value)" %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span>
<input id="province" name="province" type="text" value="请单击选择省份及学校" readonly >
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<% end %>
<!-- <input id="occupation" readonly />-->
</p>
@ -131,6 +132,18 @@
<div id="WOpenWindow">
<a class="modal_close" href="#"></a>
<h2>学校列表</h2>
<div class="pcontent">
<ul id="provincelist" class="school_list">
<% @ss = School.find_by_sql("select distinct province from schools") %>
<% @ss.each do |s| %>
<li style="width: 15%; float: left;">
<a style="cursor: pointer;" onclick = "get_options('<%= s.province %>')"><%= s.province %>
</a>
</li>
<% end %>
</ul>
</div>
<hr/>
<div class="content" style="font-size: 13px">
<ul id="schoollist" class="school_list">

View File

@ -1,4 +1,22 @@
<% port = ":3000" if Rails.env.development? %>
<script type="text/javascript">
$(document).ready(function() {
$("#province").html("<option value='0' selected = true style='display: none;'></option>");
$.ajax({
type :"POST",
url :'/school/get_province',
data :'text',
success: function(data){
$("#province").append(data);
}
})
});
</script>
<script type="text/javascript">
function get_school(value){
$.ajax({
@ -50,9 +68,9 @@
<a href="http://course.trustie.net<%=port%>">我的学校</a>
</p>
<ul>
<li style="width: 40%; float: left">请选择省份:<%= select_tag "province",
options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province),
:onclick => "get_school(this.value)" %></li>
<li style="width: 40%; float: left">请选择省份:
<select id="province" name="province" onchange="get_school(this.value)"></select>
</li>
<li style="width: 50%; float: left"><input type="text" id="key_word" name="key_word" />
<input type="button" class="enterprise" value="搜索" onclick="ssearch()"></li>
</ul>

View File

@ -1 +1,5 @@
<input type="file" />
<%= form_tag({action: :upload},method: "post", multipart: true) do %>
<%= text_field_tag 'school'%>
<%= file_field_tag 'logo' %>
<%= submit_tag('Upload') %>
<% end %>

View File

@ -1,33 +1,39 @@
<h1>参赛应用</h1>
<table>
<tr>
<th>Name</th>
<th>Description</th>
<th>App type</th>
<th>App type name</th>
<th>Android min version available</th>
<th>User</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @softapplications.each do |softapplication| %>
<tr>
<td><%= softapplication.name %></td>
<td><%= softapplication.description %></td>
<td><%= softapplication.app_type_id %></td>
<td><%= softapplication.app_type_name %></td>
<td><%= softapplication.android_min_version_available %></td>
<td><%= softapplication.user_id %></td>
<td><%= link_to 'Show', softapplication %></td>
<td><%= link_to 'Edit', edit_softapplication_path(softapplication) %></td>
<td><%= link_to 'Destroy', softapplication, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<%=render :partial => 'layouts/base_softapplication_index_top_content'%>
<% if @softapplications.size > 0%>
<%= sort_softapplication(@s_state)%>
<div width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
<% @softapplications.each do |softapplication| %>
<div>
<span style="font-size: 15px; margin-right: 10px;"><strong><%= link_to softapplication.name, softapplication, :target => "_blank" %></strong></span>
<span><%= rating_for softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></span>
</div>
<div class="avatar-4"; style="float: left; margin-top: 7px "><%= image_tag('/images/app1.png')%></div>
<div style="float: left; width: 600px; padding-top: 6px; margin-left: 8px"><%= softapplication.description.truncate(95, omission: '...') %></div>
<div style="float: left; width: 200px; margin-left: 70px; margin-top: -3px; ">
<%contest = softapplication.contests.first%>
<p>所属竞赛:<%= contest ? link_to(contest.name.truncate(10, omission: '...'), show_softapplication_contest_path(contest), title: contest.name.to_s ) : '尚未加入竞赛'%></p>
<p>所属类别:<%= softapplication.app_type_name %></p>
<p>系统支持:<%= softapplication.android_min_version_available %></p>
</div>
<div style="padding-left: 53px">
<span>开发人员:<%= softapplication.application_developers %></span>
<span style="padding-left: 50px">发布时间:<%=format_time softapplication.created_at %></span>
</div>
<div style="border-left: 1px solid #d9d8d8; border-bottom: 1px solid #d9d8d8; margin-left: 50px; padding-bottom: 10px; margin-bottom: 20px; width: 66%"></div>
<div class="underline-contests_one" style="margin-top: -7px"></div>
<% end %>
</div>
<% else %>
<%= render :partial => "layouts/no_content"%>
<% end %>
</table>
<br />
<%= link_to 'New Softapplication', new_softapplication_path %>
<div class="pagination"><%= pagination_links_full @softapplication_pages, @softapplication_count, :per_page_links => false %></div>
<% html_title l(:label_softapplication_list)%>

View File

@ -27,7 +27,7 @@
<tr>
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all">所属类别:<%= @softapplication.app_type_name %></td>
<% contest = @softapplication.contests.first %>
<td style="width: 240px; word-wrap: break-word; word-break: break-all">所属竞赛:<%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%></td>
<td style="width: 240px; word-wrap: break-word; word-break: break-all">所属竞赛:<%= contest ? link_to(contest.name, show_softapplication_contest_path(contest)) : '尚未加入竞赛'%></td>
</tr>
<tr>
<td style="padding-left: 40px">发布人员:<%= @softapplication.user.name %></td>
@ -56,14 +56,40 @@
<div class="underline-contests_one"></div>
<div style="height: auto; padding-bottom: 10px">
<strong><div style="font-size: 15px">应用简介:</div></strong>
<div><%= @softapplication.description.truncate(150, omission: '...') %></div>
<strong><div style="font-size: 15px;">应用简介:</div></strong>
<div style="padding-top: 5px"><%= @softapplication.description %></div>
</div>
<div class="underline-contests_one"></div>
<div style="height: 240px">
<div style="height: auto; padding-bottom: 10px">
<div style="font-size: 15px;"><strong>应用得分:</strong></div>
<div style="overflow: hidden">
<div style="margin-left: 25%; float: left">
<div style="padding-left: 45px; padding-bottom: 5px">得分比例</div>
<div>
<% 100.step(20,-20) do |star| %>
<div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
<div class="jRatingColor" style="width: <%=star%>%;"></div>
<div class="jRatingAverage" style="width: 0px; top: -20px;"></div>
<div class="jStar" style="width: 115px; height: 20px; top: -40px; background: url(&quot;/images/seems_rateable/stars.png&quot;) repeat-x scroll 0% 0% transparent;">
</div>
</div>
<%= @stars_status_map["star#{(star/20).to_s}".to_sym] %>
<br>
<% end %>
</div>
</div>
<div style="float: left; padding-left: 100px; padding-top:35px ">
<div style="padding-left: 25px;">最终得分</div>
<div style="padding-top: 3px"><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
</div>
</div>
</div>
<div class="underline-contests_one"></div>
<div style="height: auto; padding-bottom: 10px">
<strong><div style="font-size: 15px">软件截图:</div></strong>
<div class="softapplication-img">
<div class="softapplication-img" style="padding-top: 5px">
<% @image_results.take(4).each do |attachment| %>
<%= link_to_attachment_img attachment, :class => "soft-application", :download => "true" %>
<% end %>
@ -72,7 +98,18 @@
</div>
<div class="underline-contests_one"></div>
<!-- <div style="margin-left: 22%;">
<% 100.step(20,-20) do |star| %>
<div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
<div class="jRatingColor" style="width: <%=star%>%;"></div>
<div class="jRatingAverage" style="width: 0px; top: -20px;"></div>
<div class="jStar" style="width: 115px; height: 20px; top: -40px; background: url(&quot;/images/seems_rateable/stars.png&quot;) repeat-x scroll 0% 0% transparent;">
</div>
</div>
<%= @stars_status_map["star#{(star/20).to_s}".to_sym] %>
<br>
<% end %>
</div> -->
<div style="height: 50px">
<div style="font-size: 15px"><strong>软件评论:</strong></div>
<div style="padding-left: 210px">评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %></div>

View File

@ -12,14 +12,13 @@
<tr>
<td><%= user.lastname %><%= user.firstname %></td>
<!-- <td><%= calculate_collaboration_count(user) %></td>
<td><%= calculate_collaboration_count(user) %></td>
<td><%= calculate_influence_count(user) %></td>
<td><%= calculate_skill_count(user) %></td>
<td><%= calculate_file(user) %></td>
<td><%= calculate_issue(user) %></td>
<td><%= calculate_file(user) %></td>
<td><%= calculate_issue(user) %></td>
<td><%= calculate_level(user) %></td>
-->
<td><%= user.changesets.count %></td>
</tr>
<% end %>
</table>

View File

@ -201,7 +201,7 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>最新参赛应用</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'softapplications', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<% if Softapplication.count > 0%>
<div class="d-p-projectlist">

View File

@ -20,59 +20,37 @@
</div>
<div class="main-content-bar">
<div style="float: left">
<%= image_tag(@logoLink, size:'75x75') %>
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<%= image_tag '/images/transparent.png', size: "75x75" %>
<% else%>
<% if params[:school_id] == "0" %>
<%= image_tag '/images/transparent.png', size: "75x75" %>
<% else %>
<% if params[:school_id].nil? %>
<% if School.find(User.current.user_extensions.school.id).logo_link.nil? %>
<%= image_tag '/images/transparent.png', size: "75x75" %>
</div>
<div class="welcome_left" >
<br />
<span class="font_welcome_school"> <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<% else%>
<% if params[:school_id] == "0" %>
<% else %>
<% if params[:school_id].nil? %>
<%= School.find(User.current.user_extensions.school.id).name %>
<br />
<% else %>
<%= image_tag(School.find(User.current.user_extensions.school.id).logo_link, size: "75x75") %>
<%= School.find(params[:school_id]).name %>
<br />
<% end %>
<br />
<% else %>
<%= image_tag(School.find(params[:school_id]).logo_link, size: "75x75") %>
<br />
<% end %>
<% end %>
<% end %>
</div>
<div class="welcome_left" >
<span class="font_welcome_school">
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<% else%>
<% if params[:school_id] == "0" %>
<% else %>
<% if params[:school_id].nil? %>
<%= School.find(User.current.user_extensions.school.id).name %>
<br />
<% else %>
<%= School.find(params[:school_id]).name %>
<br />
<% end %>
<% end %>
<% end %>
</span>
<% end %> </span>
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span>
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<% else %>
<% if params[:school_id] == "0" %>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<% end %>
<% end %>
</div>
<div class="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
</div>
<div style="clear: both;"></div>
</div>
<div class="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
</div>
<div style="clear: both;"></div>
</div>
</div>

View File

@ -1425,7 +1425,7 @@ zh:
label_has_praisers: 赞(%{count})
label_has_watchers: 关注(%{count})
label_has_fans: 粉丝(%{count})
label_coursefile_sharingarea: 课程资源共享
label_coursefile_sharingarea: 课程文件共享专
#modify by men
label_x_has_fans:
zero: 粉丝(%{count})
@ -1547,7 +1547,6 @@ zh:
label_sort_by_time: 按时间排序
label_sort_by_active: 按活跃度排序
label_sort_by_influence: 按影响力排序
label_sort_by_activity: 按动态数排序
label_bids_published: 发布于
label_bids_published_ago: 之前
label_welcome_trustie: Trustie
@ -1668,7 +1667,7 @@ zh:
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
label_course_view_student: 查看其他课程
label_course_student: 学生
label_homework: 课程实践
label_homework: 课程作业
label_course_file: 资源库 #资料共享
label_stores_index: 资源搜索
label_course_new_homework: 新建作业
@ -1716,11 +1715,6 @@ zh:
zero: 份资料
one: 份资料
other: 份资料
#added by gcm
label_x_activity:
zero: 个动态
one: 个动态
other: 个动态
@ -1765,13 +1759,13 @@ zh:
label_has_been: 已经被
label_course_userd_by: 个课程引用
label_school_all: 中国高校
role_of_course: 课程角色
label_student: 学生
#added by Wen
label_school_all: 中国高校
label_project_grade: 项目得分
label_user_grade: 个人得分
label_user_for_project_grade: 个人得分
@ -1829,8 +1823,7 @@ zh:
label_sumbit_empty: 搜索内容不能为空
#add by linchun (竞赛相关)
label_upload_files: 上传资源
label_relation_files: 关联已有资源
label_upload_files: 上传文件
label_upload_softwarepackage: 上传软件包
label_upload_cuttingphoto: 上传截图
label_contests_reward_method: 奖励方式
@ -1869,8 +1862,19 @@ zh:
label_add_contest_succeed_fail: 添加失败,该应用已参赛.
label_no_ftapplication: 暂无应用
label_edit_softapplication: 修改应用
label_contest_delete: 删除竞赛
label_softapplication_list: 应用列表
label_coursefile_sharingarea: 课程资源共享区
label_sort_by_activity: 按动态数排序
label_homework: 课程实践
label_x_activity:
zero: 个动态
one: 个动态
other: 个动态
label_school_all: 中国高校
label_upload_files: 上传资源
label_relation_files: 关联已有资源
label_contest_settings: 配置竞赛
label_contest_delete: 删除竞赛

View File

@ -581,6 +581,9 @@ RedmineApp::Application.routes.draw do
#######confusing########
post 'school/get_options/:province', :to => 'school#get_options'
get 'school/get_options/:province', :to => 'school#get_options'
post 'school/get_province', :to => 'school#get_province'
get 'school/get_province', :to => 'school#get_province'
post 'school/get_schoollist/:province', :to => 'school#get_schoollist'
get 'school/get_schoollist/:province', :to => 'school#get_schoollist'
@ -588,6 +591,8 @@ RedmineApp::Application.routes.draw do
post 'school/search_school/', :to => 'school#search_school'
get 'school/search_school/', :to => 'school#search_school'
post 'school/upload', :to => 'school#upload'
######added by nie
match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
########### added by liuping

View File

@ -0,0 +1,15 @@
class ChangeDefaultLogoForSchool < ActiveRecord::Migration
def up
execute <<-SQL
UPDATE schools SET logo_link = '/images/school/default.png'
WHERE id <> 117
SQL
end
def down
execute <<-SQL
UPDATE schools SET logo_link = '/images/transparent.png'
WHERE id <> 117
SQL
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140424072458) do
ActiveRecord::Schema.define(:version => 20140428013546) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -23,15 +23,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
create_table "apply_project_masters", :force => true do |t|
t.integer "user_id"
t.string "apply_type"
t.integer "apply_id"
t.integer "status"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "attachments", :force => true do |t|
t.integer "container_id"
t.string "container_type", :limit => 30
@ -71,20 +62,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
create_table "bak_mentioned", :primary_key => "Id", :force => true do |t|
t.string "this_real_name", :limit => 1000
t.integer "is_mentioned_in"
t.string "context", :limit => 2000
end
add_index "bak_mentioned", ["this_real_name", "is_mentioned_in"], :name => "name_mention", :length => {"this_real_name"=>900, "is_mentioned_in"=>nil}
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_2"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_3", :length => {"this_real_name"=>900}
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_4"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_5"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_6"
create_table "biding_projects", :force => true do |t|
t.integer "project_id"
t.integer "bid_id"
@ -124,11 +101,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
add_index "boards", ["project_id"], :name => "boards_project_id"
create_table "categories", :primary_key => "Id", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "proj_categories"
end
create_table "changes", :force => true do |t|
t.integer "changeset_id", :null => false
t.string "action", :limit => 1, :default => "", :null => false
@ -293,14 +265,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id"
create_table "eco_projects", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.integer "eco_proj_id"
t.datetime "date_collected"
end
add_index "eco_projects", ["proj_id"], :name => "proj_id"
create_table "enabled_modules", :force => true do |t|
t.integer "project_id"
t.string "name", :null => false
@ -322,137 +286,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
create_table "events", :primary_key => "event_id", :force => true do |t|
t.string "job_name"
t.datetime "event_time"
t.string "event_type", :limit => 20
end
create_table "fm_article", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "article_title", :limit => 16777215
t.text "article_link", :limit => 16777215
t.text "article_time", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_article", ["proj_id"], :name => "proj_id"
create_table "fm_bugtracker_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_bugtracker_link", ["proj_id"], :name => "proj_id"
create_table "fm_datametric_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_datametric_link", ["proj_id"], :name => "proj_id"
create_table "fm_dependency_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_dependency_link", ["proj_id"], :name => "proj_id"
create_table "fm_download_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "download_link", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_download_link", ["proj_id"], :name => "proj_id"
create_table "fm_heartbeat", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.float "popularity_score", :limit => 12
t.float "vitality_score", :limit => 12
t.integer "subscription"
t.integer "voting_score"
t.integer "voting_count"
t.datetime "date_collected"
end
add_index "fm_heartbeat", ["proj_id"], :name => "proj_id"
create_table "fm_license", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_license", ["proj_id"], :name => "proj_id"
create_table "fm_mailinglist_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_mailinglist_link", ["proj_id"], :name => "proj_id"
create_table "fm_operating_system", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_operating_system", ["proj_id"], :name => "proj_id"
create_table "fm_programming_language", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_programming_language", ["proj_id"], :name => "proj_id"
create_table "fm_project_spotlight", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.text "project_name", :limit => 16777215
t.text "project_spotlight_link", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_project_spotlight", ["proj_id"], :name => "proj_id"
create_table "fm_release", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.text "release_version", :limit => 16777215
t.text "release_time", :limit => 16777215
t.text "release_tag", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_release", ["proj_id"], :name => "proj_id"
create_table "fm_submit", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "submitter", :limit => 16777215
t.text "submitter_link", :limit => 16777215
t.text "submit_time", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_submit", ["proj_id"], :name => "proj_id"
create_table "fm_summary", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_summary", ["proj_id"], :name => "proj_id"
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.string "description", :default => ""
@ -685,22 +518,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "news", ["created_on"], :name => "index_news_on_created_on"
add_index "news", ["project_id"], :name => "news_project_id"
create_table "no_uses", :force => true do |t|
t.integer "user_id", :null => false
t.string "no_use_type"
t.integer "no_use_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "ohloh_tagged", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.string "description", :limit => 100, :null => false
t.datetime "date_collected"
end
add_index "ohloh_tagged", ["proj_id"], :name => "proj_id"
create_table "open_id_authentication_associations", :force => true do |t|
t.integer "issued"
t.integer "lifetime"
@ -716,19 +533,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
t.string "salt", :null => false
end
create_table "open_source_projects", :force => true do |t|
t.string "name"
t.text "description"
t.integer "commit_count", :default => 0
t.integer "code_line", :default => 0
t.integer "users_count", :default => 0
t.date "last_commit_time"
t.string "url"
t.date "date_collected"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "praise_tread_caches", :force => true do |t|
t.integer "object_id", :null => false
t.string "object_type"
@ -808,23 +612,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
create_table "relative_memos", :force => true do |t|
t.integer "osp_id", :null => false
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
t.integer "last_reply_id"
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
end
create_table "repositories", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.string "url", :default => "", :null => false
@ -983,22 +770,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id"
add_index "tokens", ["value"], :name => "tokens_value", :unique => true
create_table "tprojects", :force => true do |t|
t.string "name", :limit => 1000, :default => "0"
t.text "description", :limit => 16777215
t.string "commit_count", :limit => 100, :default => "0"
t.string "code_line", :limit => 100
t.string "last_commit_time", :limit => 100
t.string "url", :limit => 1000
t.datetime "date_collected"
t.string "created_at", :limit => 100
t.string "updated_at", :limit => 100
t.integer "proj_id", :null => false
t.string "user_count", :limit => 100
end
add_index "tprojects", ["proj_id"], :name => "proj_id"
create_table "trackers", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.boolean "is_in_chlog", :default => false, :null => false

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

@ -624,7 +624,7 @@ ul.tool li{list-style-type:none;
font-family: Tahoma,"Microsoft YaHei";
font-weight: bold;
font-size: 20px;
color:#FF9900;
color:#e8770d;
}
.font_welcome_Cdescription{

View File

@ -235,7 +235,7 @@ body {
top: 200px;
}
#WOpenWindow .school_list{
width1000px;
width: 900px;
line-height: 20px;
}
@ -257,6 +257,12 @@ body {
}
#WOpenWindow .content{
width: 1000px;
height: 220px;
overflow: scroll;
}
#WOpenWindow .pcontent{
}

View File

@ -2247,130 +2247,4 @@ ul.messages-for-user-reply li {
.footer_text_link{
margin: 0px 5px;
}
/*gcm*/
#ver-zebra, .file_table_des
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 5px 10px;
width: 98%;
text-align: left;
border-collapse: collapse;
line-height: 20px;
font-size: 14px;
}
#ver-zebra th
{
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
text-align: left;
}
#ver-zebra td
{
padding: 8px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
#ver-zebra td.description {
background-color: white;
padding: 0px;
margin: 0px auto;
}
div.tags_area {
padding: 2px 10px 10px 10px;
margin: 0px;
margin-bottom: 10px;
/*border-bottom: 1px dashed #CCCCCC;*/
overflow: hidden;
position: relative;
}
.tags_gradint {
}
.read-more{
padding: 5px;
border-top: 4px double #ddd;
background: #fff;
color: #333;
}
.read-more a{
padding-right: 22px;
background: url() no-repeat 100% 50%;
font-weight: bold;
text-decoration: none;
}
.read-more a:hover{
color: #000;
}
.vzebra-odd
{
background: #eff2ff;
}
.vzebra-even
{
background: #e8edff;
}
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children
{
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action
{
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
.filename{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.pagination{
margin: 10px 0px;
height: 1.5em;
text-align: left;
font-size: 13px;
}
.m5p5{
display: inline-block;
height: auto;
color: white !important;
margin: 8px;
padding: 3px 7px;
}
.m5p5:hover {
text-decoration: none;
/*padding-bottom: 3px;*/
/*border-bottom: 1px solid #666666;*/
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 3px 3px 3px #666666;
}
.relation_file_div{
margin: 0px 25px;
}
.relation_file_div fieldset{
margin: 0px 0px;
padding: 10px;
border-radius: 5px;
transition: all 2s linear 1s;
}
.relation_file_div input#attach_search:focus{
border: 1px solid #1B95C6;
box-shadow: 0px 0px 4px #1B95C6;
width: 200px;
}
.relation_file_div input#attach_search{
width: 150px;
outline: none;
border-radius: 5px;
-webkit-transition: 1s width;
-moz-transition : 1s width;
-o-transition : 1s width;
transition : 1s width;
}
/*gcm*/