competition
z9hang 11 years ago
commit 9ae553bace

@ -79,7 +79,7 @@ class AttachmentsController < ApplicationController
else else
candown = @attachment.is_public == 1 candown = @attachment.is_public == 1
end end
if candown || User.current.admin? if candown || User.current.admin? || User.current.id == @attachment.author_id
@attachment.increment_download @attachment.increment_download
if stale?(:etag => @attachment.digest) if stale?(:etag => @attachment.digest)

@ -488,6 +488,11 @@ class BidsController < ApplicationController
if @bid.homework_type if @bid.homework_type
@homework = HomeworkAttach.new @homework = HomeworkAttach.new
if @bid.proportion
teacher_proportion = @bid.proportion * 1.0 / 100
else
teacher_proportion = 1.0
end
#@homework_list = @bid.homeworks #@homework_list = @bid.homeworks
#增加作业按评分排序, #增加作业按评分排序,
#@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC") #@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC")
@ -495,7 +500,7 @@ class BidsController < ApplicationController
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{@bid.author_id}) AS t_score, (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{@bid.author_id}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id <> #{@bid.author_id}) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id <> #{@bid.author_id}) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY
(CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{@bid.proportion * 1.0 / 100} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - @bid.proportion * 1.0 / 100} END) DESC,created_at ASC") (CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{teacher_proportion} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - teacher_proportion} END) DESC,created_at ASC")
if params[:student_id].present? if params[:student_id].present?
@temp = [] @temp = []
@homework_list.each do |pro| @homework_list.each do |pro|

@ -38,6 +38,17 @@ class FilesController < ApplicationController
@isproject = true @isproject = true
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] @containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort @containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort
all_attachments = []
@containers.each do |container|
all_attachments += container.attachments
end
@limit = 10
@feedback_count = all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@curse_attachments = all_attachments[@offset, @limit]
render :layout => !request.xhr? render :layout => !request.xhr?
elsif params[:course_id] elsif params[:course_id]
@isproject = false @isproject = false
@ -67,6 +78,18 @@ class FilesController < ApplicationController
else else
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)] @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)]
end end
all_attachments = []
@containers.each do |container|
all_attachments += container.attachments
end
@limit = 10
@feedback_count = all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@curse_attachments = all_attachments[@offset, @limit]
render :layout => 'base_courses' render :layout => 'base_courses'
end end
end end

@ -103,7 +103,11 @@ class MessagesController < ApplicationController
# Edit a message # Edit a message
def edit def edit
if @project
(render_403; return false) unless @message.editable_by?(User.current) (render_403; return false) unless @message.editable_by?(User.current)
else
(render_403; return false) unless @message.course_editable_by?(User.current)
end
@message.safe_attributes = params[:message] @message.safe_attributes = params[:message]
if request.post? && @message.save if request.post? && @message.save
attachments = Attachment.attach_files(@message, params[:attachments]) attachments = Attachment.attach_files(@message, params[:attachments])
@ -124,7 +128,11 @@ class MessagesController < ApplicationController
# Delete a messages # Delete a messages
def destroy def destroy
if @project
(render_403; return false) unless @message.destroyable_by?(User.current) (render_403; return false) unless @message.destroyable_by?(User.current)
else
(render_403; return false) unless @message.course_destroyable_by?(User.current)
end
r = @message.to_param r = @message.to_param
@message.destroy @message.destroy
# modify by nwb # modify by nwb

@ -403,21 +403,35 @@ class ProjectsController < ApplicationController
#Ended by young #Ended by young
def feedback def feedback
page = params[:page] @page = params[:page]
@page = @page.to_i
# Find the page of the requested reply # Find the page of the requested reply
@jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') @jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10 @limit = 3
if params[:r] && page.nil?
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i]) offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
page = 1 + offset / @limit page = 1 + offset / @limit
if params[:r] && @page.nil?
@page = page
end
puts @page
if @page < 0
@page = 1
end
if @page > page
@page = page
end end
@feedback_count = @jours.count @feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, page @feedback_pages = Paginator.new @feedback_count, @limit, @page
@offset ||= @feedback_pages.offset @offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit] @jour = @jours[@offset, @limit]
@state = false @state = false
@base_courses_tag = @project.project_type @base_courses_tag = @project.project_type
respond_to do |format| respond_to do |format|
format.html{render :layout => 'base_courses' if @base_courses_tag==1} format.html{render :layout => 'base_courses' if @base_courses_tag==1}
format.api format.api

@ -89,6 +89,43 @@ class WordsController < ApplicationController
end end
end end
def destroyJournal
@journalP=JournalsForMessage.find(params[:object_id])
@journalP.destroy
@page = params[:page]
@page = @page.to_i
@project = Project.find params[:project_id]
# Find the page of the requested reply
@jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 3
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
page = 1 + offset / @limit
if params[:r] && @page.nil?
@page = page
end
if @page < 0
@page = 1
end
if @page > page
@page = page
end
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, @page
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
@state = false
@base_courses_tag = @project.project_type
respond_to do |format|
format.js
end
end
def new def new
@jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id] @jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id]
if @jour if @jour

@ -29,9 +29,9 @@ class Attachment < ActiveRecord::Base
include UserScoreHelper include UserScoreHelper
validates_presence_of :filename, :author validates_presence_of :filename, :author
validates_length_of :filename, :maximum => 255 validates_length_of :filename, :maximum => 254
validates_length_of :disk_filename, :maximum => 255 validates_length_of :disk_filename, :maximum => 254
validates_length_of :description, :maximum => 255 validates_length_of :description, :maximum => 254
validate :validate_max_file_size validate :validate_max_file_size

@ -127,6 +127,14 @@ class Message < ActiveRecord::Base
board.course board.course
end end
def course_editable_by?(usr)
usr && usr.logged? && (usr.allowed_to?(:edit_messages, course) || (self.author == usr && usr.allowed_to?(:edit_own_messages, course)))
end
def course_destroyable_by?(usr)
usr && usr.logged? && (usr.allowed_to?(:delete_messages, course) || (self.author == usr && usr.allowed_to?(:delete_own_messages, course)))
end
def editable_by?(usr) def editable_by?(usr)
usr && usr.logged? && (usr.allowed_to?(:edit_messages, project) || (self.author == usr && usr.allowed_to?(:edit_own_messages, project))) usr && usr.logged? && (usr.allowed_to?(:edit_messages, project) || (self.author == usr && usr.allowed_to?(:edit_own_messages, project)))
end end

@ -0,0 +1,32 @@
<% id = "course_resources_ul_" + obj.id.to_s%>
<ul class="messages-for-user-reply" id = '<%= id %>' >
<%= 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;"%>
<%= 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" %>
<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();"%>
<% end %>
<%# journal.children.each do |reply|%>
<%#= render :partial => "journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %>
<%# end %>
</ul>

@ -1,8 +1,8 @@
<% if @events_by_day != nil && @events_by_day.size >0 %> <% if @events_by_day != nil && @events_by_day.size >0 %>
<div class="content-title-top-avtive"> <div class="content-title-top-avtive">
<!-- <h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> --> <!-- <h3><%#= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> -->
<p class="subtitle"> <p class="subtitle">
<%= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %> <%#= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
</p> </p>
<% @events_by_day.keys.sort.reverse.each do |day| %> <% @events_by_day.keys.sort.reverse.each do |day| %>
@ -29,7 +29,7 @@
<%= l(:label_new_activity) %> </span> <%= l(:label_new_activity) %> </span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url %> <%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url,:style => "word-break:break-all;" %>
</td> </td>
</tr> </tr>
<tr> <tr>

@ -25,16 +25,17 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @containers.each do |container| %> <%# @containers.each do |container| %>
<% next if container.attachments.empty? -%> <%# next if container.attachments.empty? -%>
<% if container.is_a?(Version) -%> <%# if container.is_a?(Version) -%>
<tr> <!--<tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; "> <th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %> <%#= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th> </th>
</tr> </tr>-->
<% end -%> <%# end -%>
<% container.attachments.each do |file| %> <% if @curse_attachments != nil %>
<% @curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of_course?(@course)%> <%if file.is_public == 0 && !User.current.member_of_course?(@course)%>
<%next%> <%next%>
<%end%> <%end%>
@ -75,10 +76,19 @@
</td> </td>
</tr> </tr>
<% end -%> <% end -%>
<% reset_cycle %> <% end %>
<% end -%> <%# reset_cycle %>
<%# end -%>
<!-- %= h downloadAll(@containers) % --> <!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % --> <!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody> </tbody>
</table> </table>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>

@ -25,16 +25,17 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @containers.each do |container| %> <%# @containers.each do |container| %>
<% next if container.attachments.empty? -%> <%# next if container.attachments.empty? -%>
<% if container.is_a?(Version) -%> <%# if container.is_a?(Version) -%>
<tr> <!--tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; "> <th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %> <%#= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th> </th>
</tr> </tr-->
<% end -%> <%# end -%>
<% container.attachments.each do |file| %> <% if @curse_attachments != nil %>
<% @curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of?(@project)%> <%if file.is_public == 0 && !User.current.member_of?(@project)%>
<%next%> <%next%>
<%end%> <%end%>
@ -75,10 +76,17 @@
</td> </td>
</tr> </tr>
<% end -%> <% end -%>
<% reset_cycle %> <%# reset_cycle %>
<% end -%> <% end -%>
<!-- %= h downloadAll(@containers) % --> <!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % --> <!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody> </tbody>
</table> </table>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>

@ -10,7 +10,7 @@
<span><%=l(:label_organizers)%></span> <span><%=l(:label_organizers)%></span>
<span class="footer_text_link"><%= link_to l(:label_organizers_information),"http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span> <span class="footer_text_link"><%= link_to l(:label_organizers_information),"http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span>
<span class="footer_text_link"><%= link_to l(:label_organizers_information_institute), "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span> <span class="footer_text_link"><%= link_to l(:label_organizers_information_institute), "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span>
<span id="copyright"><%=l(:label_copyright)%>@2007~2014</span> <span id="copyright"><%=l(:label_copyright)%>©2007~2014</span>
<span id="contact_us" class="footer_text_link"><%= link_to l(:label_contact_us),"http://" + Setting.host_name + "/projects/2/member", :target=>"_blank" %></span> <span id="contact_us" class="footer_text_link"><%= link_to l(:label_contact_us),"http://" + Setting.host_name + "/projects/2/member", :target=>"_blank" %></span>
<span id="record"class="footer_text_link"><%= link_to l(:label_record),"http://www.miibeian.gov.cn/", :target => "_blank" %></span> <span id="record"class="footer_text_link"><%= link_to l(:label_record),"http://www.miibeian.gov.cn/", :target => "_blank" %></span>

@ -44,6 +44,13 @@
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%> <% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=true%> <% hasCourse=true%>
<% _bool=false %>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<% _bool=true %>
<% end %>
<% end %>
<% if _bool %>
<li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id} %> <li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id} %>
<ul class="course_sub_menu"> <ul class="course_sub_menu">
<% User.current.courses.each do |course| %> <% User.current.courses.each do |course| %>
@ -53,11 +60,14 @@
<% end %> <% end %>
</ul> </ul>
</li> </li>
<% end %>
<% end -%> <% end -%>
<% end %> <% end %>
<li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
<% if User.current.projects.count>0 %>
<li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
<% if hasCourse %> <% if hasCourse %>
<ul class="project_sub_menu" style="top: 35px"> <ul class="project_sub_menu" style="top: 35px">
<% else %> <% else %>
@ -68,6 +78,7 @@
<% end %> <% end %>
</ul> </ul>
</li> </li>
<% end %>
<li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%> <li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
</li> </li>
</ul> </ul>

@ -148,7 +148,7 @@
"编辑", "编辑",
{:action => 'edit', :id => message}, {:action => 'edit', :id => message},
:title => l(:button_edit) :title => l(:button_edit)
) if message.editable_by?(User.current) %> ) if message.course_editable_by?(User.current) %>
<%= link_to( <%= link_to(
#image_tag('delete.png'), #image_tag('delete.png'),
"删除", "删除",
@ -156,7 +156,7 @@
:method => :post, :method => :post,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if message.destroyable_by?(User.current) %> ) if message.course_destroyable_by?(User.current) %>
</div></td> </div></td>
</tr> </tr>
<tr> <tr>

@ -30,13 +30,14 @@
border-bottom: 1px dashed rgb(204, 204, 204); border-bottom: 1px dashed rgb(204, 204, 204);
} }
.memo-content { .memo-content {
width: 82%;
padding: 1%; padding: 1%;
margin: 1%; margin: 1%;
margin-bottom: 40px; margin-bottom: 40px;
background-color: #F6F6F6; background-color: #F6F6F6;
white-space: normal; white-space: normal;
/*word-break: break-all; */ word-break: break-all;
word-wrap: break-word; /*word-wrap: break-word;*/
} }
.memo-timestamp { .memo-timestamp {
position: absolute; position: absolute;
@ -155,10 +156,10 @@
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if message.destroyable_by?(User.current) %> ) if message.destroyable_by?(User.current) %>
</div></td> </div>
</td>
</tr> </tr>
<tr> <tr>
<td class="comments"> <td class="comments">
<div class="wiki" style="width: 100%;word-break: break-all;"> <div class="wiki" style="width: 100%;word-break: break-all;">
<%= textAreailizable message,:content,:attachments => message.attachments %> <%= textAreailizable message,:content,:attachments => message.attachments %>

@ -5,7 +5,7 @@
</div> </div>
<div class="box tabular"> <div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p> <p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
<!-- <p style="margin-left:-10px;"><%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> --> <!-- <p style="margin-left:-10px;"><%#= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p> <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p> <p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p>
</div> </div>

@ -1,11 +1,10 @@
<%= error_messages_for @news %> <%= error_messages_for @news %>
<div class="add_frame_header" > <div class="add_frame_header" >
<% str = @project ? l(:bale_news_notice) : l(:label_news_new) %> <%= @project ? l(:label_news_new) : l(:bale_news_notice) %>
<%= str %>
</div> </div>
<div class="box tabular"> <div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p> <p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
<!-- <p style="margin-left:-10px;"><%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> --> <!-- <p style="margin-left:-10px;"><%#= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p> <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p> <p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p>
</div> </div>

@ -1,9 +1,9 @@
<!--<p><%= link_to_project(news.project) + ': ' unless @project %> <!--<p><%#= link_to_project(news.project) + ': ' unless @project %>
<table><tr><td><img src="/images/new/news.png" width="40" height="40"/></td><td><%= link_to h(news.title), news_path(news) %> <table><tr><td><img src="/images/new/news.png" width="40" height="40"/></td><td><%#= link_to h(news.title), news_path(news) %>
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %> <%#= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
<% unless news.summary.blank? %></td><td><span class="fontligher"><%=h news.summary %></span><% end %></td> <%# unless news.summary.blank? %></td><td><span class="fontligher"><%#=h news.summary %></span><%# end %></td>
<td><span class="author"><%= authoring news.created_on, news.author %></span></td></tr></table></p>--> <td><span class="author"><%#= authoring news.created_on, news.author %></span></td></tr></table></p>-->
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <tr>

@ -1,4 +1,4 @@
<!-- <h3><%=l(:label_news_new)%></h3> --> <!-- <h3><%#=l(:label_news_new)%></h3> -->
<% if @project %> <% if @project %>
<%= labelled_form_for @news, :url => project_news_index_path(@project), <%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>

@ -36,7 +36,8 @@ function checkMaxLength() {
</script> </script>
<!-- fq --> <!-- fq -->
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h3><%= l(:label_user_response) %></h3> <h3><%= l(:label_user_response) %></h3>
@ -59,6 +60,8 @@ function checkMaxLength() {
</div> </div>
<% end %> <% end %>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<div id="project_feedback">
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% if @jour.size >0 %> <% if @jour.size >0 %>
<ul class="message-for-user"> <ul class="message-for-user">
<% for journal in @jour%> <% for journal in @jour%>
@ -78,6 +81,13 @@ function checkMaxLength() {
'#{l(:label_reply_plural)} #{journal.user.name}: '); '#{l(:label_reply_plural)} #{journal.user.name}: ');
return false;"} %> return false;"} %>
<% end %> <% end %>
<% if User.current.logged? %>
<% if journal.user_id==User.current.id|| User.current.admin? %>
<%= link_to(l(:button_delete),{:controller => 'words', :action => 'destroyJournal', :object_id => journal.id, :project_id=>@project.id, :page=>@page},
:remote => true, :title => l(:button_delete)) %>
<% end %>
<% end %>
</span> </span>
</span> </span>
<div style="clear: both;"></div> <div style="clear: both;"></div>
@ -100,3 +110,4 @@ function checkMaxLength() {
<%= pagination_links_full @feedback_pages %> <%= pagination_links_full @feedback_pages %>
</ul> </ul>
</div> </div>
</div>

@ -9,9 +9,30 @@
<div style="float: left; width: 600px; padding-top: 6px; margin-left: 8px"><%= softapplication.description.truncate(95, omission: '...') %></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; line-height: 0.5em "> <div style="float: left; width: 200px; margin-left: 70px; margin-top: -3px; line-height: 0.5em ">
<%contest = softapplication.contests.first%> <%contest = softapplication.contests.first%>
<!--<table width="100%" border="0">-->
<!--<tr>-->
<!--<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_contest)%></td>-->
<!--<td style="width: 100px; word-wrap: break-word; word-break: break-all">-->
<!--<%= contest ? link_to(contest.name.truncate(14, omission: '...'), show_attendingcontest_contest_path(contest), title: contest.name.to_s ) : '尚未加入竞赛'%>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_type)%></td>-->
<!--<td style="width: 100px; word-wrap: break-word; word-break: break-all">-->
<!--<%= softapplication.app_type_name %>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_adaptive_system)%></td>-->
<!--<td style="width: 100px; word-wrap: break-word; word-break: break-all">-->
<!--<%= softapplication.android_min_version_available %>-->
<!--</td>-->
<!--</tr>-->
<!--</table>-->
<p><%=l(:label_attendingcontestwork_belongs_contest)%><%= contest ? link_to(contest.name.truncate(14, omission: '...'), show_attendingcontest_contest_path(contest), title: contest.name.to_s ) : '尚未加入竞赛'%></p> <p><%=l(:label_attendingcontestwork_belongs_contest)%><%= contest ? link_to(contest.name.truncate(14, omission: '...'), show_attendingcontest_contest_path(contest), title: contest.name.to_s ) : '尚未加入竞赛'%></p>
<p><%=l(:label_attendingcontestwork_belongs_type)%><%= softapplication.app_type_name.truncate(10, omission: '...') %></p> <p><%=l(:label_attendingcontestwork_belongs_type)%><%= softapplication.app_type_name.truncate(14, omission: '...') %></p>
<p><%=l(:label_attendingcontestwork_adaptive_system)%><%= softapplication.android_min_version_available %></p> <%strTitle = softapplication.android_min_version_available%>
<p><%=l(:label_attendingcontestwork_adaptive_system)%><lable title="<%= strTitle %>"><%= strTitle.truncate(10,omisiion:'...') %></lable></p>
</div> </div>
<div style="padding-left: 53px"> <div style="padding-left: 53px">
<span><%=l(:label_attendingcontestwork_developers)%><%= softapplication.application_developers %></span> <span><%=l(:label_attendingcontestwork_developers)%><%= softapplication.application_developers %></span>

@ -3,40 +3,45 @@
<div style="height: auto; padding-bottom: 10px"> <div style="height: auto; padding-bottom: 10px">
<tr>
<td colspan="2" valign="top" width="320">
</td>
<td>
<table width="100%" border="0"> <table width="100%" border="0">
<tr style="font-size: 18px"> <tr style="font-size: 18px">
<td colspan="2" valign="top"><strong><%= @softapplication.name %></strong></td> <td valign="top"><strong><%= @softapplication.name %></strong></td>
<td style="font-size: 15px; padding-left: 0px"> <td style="font-size: 15px; padding-right: 0px" align="right">
<%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>&nbsp; <%= 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 %> <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %>
</td> </td>
</tr> </tr>
</table>
</div>
<div style="height: auto; padding-bottom: 10px">
<table width="100%" border="0">
<tr> <tr>
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_type)%><%= @softapplication.app_type_name %></td> <td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_type)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.app_type_name %></td>
<% contest = @softapplication.contests.first %> <% contest = @softapplication.contests.first %>
<td style="width: 240px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_contest)%><%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %></td> <td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_contest)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"><%=l(:label_attendingcontestwork_release_person)%><%= @softapplication.user.name %></td> <td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_release_person)%></td>
<td><%=l(:label_attendingcontestwork_adaptive_system)%><%= @softapplication.android_min_version_available %></td> <td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.user.name %></td>
<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_adaptive_system)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.android_min_version_available %></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"> <td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_download)%></td>
<span><%=l(:label_attendingcontestwork_download)%></span> <td style="width: 400px; word-wrap: break-word; word-break: break-all">
<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 style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_developers)%></td>
<td><%=l(:label_attendingcontestwork_developers)%><%= @softapplication.application_developers %></td> <td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.application_developers %></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"><%=l(:label_attendingcontestwork_average_scores)%>: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td> <td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_average_scores)%></td>
<td><%=l(:label_attendingcontestwork_release_time)%><%=format_time @softapplication.created_at %></td> <td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_release_time)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%=format_time @softapplication.created_at %></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"> <td style="padding-left: 40px">
@ -46,8 +51,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</td>
</tr>
</div> </div>
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>
@ -56,7 +59,7 @@
<div style="font-size: 15px;"><%=l(:label_work_description)%></div> <div style="font-size: 15px;"><%=l(:label_work_description)%></div>
</strong> </strong>
<div style="padding-top: 5px"><%= @softapplication.description %></div> <div style="padding-top: 5px; padding-left:10px"><%= @softapplication.description %></div>
</div> </div>
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>

@ -43,32 +43,8 @@
<div id="tags_show-<%=obj.class%>-<%=obj.id%>" style="display:inline; "> <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} %> <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div> </div>
<div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none"> <div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none;height: 100px;">
<%= form_for "tag_for_save",:remote=>true,:header=>"Accept: application/javascript",:url=>tag_path, <%= render :partial => "courses/course_resources_html", :locals => {:obj => obj ,:object_flag => object_flag } %>
: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;"%>
<%= 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" %>
<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();"%>
<% end %>
</div> </div>
<% else %> <% else %>

@ -32,8 +32,9 @@
<tr> <tr>
<td colspan="2" width="580" style="word-break:break-all"> <td colspan="2" width="580" style="word-break:break-all">
<p class="font_description"> <p class="font_description">
<%= membership.course.short_description %> <%= textilizable membership.course.short_description %>
</p></td> </p>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save