This commit is contained in:
sw 2014-05-21 15:31:05 +08:00
commit 8bb8de7d7f
45 changed files with 1084 additions and 413 deletions

View File

@ -124,7 +124,12 @@ class AttachmentsController < ApplicationController
end
respond_to do |format|
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum,@attachment.container) }
if @project.nil?
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum,@attachment.container) }
else
format.html { redirect_to_referer_or project_path(@project)}
end
format.js
end
end
@ -204,7 +209,12 @@ private
end
def read_authorize
@attachment.visible? ? true : deny_access
if @attachment.container_type == "HomeworkAttach"
true
#User.current.allowed_to?(:view_homework_attaches, @attachment.project) ? true : deny_access
else
@attachment.visible? ? true : deny_access
end
end
def delete_authorize

View File

@ -5,7 +5,7 @@ class ContestsController < ApplicationController
menu_item :project, :only => :show_project
menu_item :application, :only => :show_softapplication
menu_item :attendingcontest, :only => :show_attendingcontest
before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward,
before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :set_reward_project, :set_reward_softapplication, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward,
:show_contest_project, :show_contest_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings]
# added by fq
@ -335,7 +335,12 @@ class ContestsController < ApplicationController
end
##取出参赛应用
@softapplication = Softapplication.all
@contesting_softapplication = @contest.contesting_softapplications.reverse
@contesting_softapplication = @contest.contesting_softapplications.
joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id").
joins("LEFT JOIN (
SELECT * FROM seems_rateable_cached_ratings WHERE cacheable_type='Softapplication' AND DIMENSION = 'quality') AS cached
ON cached.cacheable_id=softapplications.id").
order("cached.avg").reverse_order
@contesting_softapplication = paginateHelper @contesting_softapplication, 10
@ -350,6 +355,44 @@ class ContestsController < ApplicationController
end
###end
def set_reward_project
@c_p = nil
@contesting_project_id = nil
if params[:set_reward_project][:reward]&&((User.current.id==@contest.author_id)||User.current.admin)
# @bid_id = params[:id]
@contesting_project_id = params[:set_reward_project][:c_id]
@c_p = ContestingProject.find_by_id(@contesting_project_id)
# 把字段存进表中
@c_p.update_reward(params[:set_reward_project][:reward].to_s)
end
respond_to do |format|
format.js
end
end
def set_reward_softapplication
@c_sa = nil
@contesting_softapplication_id = nil
if params[:set_reward_softapplication][:reward]&&((User.current.id==@contest.author_id)||User.current.admin)
# @bid_id = params[:id]
@contesting_softapplication_id = params[:set_reward_softapplication][:c_id]
@c_sa = ContestingSoftapplication.find_by_id(@contesting_softapplication_id)
# 把字段存进表中
@c_sa.update_reward(params[:set_reward_softapplication][:reward].to_s)
end
respond_to do |format|
format.js
end
end
###添加已创建的参赛项目
def add
project = Project.find(params[:contest])

View File

@ -52,16 +52,59 @@ class FilesController < ApplicationController
end
def create
container = (params[:version_id].blank? ? @project : @project.versions.find_by_id(params[:version_id]))
attachments = Attachment.attach_filesex(container, params[:attachments],params[:attachment_type])
render_attachment_warning_if_needed(container)
if params[:tag_name]
tag_saveEx
render :text =>"success"
else
@addTag=false
container = (params[:version_id].blank? ? @project : @project.versions.find_by_id(params[:version_id]))
attachments = Attachment.attach_filesex(container, params[:attachments],params[:attachment_type])
render_attachment_warning_if_needed(container)
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
Mailer.attachments_added(attachments[:files]).deliver
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
Mailer.attachments_added(attachments[:files]).deliver
end
redirect_to project_files_path(@project)
end
redirect_to project_files_path(@project)
end
def tag_saveEx
@tags = params[:tag_name][:name]
@obj_id = params[:object_id]
@obj_flag = params[:object_flag]
case @obj_flag
when '1' then
@obj = User.find_by_id(@obj_id)
when '2' then
@obj = Project.find_by_id(@obj_id)
when '3' then
@obj = Issue.find_by_id(@obj_id)
when '4' then
@obj = Bid.find_by_id(@obj_id)
when '5' then
@obj = Forum.find_by_id(@obj_id)
when '6'
@obj = Attachment.find_by_id(@obj_id)
when '7' then
@obj = Contest.find_by_id(@obj_id)
when '8'
@obj = OpenSourceProject.find_by_id(@obj_id)
else
@obj = nil
end
unless @obj.nil?
@obj.tag_list.add(@tags.split(","))
else
return
end
if @obj.save
## 执行成功的操作。
else
#捕获异常
end
end
# 返回制定资源类型的资源列表
def getattachtype
sort_init 'created_on', 'desc'

View File

@ -33,12 +33,12 @@ class ProjectsController < ApplicationController
menu_item l(:label_course_news), :only => :index
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise]
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches]
# before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
# :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
# :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen]
before_filter :authorize_global, :only => [:new, :create]
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches]
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
before_filter :file, :statistics, :watcherlist

View File

@ -100,14 +100,34 @@ class SoftapplicationsController < ApplicationController
# POST /softapplications
# POST /softapplications.json
# def create
# @softapplication = Softapplication.new(params[:softapplication])
# @softapplication.user = User.current
# @softapplication.save_attachments(params[:attachments])
# respond_to do |format|
# if @softapplication.save
# format.js
# format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' }
# # format.json { render json: @softapplication, status: :created, location: @softapplication }
# else
# format.js { render status: 406 }
# format.html { render action: "new" }
# # format.json { render json: @softapplication.errors, status: :unprocessable_entity }
# end
# end
# end
#new changed created function
def create
@softapplication = Softapplication.new(params[:softapplication])
@softapplication.user = User.current
@softapplication.save_attachments(params[:attachments])
respond_to do |format|
if @softapplication.save
ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id)
format.js
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' }
format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]) }
# format.json { render json: @softapplication, status: :created, location: @softapplication }
else
format.js { render status: 406 }
@ -115,8 +135,13 @@ class SoftapplicationsController < ApplicationController
# format.json { render json: @softapplication.errors, status: :unprocessable_entity }
end
end
#关联新建的参赛作品
# @contesting_softapplication = paginateHelper @contest.contesting_softapplications
end
# PUT /softapplications/1
# PUT /softapplications/1.json
def update

View File

@ -30,7 +30,7 @@ class UsersController < ApplicationController
#Ended by young
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info,
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info,
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index]
#edit has been deleted by huang, 2013-9-23
@ -39,10 +39,10 @@ class UsersController < ApplicationController
:watch_bids, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index]
before_filter :auth_user_extension, only: :show
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx
#william
before_filter :require_login, :only => :tag_save
before_filter :require_login, :only => [:tag_save,:tag_saveEx]
helper :sort
@ -209,6 +209,8 @@ class UsersController < ApplicationController
## 判断课程是否过期 [需封装]
@memberships_doing = []
@memberships_done = []
@OwningCouses =[]
@JoinCouses=[]
now_time = Time.now.year
@memberships.map { |e|
end_time = e.project.course_extra.get_time.year
@ -218,6 +220,12 @@ class UsersController < ApplicationController
else
@memberships_doing.push e
end
if e.project.course_extra.tea_id == User.current.id
@OwningCouses.push e
else
@JoinCouses.push e
end
}
# respond_to do |format|
# format.html
@ -683,11 +691,51 @@ class UsersController < ApplicationController
#捕获异常
end
respond_to do |format|
format.html
format.js
end
format.html
end
end
def tag_saveEx
@tags = params[:tag_name][:name]
@obj_id = params[:obj_id]
@obj_flag = params[:obj_flag]
case @obj_flag
when '1' then
@obj = User.find_by_id(@obj_id)
when '2' then
@obj = Project.find_by_id(@obj_id)
when '3' then
@obj = Issue.find_by_id(@obj_id)
when '4' then
@obj = Bid.find_by_id(@obj_id)
when '5' then
@obj = Forum.find_by_id(@obj_id)
when '6'
@obj = Attachment.find_by_id(@obj_id)
when '7' then
@obj = Contest.find_by_id(@obj_id)
when '8'
@obj = OpenSourceProject.find_by_id(@obj_id)
else
@obj = nil
end
unless @obj.nil?
@obj.tag_list.add(@tags.split(","))
else
return
end
if @obj.save
## 执行成功的操作。
else
#捕获异常
end
respond_to do |format|
format.js
format.html
end
end
###add by huang
def user_watchlist
end

View File

@ -182,11 +182,27 @@ module ApplicationHelper
end
def thumbnail_tag(attachment)
link_to image_tag(thumbnail_path(attachment)),
named_attachment_path(attachment, attachment.filename),
imagepath = named_attachment_path(attachment, attachment.filename)
link_to image_tag(imagepath),
imagepath ,
:title => attachment.filename
end
# 图片缩略图链接
def thumbnail_small_tag(attachment)
imagesize = attachment.thumbnail(:size => "200*200")
imagepath = named_attachment_path(attachment, attachment.filename)
if imagesize
link_to image_tag(imagesize),
imagepath,
:title => attachment.filename
else
link_to image_tag(imagepath , height: '200', width: '250'),
imagepath,
:title => attachment.filename
end
end
def toggle_link(name, id, options={})
onclick = "$('##{id}').toggle(); "
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")

View File

@ -91,6 +91,10 @@ module ContestsHelper
def get_prize(c_project)
c_project.get_reward
end
def get_prize(c_softapplication)
c_softapplication.get_reward
end
def count_contest_project
contests = Contest.find(:id)

View File

@ -34,4 +34,8 @@ module OpenSourceProjectsHelper
def get_open_source_projects_by_tag(tag_name)
OpenSourceProject.tagged_with(tag_name).order('created_at desc')
end
def show_origin(url)
end
end

View File

@ -228,7 +228,6 @@ class Attachment < ActiveRecord::Base
end
size = 100 unless size > 0
target = File.join(self.class.thumbnails_storage_path, "#{id}_#{digest}_#{size}.thumb")
begin
Redmine::Thumbnail.generate(self.diskfile, target, size)
rescue => e

View File

@ -11,5 +11,18 @@ class ContestingSoftapplication < ActiveRecord::Base
self.create(:user_id => User.current.id, :contest_id => contest_id,
:softapplication_id => softapplication_id, :description => description)
end
def self.create_work_contesting(contest_id, softapplication_id)
self.create(:user_id => User.current.id, :contest_id => contest_id,
:softapplication_id => softapplication_id)
end
def update_reward(which)
self.update_attribute(:reward,which)
end
def get_reward
self.reward
end
end

View File

@ -2,7 +2,7 @@ class Course < ActiveRecord::Base
include Redmine::SafeAttributes
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password
belongs_to :project, :class_name => 'Project', :foreign_key => :extra # 定义一个project方法 该方法通过extra来调用project表
belongs_to :project, :class_name => 'Project', :foreign_key => :extra, primary_key: :identifier
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表
has_many :bid

View File

@ -29,6 +29,13 @@ class HomeworkAttach < ActiveRecord::Base
result
end
def project
work = HomeworkForCourse.find_by_bid_id(self.bid_id)
if work
work.project
end
end
def add_jours options
jfm = self.journals_for_messages.build(options)
jfm.save

View File

@ -1,5 +1,5 @@
class Softapplication < ActiveRecord::Base
attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers
attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url
acts_as_attachable
seems_rateable :allow_update => true, :dimensions => :quality

View File

@ -18,6 +18,11 @@
require "digest/sha1"
class User < Principal
TEACHER = 0
STUDENT = 1
ENTERPRISE = 2
DEVELOPER = 3
include Redmine::SafeAttributes
# Different ways of displaying/sorting users

View File

@ -33,7 +33,7 @@
<% if images.any? %>
<div class="thumbnails">
<% images.each do |attachment| %>
<div><%= thumbnail_tag(attachment) %></div>
<div><%= thumbnail_small_tag(attachment) %></div>
<% end %>
</div>
<% end %>

View File

@ -12,5 +12,6 @@ fileSpan.find('a.remove-upload')
})
.off('click');
var divattach = fileSpan.find('div.div_attachments');
divattach.html('<%= j(render :partial => 'tags/tag', :locals => {:obj => @attachment, :object_flag => "6"})%>');
divattach.html('<%#= j(render :partial => 'tags/tagEx', :locals => {:obj => @attachment, :object_flag => "6"})%>');
<% end %>

View File

@ -1,15 +1,14 @@
$('#reward_result_<%= @contesting_project_id %>').html('<%= j(
if get_prize(@b_p).nil? or get_prize(@b_p) == ""
if get_prize(@c_p).nil? or get_prize(@c_p) == ""
if @contest.deadline < Date.today
puts '未评奖'
end
else
case get_prize(@b_p)
case get_prize(@c_p)
when '-1'
image_tag("/images/bid/special_reward.png")
when '1'
when '0'
image_tag("/images/bid/first_reward.png")
when '1'
@ -22,7 +21,7 @@ else
image_tag("/images/bid/fifth_reward.png")
when '5'
image_tag("/images/bid/qualified.png")
end
end
end
)

View File

@ -0,0 +1,30 @@
$('#reward_result_<%= @contesting_softapplication_id %>').html('<%= j(
if get_prize(@c_sa).nil? or get_prize(@c_sa) == ""
if @contest.deadline < Date.today
puts '未评奖'
end
else
case get_prize(@c_sa)
when '-1'
image_tag("/images/bid/special_reward.png")
when '0'
image_tag("/images/bid/first_reward.png")
when '1'
image_tag("/images/bid/second_reward.png")
when '2'
image_tag("/images/bid/third_reward.png")
when '3'
image_tag("/images/bid/forth_reward.png")
when '4'
image_tag("/images/bid/fifth_reward.png")
when '5'
image_tag("/images/bid/qualified.png")
end
end
)
%>')
$('#<%= @contesting_softapplication_id %>').hide()

View File

@ -61,41 +61,39 @@
</script>
<!--参赛步骤-->
<div style="padding-left: 17px; padding-bottom: 15px">
温馨提示:如果您希望在我们平台托管参赛数据和代码,请按下面参赛步骤参赛
<div style="padding-left: 17px; padding-bottom: 10px; color: grey">
温馨提示:如果您准备参加竞赛,请点击下面的"新建参赛作品"
</div>
<% if User.current.logged? %>
<div style="padding-bottom: 10px; line-height: 25px">
<div style="padding-left: 17px; font-size: 15px">
<strong>参赛步骤:</strong>
<div style="padding-bottom: 10px; line-height: 15px">
<div style="padding-left: 82px; font-size: 14px">
<span><strong>参加竞赛:</strong></span>
<span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
</div>
<div style="padding-left: 82px; ">
<!-- <div style="padding-left: 82px; ">
<span style="padding-top: 50px">步骤1</span>
<span><%#= link_to '新建参赛作品', new_softapplication_path(:target=>'_blank'), :target=>'_blank' %></span>
<span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
<span style="font-size: 12px; color: grey">先点击“新建参赛作品”然后刷新页面再继续步骤2。</span>
</div>
<div style="padding-left: 82px; ">
<span style="padding-top: 50px">步骤2</span>
<span><%= link_to '关联参赛作品', "javascript:void(0);", onclick: "$('#put-bid-form').toggle();" %></span>
</div>
</div> -->
</div>
<!--点击新建参赛作品弹出框-->
<div id="put-project-form" style="display: none; padding-left: 83px; width: 70%">
<%= form_for Softapplication.new, :remote=>true, :url => softapplications_path, :complete => '$("#put-bid-form").hide();' do |f| %>
<fieldset style="padding-left: 36px" class="contes-new-box">
<tr style="width:700px; margin-left: -10px">
<span><%= l(:label_softapplication_name) %></span>
<!--点击新建参赛作品弹出框新建参赛作品并关联到竞赛中-->
<div id="put-project-form" style="display: none; padding-left: 83px; width: 88%">
<%= form_for Softapplication.new, :url => softapplications_path do |f| %>
<fieldset class="contes-new-box", style="padding-left: 36px; line-height: 10px">
<%= hidden_field_tag 'contest_id', @contest.id %>
<tr style="width:700px; margin-left: -10px;">
<span><%= l(:label_work_name) %></span>
<span class="contest-star"> * </span>: <td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr><br/>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_version_available) %></span>
<span><%= l(:label_running_platform) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr><br/>
@ -103,7 +101,7 @@
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_type) %></span>
<span><%= l(:label_work_type) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
@ -112,9 +110,9 @@
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_description) %></span>
<span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(125个汉字以内)</span>
</tr><br/>
<br />
<br />
@ -129,53 +127,32 @@
<fieldset style="width: 500px; padding-top: 10px">
<legend>
上传应用软件包和应用截图
上传作品软件包和作品截图
</legend>
<%= render_flash_messages %>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
<p style="font-size: 10px">
1、<%= l(:label_upload_softapplication_packets_mustpacketed)%>
<p style="font-size: 11px">
1、<%= l(:label_upload_softapplication_packets_mustpacketed)%> <br />
<br>
2、<%= l(:label_upload_softapplication_photo_condition)%>
</p>
<p style="font-size: 10px; color: red">
<p style="font-size: 11px; color: red">
<%= l(:label_updated_caution)%>
</p>
</fieldset>
</fieldset></br>
<div class="align-center" style="padding-top: -3px; padding-bottom: 8px">
<%= submit_tag l(:button_create), :onclick => "cancel();" %>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
:type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
</div>
<% end %>
</div>
<!--点击关联参赛作品后弹出关联框-->
<div id="put-bid-form" style="display: none; padding-left: 83px; width: 70%">
<%= form_for "contest_for_save", :remote=>true, :url => {:controller => 'contests', :action => 'add_softapplication'}, :update => "contesting_softapplication_list", :complete => '$("#put-bid-form").hide();' do |f| %>
<table id="contesting_table" border="0" width="102%" style="margin-left: -3px;">
<!--该table为点击关联参赛作品后弹出的-->
<tr style="padding-left: 50px">
<%= select_tag 'contest', options_for_select(select_option_app_helper(@softapplication)), :name => 'contest', :class => 'grayline' %>
</tr>
<tr>
<td><%= f.text_area :contest_message, :id => "contest_message", :required => true, :rows => 2, :cols => 40, :placeholder => l(:label_bid_reason), :style => "resize: none;", :class => 'noline'%></td>
</tr>
<tr>
<td align="right"> <%= submit_tag l(:button_add), :name => nil , :class => "enterprise",
:onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
:type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %> </td>
</tr>
</table>
<% end %>
</div>
<% end %>
@ -189,10 +166,63 @@
<% if c_project.project %>
<div style="padding-left: 18px">
<div style="font-size: 15px">
<tr>
<td><strong>参赛作品: </strong></td>
<td> <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </td>
</tr></br>
<div>
<div><strong>参赛作品: <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </strong>
<div style="float: right">
<td style="color: #ec6300;" align="right" valign="0.1em" width="16%">
<strong>
<span id="reward_result_<%=c_project.id%>"> <!-- 调用js进行刷新 -->
<% if get_prize(c_project).nil? or get_prize(c_project) == "" %>
<% if @contest.deadline < Date.today %>
<span style="color: red"><%= l(:label_noawards)%></span>
<% else%>
<span style="color: red"><%= l(:label_noawards_current)%></span>
<% end %>
<% else %>
<% case get_prize(c_project) %>
<% when '-1' %>
<%= image_tag("/images/bid/special_reward.png")%>
<% when '0' %>
<%= image_tag("/images/bid/first_reward.png")%>
<% when '1' %>
<%= image_tag("/images/bid/second_reward.png")%>
<% when '2' %>
<%= image_tag("/images/bid/third_reward.png")%>
<% when '3' %>
<%= image_tag("/images/bid/forth_reward.png")%>
<% when '4' %>
<%= image_tag("/images/bid/fifth_reward.png")%>
<% when '5' %>
<%= image_tag("/images/bid/qualified.png")%>
<% end %>
<% end %>
</span>
</strong>
</td>
<!-- 评价显隐控制按钮-->
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
<td valign="top" align="right" width="10%">
<span> <%= toggle_link '评奖', c_project.id.to_s %></span>
<!-- 评价应标项目的表单 -->
<span style="display: none; vertical-align: top " id = '<%= c_project.id %>'>
<%= form_for "set_reward_project",:remote=>true,:url=>set_reward_project_contest_path do |f| %>
<%= f.text_field :c_id,:style => "display:none",:value => c_project.id,:size=>"0" %>
<%= f.select :reward,"<option value = '-1'>#{l(:label_special_reward)}</option>
<option value = '0'>#{l(:label_first_reward)}</option>
<option value = '1'>#{l(:label_second_reward)}</option>
<option value = '2'>三等奖</option>
<option value = '3'>四等奖</option>
<option value = '4'>五等奖</option>
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
<%= f.submit "提交",:class=>"submit" %>
<% end %>
</span>
</td>
<% end %>
</div>
</div>
</div></br>
</div>
<div style="padding-left: 68px">
<tr>
@ -201,11 +231,12 @@
</tr></br>
</div>
<div style="padding-left: 68px; padding-bottom: 8px">
<tr>
<td>发布时间:</td>
<td> <%= format_time c_project.created_at%> </td>
<span><strong>参赛时间:</strong><%= format_time c_project.created_at%></span>
<span style="padding-left: 240px"><strong>参赛代表:</strong><%= c_project.user.name %></span>
</div>
<div style="padding-left: 68px">
</tr>
</div>
</div>
<% end %>
@ -221,18 +252,75 @@
<td> <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> </td>
</tr></br>
</div>
<div style="padding-left: 68px">
<div style="padding-left: 68px; padding-top: 5px">
<tr>
<td>简介:</td>
<td><strong>简介:</strong></td>
<td> <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %> </td>
</tr></br>
</div>
<div style="padding-left: 68px; padding-bottom: 8px">
<tr>
<td>发布时间:</td>
<td> <%= format_time c_softapplication.created_at %> </td>
</tr>
<div style="padding-left: 68px; pading-bottom: 8px">
<span><strong>参赛时间:</strong><%= format_time c_softapplication.created_at %></span>
<span style="padding-left: 240px"><strong>参赛代表:</strong><%= c_softapplication.softapplication.user.name %></span>
</div>
<!--获奖及教师评奖-->
<div style="padding-left: 18px; padding-bottom: 5px">
<span style="padding-left: 50px"><strong>最终得分:</strong></span><span style="color: red"><%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分</span>
<span style="padding-left: 334px">
<td>
<strong>
<span id="reward_result_<%=c_softapplication.id%>" > <!-- 调用js进行刷新 -->
<% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %>
<% if @contest.deadline < Date.today %>
<span style="color: red"><%= l(:label_noawards)%></span>
<% else%>
<span style="color: red"><%= l(:label_noawards_current)%></span>
<% end %>
<% else %>
<% case get_prize(c_softapplication) %>
<% when '-1' %>
<%= image_tag("/images/bid/special_reward.png")%>
<% when '0' %>
<%= image_tag("/images/bid/first_reward.png")%>
<% when '1' %>
<%= image_tag("/images/bid/second_reward.png")%>
<% when '2' %>
<%= image_tag("/images/bid/third_reward.png")%>
<% when '3' %>
<%= image_tag("/images/bid/forth_reward.png")%>
<% when '4' %>
<%= image_tag("/images/bid/fifth_reward.png")%>
<% when '5' %>
<%= image_tag("/images/bid/qualified.png")%>
<% end %>
<% end %>
</span>
</strong>
</td>
<!-- 评价显隐控制按钮-->
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
<div style="valign="top" align="right" width="10%"">
<span style="padding-right: 5px; padding-top: 1px"> <%= toggle_link '评奖', c_softapplication.id.to_s %></span>
<!-- 评价应标项目的表单 -->
<span style="display: none; vertical-align: top " id = '<%= c_softapplication.id %>'>
<%= form_for "set_reward_softapplication",:remote=>true,:url=>set_reward_softapplication_contest_path do |f| %>
<%= f.text_field :c_id,:style => "display:none",:value => c_softapplication.id,:size=>"0" %>
<%= f.select :reward,"<option value = '-1'>#{l(:label_special_reward)}</option>
<option value = '0'>#{l(:label_first_reward)}</option>
<option value = '1'>#{l(:label_second_reward)}</option>
<option value = '2'>三等奖</option>
<option value = '3'>四等奖</option>
<option value = '4'>五等奖</option>
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
<%= f.submit "提交",:class=>"submit" %>
<% end %>
</span>
</div>
<% end %>
</span>
</div>
</div>
<% end %>

View File

@ -2,9 +2,8 @@
<% versions = project.versions.sort %>
<% attachmenttypes = project.attachmenttypes %>
<%= error_messages_for 'attachment' %>
<%= form_tag(project_files_path(project), :multipart => true, :class => "tabular") do %>
<%= form_tag(project_files_path(project), :multipart => true,:name=>"upload_form", :class => "tabular") do %>
<div class="box">
<p>
<table>
<tr>
@ -34,4 +33,26 @@
</div>
<%= submit_tag l(:button_add) %>
<% end %>
<div class="line_under" style="margin:20px 0px;"></div>
<div class="line_under" style="margin:20px 0px;"></div>
<script type='text/javascript'>
function tagAddClick(id,objId,objTag)
{
alert("OK");
$.ajax({
type :"POST",
url :'<%= users_tag_saveEx_path%>',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag:encodeURIComponent(objTag)
},
success: function(data, textStatus){
alert("OK");
$(id).empty();
$(id).html('123');
$("#" + id + " #name").val("");
}
})
}
</script>

View File

@ -20,7 +20,6 @@
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('tags', :caption => l(:label_tag), :id => "vzebra-tag") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
@ -52,14 +51,15 @@
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
<td class='filename' style="font-size: 13px; ">
</tr>
<tr>
<td class='description' colspan="6">
<div class="tags_area">
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= 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>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>
</td>
</tr>
<% end -%>

View File

@ -20,7 +20,6 @@
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-contenttype")%>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('tags', :caption => l(:label_tag), :id => "vzebra-tag") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
@ -48,15 +47,17 @@
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
<td class='filename' style="font-size: 13px; ">
<div class="tags_area">
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= 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>
</td>
</tr>
<tr>
<td class='description' colspan="6">
<div class="tags_area">
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= 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>
</td>
</tr>
<% end -%>
<% end -%>

View File

@ -25,9 +25,10 @@
:onchange => "attachment_contenttypes_searchex(this.value)" %>
<% end %>
<div id="upload_file_div" class="relation_file_div hidden">
<%= render :partial => 'new', locals: {project: @project} %>
</div>
<div id="upload_file_div" class="relation_file_div hidden">
<%= render :partial => 'new', locals: {project: @project} %>
</div>
<div id="relation_file_div" class="relation_file_div hidden">
<fieldset>
<legend>搜索</legend>
@ -185,4 +186,27 @@
}
});
}
</script>
</script>
<script type='text/javascript'>
function tagAddClick(divid,objId,objTag)
{
alert("OK");
$.ajax({
type :"POST",
url :'/users/tag_saveEx',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag:encodeURIComponent(objTag)
},
success: function(data, textStatus){
alert("OK");
$(divid).empty();
$(divid).html('123');
$("#" + divid + " #name").val("");
}
})
}
</script>

View File

@ -140,7 +140,7 @@
<!--info-->
<div class="inf_user_context">
<table style="font-family:微软雅黑">
<table>
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr>
@ -266,5 +266,7 @@
</div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</div>
</body>
</html>

View File

@ -110,8 +110,7 @@
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
</td>
<td class="comments">
<div class="reply_content" ><%=h reply.content.html_safe %></div>
<!-- <div class="wiki">< %=h reply.content.html_safe %></div> -->
<div class="reply_content" ><%=h sanitize(reply.content.html_safe) %></div>
<p>
<% if reply.attachments.any?%>
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
@ -140,3 +139,11 @@
<hr/>
</div>
<% end %>
<script type="text/javascript">
jQuery(document).ready(function($) {
transpotUrl('.lz');
transpotUrl('.replies');
});
</script>

View File

@ -185,3 +185,9 @@
<% end %>
<% html_title @topic.subject %>
<script type="text/javascript">
jQuery(document).ready(function($) {
transpotUrl('#content');
});
</script>

View File

@ -1,100 +1,108 @@
<!-- added by huang -->
<%
if @project.project_type == 1
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
else
btn_tips = l(:label_news_new)
label_tips = l(:label_news)
end
if @project.project_type == Project::ProjectType_course
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
else
btn_tips = l(:label_news_new)
label_tips = l(:label_news)
end
%>
<% if @project && User.current.allowed_to?(:manage_news, @project) %>
<div class="content-title-top">
<%= link_to(btn_tips,
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
</div>
<div id="add-news" class="add_frame" style="display:none;">
<%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit --> |
<%= preview_link preview_news_path(:project_id => @project), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' ,:class => 'whiteButton m3p10' %>
<% end if @project %>
<div id="preview" class="wiki"></div>
</div>
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
<%= label_tips %>
</span>
<%= link_to(btn_tips,
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<% if @project && User.current.allowed_to?(:manage_news, @project) %>
<div id="add-news" class="add_frame" style="display:none;">
<%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/form', :locals => {:f => f} %>
<%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit --> |
<%= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %>
<% end if @project %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<!--add by huang :list news-->
<h3 style="font-weight:400; margin-left:0px; margin-top:-12px; margin-left:-5px; border-bottom:1px solid #f0f0f0"><%=label_tips%></h3>
<div>
<% if @newss.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<% @newss.each do |news| %>
<table class="content-text-list">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td>
<td>
<table width="580px" border="0">
<% if @project.project_type == 1 %>
<tr>
<td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice)%></span><span><%= link_to h(news.title), news_path(news) %></span>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
</tr>
<% else %>
<tr>
<td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare)%></span><span> <%= link_to h(news.title), news_path(news) %></span>
<span style="float: right" class='delete_icon'> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
</tr>
<% end %>
<tr>
<td colspan="2" width="580px" ><span class="font_description"><%= textilizable(news, :description) %></span></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>&nbsp;<%= format_time(news.created_on) %></span></td>
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td>
</tr>
</table></td>
</tr>
</table>
<% end %>
<% end %>
<% if @newss.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<% @newss.each do |news| %>
<table class="content-text-list">
<tr>
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td>
<td>
<table width="580px" border="0">
<% if @project.project_type == 1 %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span><span><%= link_to h(news.title), news_path(news) %></span>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span>
</td>
</tr>
<% else %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare) %></span><span> <%= link_to h(news.title), news_path(news) %></span>
<span style="float: right" class='delete_icon'> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span>
</td>
</tr>
<% end %>
<tr>
<td colspan="2" width="580px">
<span class="font_description"><%= textilizable(news, :description) %></span></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>
&nbsp;<%= format_time(news.created_on) %></span></td>
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother), news_path(news) %><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
<% end %>
</div>
<!--end-->
<div style="padding-right: 10px">
<div class="pagination">
<ul>
<%= pagination_links_full @news_pages %>
</ul>
</div>
<div class="pagination">
<ul>
<%= pagination_links_full @news_pages %>
</ul>
</div>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
<% end %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
<% html_title(l(:label_news_plural)) -%>
<% html_title(l(:label_news_plural)) -%>
</div>
<script type='text/javascript'>
$(document).ready(function($) {
$('.content-text-list').each(function(){
$(this).find('.delete_icon').hide();
$(this).mouseenter(function(event) {
$(this).find('.delete_icon').show();
});
$(this).mouseleave(function(event) {
$(this).find('.delete_icon').hide();
});
});
});
$(document).ready(function ($) {
$('.content-text-list').each(function () {
$(this).find('.delete_icon').hide();
$(this).mouseenter(function (event) {
$(this).find('.delete_icon').show();
});
$(this).mouseleave(function (event) {
$(this).find('.delete_icon').hide();
});
});
});
</script>

View File

@ -45,7 +45,7 @@
<%= content_tag('span', l(:label_x_data,:count => files_count)) %>
</p>
<p class="stats">
<%= content_tag('span', link_to("#{@project.members.count}", member_project_path(@project)), :class => "info") %>
<%= content_tag('span', "#{@project.members.count}", :class => "info") %>
<%= content_tag('span', l(:label_x_member, :count => @project.members.count)) %>
</p>

View File

@ -36,7 +36,7 @@
<p>git add .</p>
<p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:matser</p>
<p>git push -u origin master:master</p>
</div>
</h3>
<h3>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</h3>
@ -45,7 +45,7 @@
<p>git add .</p>
<p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u trustie master:matser</p>
<p>git push -u trustie master:master</p>
<p><%= link_to "李海提供", user_path(646)%></p>
</div>
</h3>

View File

@ -1,139 +1,139 @@
<%=render :partial => 'layouts/base_softapplication_top_content'%>
<style>
.softapplication-img .soft-application {
float: left;
width: 25%;
height: 200px;
}
</style>
<%= render :partial => 'layouts/base_softapplication_top_content' %>
<p id="notice"><%= notice %></p>
<!-- <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> -->
<div style="height: auto; padding-bottom: 10px">
<tr>
<td colspan="2" valign="top" width="320" >
</td>
<td>
<table width="100%" border="0">
<tr style="font-size: 18px">
<td colspan="2" valign="top"><strong><%= @softapplication.name %></strong></td>
<td style="font-size: 15px; padding-left: 0px">
<%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: { confirm: '您确定要删除吗?' } if @softapplication.destroyable_by? User.current %>&nbsp;
<%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %>
</td>
</tr>
<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_attendingcontest_contest_path(contest)) : '尚未加入竞赛'%></td>
</tr>
<tr>
<td style="padding-left: 40px">发布人员:<%= @softapplication.user.name %></td>
<td>系统支持:<%= @softapplication.android_min_version_available %></td>
</tr>
<tr>
<td style="padding-left: 40px">
<span>作品下载:</span>
<tr>
<td colspan="2" valign="top" width="320">
</td>
<td>
<table width="100%" border="0">
<tr style="font-size: 18px">
<td colspan="2" valign="top"><strong><%= @softapplication.name %></strong></td>
<td style="font-size: 15px; padding-left: 0px">
<%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>&nbsp;
<%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %>
</td>
</tr>
<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_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %></td>
</tr>
<tr>
<td style="padding-left: 40px">发布人员:<%= @softapplication.user.name %></td>
<td>系统支持:<%= @softapplication.android_min_version_available %></td>
</tr>
<tr>
<td style="padding-left: 40px">
<span>作品下载:</span>
<span>
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current) } %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %>
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %>
</span>
</td>
</td>
<td>开发人员:<%= @softapplication.application_developers %></td>
</tr>
<tr>
<td style="padding-left: 40px">平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
<td>发布时间:<%=format_time @softapplication.created_at %></td>
</tr>
</table>
</td>
</tr>
<td>开发人员:<%= @softapplication.application_developers %></td>
</tr>
<tr>
<td style="padding-left: 40px">平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
<td>发布时间:<%= format_time @softapplication.created_at %></td>
</tr>
<tr>
<td style="padding-left: 40px">
<% unless @softapplication.deposit_project_url.nil? %>
<%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
</div>
<div class="underline-contests_one"></div>
<div style="height: auto; padding-bottom: 10px">
<strong><div style="font-size: 15px;">作品简介:</div></strong>
<div style="padding-top: 5px"><%= @softapplication.description %></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: auto; padding-bottom: 10px">
<div style="font-size: 15px;"><strong>作品得分:</strong></div>
<!-- <div>打分总人数:<%= @softapplication.raters(:quality).count%></div> -->
<div style="overflow: hidden">
<div style="margin-left: 15%; 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 style="float: left; padding-left: 100px; padding-top:35px ">
<div>打分总人数</div>
<div style="padding-left: 28px; padding-top: 1px; font-size: 25px; color: blue"><strong><%= @softapplication.raters(:quality).count%></strong></div>
</div>
</div>
<div style="font-size: 15px;"><strong>作品得分:</strong></div>
<!-- <div>打分总人数:<%= @softapplication.raters(:quality).count %></div> -->
<div style="overflow: hidden">
<div style="margin-left: 15%; 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(/images/seems_rateable/stars.png) 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 " align="center">
<div>最终得分</div>
<div style="padding-top: 1px; font-size: 15px; color: blue"><%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>
</div>
<div><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
</div>
<div style="float: left; padding-left: 100px; padding-top:35px;" align="center">
<div>打分总人数</div>
<div style="padding-top: 1px; font-size: 25px; color: blue;">
<strong><%= @softapplication.raters(:quality).count %></strong></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" style="padding-top: 5px">
<% @image_results.take(4).each do |attachment| %>
<%= link_to_attachment_img attachment, :class => "soft-application", :download => "true" %>
<% end %>
</div>
<div style='clear :left;'></div>
<strong>
<div style="font-size: 15px">作品截图:</div>
</strong>
<div class="softapplication-img" >
<ul>
<% @image_results.take(4).each do |attachment| %>
<li>
<div class="title"><a href="#"><%= attachment.filename.to_s -%></a></div>
<%= link_to_attachment_img attachment, :class => "soft-application", :download => "true"%>
</li>
<% end %>
</ul>
</div>
<div style='clear :left;'></div>
</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' %><span style="font-size: 11px">(您可以重新打分,打分结果以最后一次打分为主!)</span></div>
<div style="font-size: 15px"><strong>作品评论:</strong></div>
<div style="padding-left: 210px">评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %>
<span style="font-size: 11px">(您可以重新打分,打分结果以最后一次打分为主!)</span></div>
</div>
<!--提示登录后对应用进行评价-->
<div id="history">
<%= render :partial => 'message_history', :locals => { :contest => @softapplication, :journals => @jour, :state => false} %>
<%= render :partial => 'message_history', :locals => {:contest => @softapplication, :journals => @jour, :state => false} %>
</div>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>
<div>
<%#= link_to '返回竞赛页面', show_softapplication_contest_path(@softapplication.contest) %>
</div>

View File

@ -44,7 +44,7 @@
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
<%= form_for "tag_for_save",:remote=>true,:header=>"Accept: application/javascript",:url=>tag_path,
:update => "tags_show",
:complete => "$(\"#put-tag-form-#{obj.class}-#{obj.id}\").hide();" do |f| %>
<%= f.text_field :name ,:id => "name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:style=>"width: 100px;"%>

View File

@ -0,0 +1,165 @@
<script>
window.onload=function (){
$('#upload_form').submit(function() {
$(this).ajaxSubmit( {
target : '#tags_show'
});
return false;
});
}
</script>
<div id="tags">
<%#begin
1 代表是user类型
2 代表是project类型
3 代表是issue类型
4 代表是bid类型
5 代表是forum类型
6 代表是Attachment类型
7 代表是contest类型
8 代表是OpenSourceProject类型
9 代表是RelativeMemo类型
#end%>
<!-- 3 代表的是issue 当是issue是 处理方式与前2个对象不同 -->
<% if object_flag == '3' %>
<span><%= image_tag("/images/sidebar/tags.png") %></span>
<span class="font_title_tag"><%= l(:label_tag) %>:</span>
<% if User.current.logged? %>
<span> <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %></span>
<% end %>
<div id="tags_show_issue">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<div id="put-tag-form-issue" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form-issue").hide();' do |f| %>
<%= f.text_field :name ,:id => "name-issue",:size=>"30",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>1 %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit l(:button_project_tags_add),:class => "small"%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form-issue").hide();'%>
<% end %>
</div>
<% elsif object_flag == '6' %>
<span><%#= image_tag("/images/sidebar/tags.png") %></span>
<span>
<%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', :class => "tags_icona", :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %>
<%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>
</span>
&nbsp;&nbsp;
<div id="tags_show">
<div id="tags_show-<%=obj.class%>-<%=obj.id%>" style="display:inline; ">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none">
<%= text_field "tag_name" ,"name"%>
<input id="object_id" type="text" size="20" name="object_id" value='<%=obj.id%>' class="hidden">
<input id="object_flag" type="text" size="20" name="object_flag" value='<%=object_flag%>' class="hidden">
<%= button_tag "增加", :type=>"button", :onclick=>"tagAddClick(tags_show-"+obj.class.to_s + "-" +obj.id.to_s + ","+ obj.id.to_s + "," + object_flag.to_s + ")" %>
<%#= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%#= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<input type="image" name="button" onclick="submitForm('<%=obj.id%>,<%=object_flag%>')" src="/commit.png"/>
<%= submit_tag "增加", :name=>"add_tag" %>
<div class='hidden'>
<% preTags = @preTags.nil? ? [] : @preTags %>
<% preTags.each do |tag|%>
<%= link_to tag, "
javascript:(function(){
var $tagInputVal = $('#put-tag-form-"+obj.class.to_s+"-"+obj.id.to_s+"').find('#name');
var tagArr = [];
tagArr = tagArr.concat( $tagInputVal[0].value.split(',') );
tagArr = tagArr.concat('"+tag.to_s+"');
tagArr = cleanArray(tagArr);
$tagInputVal.val(tagArr.join(','));
})();
"
%>
<% end%>
</div>
<%#= link_to_function l(:button_cancel), "$(\"#put-tag-form-#{obj.class}-#{obj.id}\").hide();"%>
</div>
</div>
<% else %>
<span><%= image_tag("/images/sidebar/tags.png") %></span>
<span class="font_title_tag"><%= l(:label_tag) %>:</span>
<% if User.current.logged? %>
<span><%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'name'} %></span>
<% end %>
<div id="tags_show">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<div id="put-tag-form" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").hide();' do |f| %>
<%= f.text_field :name ,:id => "name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit l(:button_project_tags_add),:class => "small" %>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").hide();'%>
<% end %>
</div>
<% end %>
</div>
<script language="JavaScript">
function submitForm(objId,objTag){
alert("OK");
$.ajax({
type :"POST",
url :'<%= users_tag_saveEx_path%>',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag:encodeURIComponent(objTag)
},
success: function(data, textStatus){
alert("OK");
$(id).empty();
$(id).html('123');
$("#" + id + " #name").val("");
}
})
}
function eval_ajax (xhr, textStatus) {
if (textStatus == 'success') {
eval(xhr.responseText);
} else if (textStatus == 'error') {
alert('error');
}
}
</script>
<script type='text/javascript'>
function tagAddClick(id,objId,objTag)
{
alert("OK");
$.ajax({
type :"POST",
url :'<%= users_tag_saveEx_path%>',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag:encodeURIComponent(objTag)
},
success: function(data, textStatus){
alert("OK");
$(id).empty();
$(id).html('123');
$("#" + id + " #name").val("");
}
})
}
</script>

View File

@ -1,56 +1,59 @@
<div class="content_frame">
<ul class="user_project_sort">
<% for membership in memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<span><%= link_to_project(membership.project) %></span>
<!--added by huang for: filter by roles-->
<span style="float: right">
<%=render :partial => 'courses/set_course_time', :locals => {:project => membership.project} %>
<% if User.current == @user %>
<% (membership.roles).each do |role| %>
<% unless (role == Role.find(9) || role == Role.find(3)) %>
<%= join_in_course(membership.project, User.current)%>&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<% end %>
<% else %>
<% end %>
<!--end-->
<%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)&nbsp;&nbsp;
<%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp;
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
</td>
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= membership.project.description %>
</p></td>
</tr>
<tr><td>
<!-- added by bai -->
<% @course = Course.find_by_extra(membership.project.identifier)%>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %></span>
<span style="float: right; padding-left: 8px" ><%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %></span>
<!-- <span class="font_lighter" style="float: right"><%= l(:label_create_time) %> <%= format_time(membership.created_on) %></span> -->
<% end %>
</td></tr>
</table></td>
</tr>
</table>
</li>
<% end %>
</ul>
</div>
<%= call_hook :view_account_left_bottom, :user => @user %>
<ul class="user_project_sort">
<% for membership in memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<span><%= link_to_project(membership.project) %></span>
<span style="float: right">
<%= render :partial => 'courses/set_course_time', :locals => {:project => membership.project} %>
<% if User.current == @user %>
<% (membership.roles).each do |role| %>
<% unless (role == Role.find(9) || role == Role.find(3)) %>
<%= join_in_course(membership.project, User.current) %>&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<% end %>
<% else %>
<% end %>
<%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>
(<%= "#{membership.project.members.count}" %>)&nbsp;&nbsp;
<%= l(:label_homework) %>
(<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp;
<%= l(:label_course_news) %>
(<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
</span></td>
</tr>
<tr>
<td colspan="2" width="580">
<p class="font_description">
<%= membership.project.description %>
</p></td>
</tr>
<tr>
<td>
<% @course = Course.find_by_extra(membership.project.identifier) %>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %>
: <%= link_to(@course.teacher.name, user_path(@course.teacher)) %></span>
<span style="float: right; padding-left: 8px"><%= l(:label_course_term) %>
: <%= @course.time %><%= @course.term %></span>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
<% end %>
</ul>
</div>
<%= call_hook :view_account_left_bottom, :user => @user %>

View File

@ -12,12 +12,17 @@
<% end %>
<% else %>
<p>
<span><%=l(:label_course_doing)%>(<%=@memberships_doing.count%>)</span>
<span><%=l(:label_course_doing)%>(<%=@memberships_doing.count%>)</span>
<%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1, :project_type => 1}, :class => 'icon icon-add' if @user == User.current %>
</p>
<div>
<%= render :partial => 'course_form', :locals => {:memberships => @memberships_doing}%>
</div>
<p>
<%= l(:label_created_course) %>
<div> <%= render :partial => 'course_form', :locals => {:memberships => @OwningCouses}%>
</div> </p>
<div style="clear:both;"></div>
<p> <%= l(:label_joined_course) %>
<div> <%= render :partial => 'course_form', :locals => {:memberships => @JoinCouses}%>
</div> </p>
<div style="clear:both;"></div>

View File

@ -0,0 +1,20 @@
<% if @obj_flag == '3'%>
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$("#put-tag-form-<%=@obj.class%>-<%=@obj.id%>").hide();
$("#put-tag-form-<%=@obj.class%>-<%=@obj.id%> #name").val("");
<% else %>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#put-tag-form #name').val("");
//$('#put-tag-form').hide();
<% end %>

View File

@ -120,21 +120,7 @@
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_contest_description) %></span>
</div>
<!--网站状态-->
<!-- <div class="contest_count">
<tr>
<td>竞赛总量:</td>
<td></td>
</tr><br>
<tr>
<td>竞赛总人数:</td>
<td></td>
</tr><br />
<tr>
<td>竞赛项目或应用总数:</td>
<td></td>
</tr>
</div> -->
<!--搜索框-->
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
@ -160,7 +146,7 @@
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4"; style="float: left; margin-top: 7px">
<div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/contest1.png')%>
</div>
@ -170,7 +156,7 @@
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("含#{contest.projects.where('is_public=1').count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<% else %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("含#{contest.contesting_softapplications.count}个app", show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("含#{contest.contesting_softapplications.count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<% end %>
</div>
@ -192,7 +178,7 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="padding-bottom:px ;margin-left: 5px; color: #e8770d;">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong>问题和反馈动态</strong>
<%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
@ -207,11 +193,11 @@
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
</span>
<br>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size: 9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由&nbsp;<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);" %>&nbsp;发表
</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size: 9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)</span>
</div>
</li>
<% end %>
@ -228,7 +214,7 @@
<% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %>
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4"; style="float: left; margin-top: 7px">
<div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/app1.png')%>
</div>
@ -237,7 +223,7 @@
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; margin-bottom:1px; width: 380px;">
<span class='font_lighter' title =<%=softapplication.description.to_s%>><%=softapplication.description.truncate(50, omission: '...')%></span>
<span class='font_lighter' title =<%=softapplication.description.to_s%>><%=softapplication.description.to_s.truncate(50, omission: '...')%></span>
</div><br />
<div style="padding-left: 55px; clear: left;">

View File

@ -1122,6 +1122,8 @@ en:
label_activities_settings: Display settings
#end
label_joined_course: Joined Courses
label_created_course: Created Courses
#huang
label_file_new: Download
@ -1611,4 +1613,4 @@ en:
# ajax异步验证
modal_valid_passing: can be used.
modal_valid_passing: can be used.

View File

@ -1675,7 +1675,9 @@ zh:
label_no_current_participate: 该竞赛暂无参与者
#end
label_joined_course: 参加的课程
label_created_course: 创建的课程
label_course: 课程
label_course_new: 新建课程
label_course_join_student: 加入课程
@ -1862,15 +1864,20 @@ zh:
label_release_softapplication: 发布应用
label_upload_softapplication_packets: 上传应用软件包
label_upload_softapplication_photo: 上传产品截图
label_upload_softapplication_packets_mustpacketed: 应用软件作品必须打包后以压缩包的形式上传,便于上传和下载
label_upload_softapplication_photo_condition: 应用软件截图需上传4张格式为gif/jpg/png 尺寸480*800, 每张小于2M
label_updated_caution: 注意:若修改应用,则之前上传的软件包和截图都将被删除,请重新上传!
label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载
label_upload_softapplication_photo_condition: 作品截图需上传0~4张格式为gif/jpg/png 每张小于5M
label_updated_caution: 注意:若参赛作品,则之前上传的软件包和截图都将被删除,请重新上传!
label_softapplication_name: 应用名称
label_work_name: 作品名称
label_softapplication_description: 应用简介
label_work_description: 作品简介
label_softapplication_type: 应用分类
label_work_type: 作品分类
label_softapplication_version_available: 适配版本
label_running_platform: 运行平台
label_softapplication_developer: 上传人员
label_softapplication_developers: 开发人员
label_work_deposit_project_url: 托管项目网址
label_softapplication_name_condition: 25个汉字以内50个字符
label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。
label_contest_description_no: 暂无描述。
@ -1900,6 +1907,7 @@ zh:
label_relation_files: 关联已有资源
label_contest_settings: 配置竞赛
label_contest_delete: 删除竞赛
label_noawards_current: 暂未评奖
# ajax异步验证
modal_valid_passing: 可以使用

View File

@ -77,16 +77,18 @@ RedmineApp::Application.routes.draw do
end
member do
match 'add_softapplication'
match 'update_contest' , via: [:put]
match 'show_contest' , via: :get
match 'show_project' , via: :get
match 'show_softapplication' , via: :get
match 'show_attendingcontest' , via: :get
match 'show_participator' , via: :get
match 'add' , via: [:get, :post]
match 'add_softapplication' , via: [:get, :post]
match 'create' , via: :post
match 'settings' , via: [:get, :post]
match 'update_contest' , via: [:put]
match 'show_contest' , via: :get
match 'show_project' , via: :get
match 'show_softapplication' , via: :get
match 'show_attendingcontest' , via: :get
match 'show_participator' , via: :get
match 'set_reward_project' , via: [:get, :post]
match 'set_reward_softapplication' , via: [:get, :post]
match 'add' , via: [:get, :post]
match 'add_softapplication' , via: [:get, :post]
match 'create' , via: :post
match 'settings' , via: [:get, :post]
end
end
@ -233,6 +235,7 @@ RedmineApp::Application.routes.draw do
match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
################# added by william
match 'users/tag_save', :to => 'users#tag_save', :via => :post, :as => 'tag'
match 'users/tag_saveEx', :to => 'users#tag_saveEx', :via => :post
post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
delete 'watchers/watch', :to => 'watchers#unwatch'

View File

@ -0,0 +1,5 @@
class AddDepositProjectUrlToSoftapplications < ActiveRecord::Migration
def change
add_column :softapplications, :deposit_project_url, :string
end
end

View File

@ -0,0 +1,7 @@
class AddAuthorToRelativeMemo < ActiveRecord::Migration
def change
add_column :relative_memos, :username, :string
add_column :relative_memos, :userhomeurl, :string
add_column :relative_memos, :date_collected, :date
end
end

View File

@ -178,6 +178,11 @@ Redmine::AccessControl.map do |map|
map.permission :manage_related_issues, {:repositories => [:add_related_issue, :remove_related_issue]}
end
#作业模块权限
map.project_module :bids do |map|
map.permission :view_homework_attaches, {:bids => [:show, :show_project, :revision]}, :read => true
end
map.project_module :boards do |map|
map.permission :manage_boards, {:boards => [:new, :create, :edit, :update, :destroy]}, :require => :member
map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true, :read => true

View File

@ -609,6 +609,14 @@ function toggleAndSettingWordsVal(parent_widget, text_widget, value){
text_widget.val(value)
parent_widget.slideToggle(400)
}
function transpotUrl (scope) {
$(scope).each(function(){
var tmpContent = $(this).html();
tmpContent = tmpContent.replace(/(^|[^\"\'])(http|ftp|mms|rstp|news|https)(\:\/\/[^<\s\+,]+)/gi,"$1<a href='$2$3' target='_blank'>$2$3<\/a>");
// tmpContent = tmpContent.replace(/(^|[^\/])(www\.[^<\s\+,]+)/gi,"$1<a href='http:\/\/$2' style='color:blue' target='_blank'>$2</a>");
$(this).html(tmpContent);
});
}
$(document).ready(setupAjaxIndicator);
$(document).ready(hideOnLoad);

View File

@ -218,7 +218,6 @@ body {
border-style: solid;
border-width: 1px;
color: #222222;
font-family: "Helvetica Neue";
font-size: 1.2em;
outline: medium none;
padding: 8px;
@ -1140,3 +1139,54 @@ div.pagination {
.all_browse_div table td{
vertical-align: middle;
}
/* softapplication show
*******************************************************************************/
.softapplication-img {
margin: 0;
padding: 0;
}
.softapplication-img {
margin: 5px auto;
width: 860px;
max-height: 640px;
overflow: hidden;
box-shadow: 5px 5px 20px 5px #ccc;
border-radius: 5px;
}
.soft-application {
width: 326px;
height: 580px;
}
.softapplication-img .title{
width: 326px;
position: absolute;
left: 0;
bottom: 0;
}
.softapplication-img .title a{
display: block;
text-decoration: none;
color: #fff;
font-size: 20px;
padding: 20px;
background: rgba(0,0,0,0.5);
}
.softapplication-img li{
list-style-type: none;
position: relative;
float: left;
width: 205px;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
box-shadow: -1px 0 3px 1px rgba(0,0,0,0.3);
}
.softapplication-img ul:hover li{
width: 160px;
}
.softapplication-img ul li:hover{
width: 326px;
}