Merge branch 'szzh' into develop

This commit is contained in:
sw 2014-08-22 14:53:54 +08:00
commit 19027e901b
41 changed files with 235 additions and 122 deletions

View File

@ -241,7 +241,7 @@ class AdminController < ApplicationController
end
else
respond_to do |format|
flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}"
flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}\n\t#{@notification.errors.full_messages[0]}"
format.html {
render :action => 'contest_page_made'
}

View File

@ -26,6 +26,18 @@ class FilesController < ApplicationController
include SortHelper
helper :project_score
def show_attachments obj
all_attachments = []
obj.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]
end
def index
#sort_init 'filename', 'asc'
sort_init 'created_on', 'desc'
@ -39,15 +51,7 @@ class FilesController < ApplicationController
@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
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]
show_attachments @containers
render :layout => !request.xhr?
elsif params[:course_id]
@ -79,16 +83,7 @@ class FilesController < ApplicationController
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)]
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]
show_attachments @containers
render :layout => 'base_courses'
end
@ -133,6 +128,8 @@ class FilesController < ApplicationController
@containers = [Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] #modify by Long Jun
@containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort
show_attachments @containers
@attachtype = 0
@contenttype = 0
@ -159,6 +156,8 @@ class FilesController < ApplicationController
@containers = [Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
show_attachments @containers
@attachtype = 0
@contenttype = 0

View File

@ -83,6 +83,10 @@ class IssuesController < ApplicationController
:limit => @limit)
@issue_count_by_group = @query.issue_count_by_group
respond_to do |format|
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
format.api {

View File

@ -34,6 +34,7 @@ class MessagesController < ApplicationController
# Show a topic and its replies
def show
@isReply = true
page = params[:page]
# Find the page of the requested reply
if params[:r] && page.nil?
@ -103,6 +104,7 @@ class MessagesController < ApplicationController
# Edit a message
def edit
@isReply = false
if @project
(render_403; return false) unless @message.editable_by?(User.current)
else
@ -123,7 +125,6 @@ class MessagesController < ApplicationController
}
end
end
end
# Delete a messages

View File

@ -37,16 +37,41 @@ class MyController < ApplicationController
}.freeze
def index
page
render :action => 'page'
end
end
# Show user's page
def page
@user = User.current
@Issues= Issue.visible.open.
where(:assigned_to_id => ([User.current.id] + User.current.group_ids))
@limit = 10
@feedback_count = @Issues.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@curse_attachments = @Issues[@offset, @limit]
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
end
def page2
@limit = 10
@user = User.current
@Issues= Issue.visible.open.
where(:assigned_to_id => ([User.current.id] + User.current.group_ids))
@feedback_count = @Issues.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@curse_attachments = @Issues[@offset, @limit]
@state = false
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
respond_to do |format|
format.js
end
end
# Edit user's account
def account
@user = User.current

View File

@ -407,7 +407,7 @@ class ProjectsController < ApplicationController
@page = @page.to_i
# Find the page of the requested reply
@jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 3
@limit = 10
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
page = 1 + offset / @limit

View File

@ -99,7 +99,7 @@ class WordsController < ApplicationController
@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
@limit = 10
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
page = 1 + offset / @limit

View File

@ -441,7 +441,7 @@ module CoursesHelper
def homework_user_of_homework homework,is_teacher
homework_users = ""
homework.users.each do |user|
homework_users = homework_users + (is_teacher ? (user.firstname + user.lastname) : user.login)
homework_users = homework_users + (is_teacher ? (user.lastname + user.firstname) : user.login)
if user != homework.users.last
homework_users = homework_users + ""
end

View File

@ -864,7 +864,7 @@ FROM `users` where id = #{user.id}")
users = Attachment.find_by_sql("SELECT COUNT(*) as m_count FROM #{Attachment.table_name} WHERE author_id = '#{user.id}' and container_type = 'Project' and container_id = #{project.id}")
result = 0
if users.count > 0
result = users.first.m_coumt
result = users.first.m_count
end
result
end

View File

@ -1,3 +1,4 @@
class ContestNotification < ActiveRecord::Base
attr_accessible :content, :title
validates_length_of :title, maximum: 30
end

View File

@ -1,10 +1,10 @@
<span id="attachments_fields">
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>

View File

@ -0,0 +1,61 @@
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% else %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
<% end %>
</span>
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()" %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description)
} %>
<span id="upload_file_count"><%= l(:label_no_file_uploaded)%></span>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>

View File

@ -4,4 +4,5 @@ $('#relation_file').html('<%=render_attachments_for_new_project(@project, nil)%>
<% elsif @course%>
$('#relation_file').html('<%=render_attachments_for_new_course(@course, nil)%>');
<% end%>
$('#attachments').children().css("width","100%").css("word-break","break-all");

View File

@ -4,8 +4,16 @@
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp
<span class="size">
<% if @attachment!=nil&&@attachment.container_type == 'Document' %>
<%= link = link_to(l(:button_add), {:controller => 'code_review',
:action => 'assign', :action_type => 'attachment',
:id=>@attachment.project,
:change_id => '', :attachment_id => @attachment.id,
}, :class => 'icon icon-add') %>
<% end %>
</span></p>
</div>
&nbsp;
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>

View File

@ -26,9 +26,9 @@
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
<!-- <p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
<!-- <p><%#= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>
</p>

View File

@ -28,7 +28,7 @@
<tr>
<td style="vertical-align: top;width: 70px" >
<table style="text-align: center;width: 100%;table-layout: fixed">
<% user_name = is_teacher ? (homework.user.firstname + homework.user.lastname) : homework.user.login %>
<% user_name = is_teacher ? (homework.user.lastname + homework.user.firstname) : homework.user.login %>
<tr>
<td title="<%= user_name %>"><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
</tr>

View File

@ -63,7 +63,9 @@
<td>
<table width="640px" border="0">
<tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %>
</td>
<td align="right" rowspan="3"><table class="borad-count"><tr><td align="center" class="borad-count-digit"><%=link_to (topic.replies_count), board_message_path(@board, topic) %></td></tr>
<tr><td align="center">回答</td></tr>
</table></td>

View File

@ -71,7 +71,9 @@
<td>
<table width="640px" border="0">
<tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %>
</td>
<td align="right" rowspan="3">
<table class="borad-count">
<tr>

View File

@ -1,14 +1,14 @@
<div class="autoscroll">
<table class="filecontent syntaxhl">
<table class="filecontent syntaxhl" >
<tbody>
<% line_num = 1 %>
<% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %>
<tr>
<th class="line-num" id="L<%= line_num %>">
<a href="#L<%= line_num %>"><%= line_num %></a>
<th class="line-num" id="L<%= line_num %>" style="vertical-align: top;">
<a href="#L<%= line_num %>" style="padding-top: 0px;"><%= line_num %></a>
</th>
<td class="line-code">
<pre><%= line.html_safe %></pre>
<pre style="width:880px;word-wrap: break-word; word-break: normal; "><%= line.html_safe %></pre>
</td>
</tr>
<% line_num += 1 %>

View File

@ -30,7 +30,7 @@
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}") %><%= calendar_for('bid_deadline')%>
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}",:readonly => "readonly") %><%= calendar_for('bid_deadline')%>
</p>
<p><%= f.select :is_evaluation, is_evaluation_option %>
</p>

View File

@ -3,7 +3,7 @@
<% attachmenttypes = @course.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @course) %>
<table class="list files" id="ver-zebra">
<table class="list files" id="ver-zebra" style="table-layout: fixed">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
@ -40,17 +40,17 @@
<%next%>
<%end%>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName unless file.attachmentstype.nil? %></span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="field_file_dense">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type"><%= file.show_suffix_type %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
@ -58,9 +58,9 @@
:attachment => file} %>
</span>
</td>
<td class="downloads"><%= file.downloads %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>

View File

@ -3,7 +3,8 @@
<% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<table class="list files" id="ver-zebra">
<div class="autoscroll">
<table class="list files" id="ver-zebra" style=" table-layout: fixed">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
@ -40,17 +41,17 @@
<%next%>
<%end%>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="field_file_dense">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type"><%= file.show_suffix_type %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
@ -58,9 +59,9 @@
:attachment => file} %>
</span>
</td>
<td class="downloads"><%= file.downloads %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
@ -83,7 +84,7 @@
</tbody>
</table>
</div>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>

View File

@ -2,12 +2,12 @@
<!--[form:project]-->
<p><%= l(:label_homeworks_form_new_description) %></p>
<!-- % unless @memo.parent_id %>
<% if @memo.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <lable><%= l(:label_board_sticky) %></lable>
<% end %>
<% if @memo.safe_attribute? 'locked' %>
<%= f.check_box :locked %> <%= label_tag 'memo_locked', l(:label_board_locked) %>
<% end %>
<% end % -->
<%# if @memo.safe_attribute? 'sticky' %>
<%#= f.check_box :sticky %> <lable><%= l(:label_board_sticky) %></lable>
<%# end %>
<%# if @memo.safe_attribute? 'locked' %>
<%#= f.check_box :locked %> <%#= label_tag 'memo_locked', l(:label_board_locked) %>
<%# end %>
<%# end %> -->
<p><%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %></p>
<p><%= hidden_field_tag 'subject', ||=@memo.subject %>

View File

@ -75,14 +75,14 @@
l(:button_edit),
{:action => 'edit', :id => @topic},
:class => 'icon icon-edit'
) if @message.editable_by?(User.current) %>
) if @message.course_editable_by?(User.current) %>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => @topic},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'icon icon-del'
) if @message.destroyable_by?(User.current) %>
) if @message.course_destroyable_by?(User.current) %>
</div>
<div class="lz-left">
@ -96,9 +96,9 @@
<div class="memo-section">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>">
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %>
</div>
<div class="memo-content">
@ -109,14 +109,8 @@
</div>
<div class="memo-timestamp">
<div style="float: left"><%= authoring @topic.created_on, @topic.author %></div>
<div style="float: right"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></div>
</div>
</div>
<br />
</div>
@ -162,8 +156,9 @@
<tr>
<td class="comments">
<div class="wiki">
<%= textilizable message, :content, :attachments => message.attachments %>
<div class="wiki" style="width: 100%;word-break: break-all;">
<%= textAreailizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %>
</div>
<%= link_to_attachments message, :author => false %> </td>
</tr>

View File

@ -42,7 +42,7 @@
<!--[eoform:message]-->
<p><%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form', :locals => {:container => @message} %></p>
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %></p>
</div>

View File

@ -95,11 +95,11 @@
</p>
</div>
<div class="memo-section" style="width: 100%;word-break: break-all;">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 83%;word-break: break-all;">
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %>
</div>
<div class="memo-content">
@ -179,9 +179,6 @@
</div>
<% end %>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>

View File

@ -128,7 +128,7 @@
<a class="modal_close" href="#"></a>
<h2>学校列表</h2>
&nbsp;&nbsp;
<div class="pcontent">
<ul id="provincelist" class="school_list">
<% @ss = School.find_by_sql("select distinct province from schools") %>
@ -140,7 +140,7 @@
<% end %>
</ul>
</div>
<hr/>
<div class="content" style="font-size: 13px">
<ul id="schoollist" class="school_list">

View File

@ -0,0 +1,26 @@
<% assigned_issues = issuesassignedtome_items %>
<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>
<% if assigned_issues.length > 0 %>
<!--分页-->
<!--
<div class="pagination" style="float:left;">
<ul>
<%#= pagination_links_full(@feedback_pages,@feedback_count, :per_page_links => false){|text, parameters, options|
link_to text, my_page2_path(parameters.merge(:q => params[:q])) }%>
<%#= pagination_links_full @feedback_pages %>
</ul>
</div>
-->
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
:action => 'index',
:set_filter => 1,
:assigned_to_id => 'me',
:sort => 'priority:desc,updated_on:desc' %></p>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom,
{:controller => 'issues', :action => 'index', :set_filter => 1,
:assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key},
{:title => l(:label_assigned_to_me_issues)}) %>
<% end %>

View File

@ -1,18 +1,4 @@
<h3><%=l(:label_assigned_to_me_issues)%> (<%= Issue.visible.open.count(:conditions => {:assigned_to_id => ([User.current.id] + User.current.group_ids)})%>)</h3>
<% assigned_issues = issuesassignedtome_items %>
<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>
<% if assigned_issues.length > 0 %>
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
:action => 'index',
:set_filter => 1,
:assigned_to_id => 'me',
:sort => 'priority:desc,updated_on:desc' %></p>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom,
{:controller => 'issues', :action => 'index', :set_filter => 1,
:assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key},
{:title => l(:label_assigned_to_me_issues)}) %>
<% end %>
<div id="asdsadwsc">
<%= render :partial => "my/blocks/assiagn_issue" %>
</div>

1
app/views/my/page.js.erb Normal file
View File

@ -0,0 +1 @@
$("#asdsadwsc").html("<%= escape_javascript(render :partial => 'my/blocks/assiagn_issue') %>");

View File

@ -0,0 +1 @@
$("#asdsadwsc").html("<%= escape_javascript(render :partial => 'my/blocks/assiagn_issue') %>");

View File

@ -69,9 +69,9 @@
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %>
<%#= submit_tag l(:button_save) %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();' %>
<%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => ''} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:class => 'whiteButton m3p10' %>
<%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %>
<% end %>
<div id="preview" class="wiki"></div>
</div>

View File

@ -1,4 +1,4 @@
<!-- added by bai -->
<div><%= l(:label_file_number) %> * 4 = <%= document_num(@project) %> * 4 = <%= format("%.2f" , document_score(@project)).to_i %></div>
<div><%= l(:label_file_score) %> = <%= format("%.2f" , document_score(@project)).to_i %></div>
<div><%= l(:label_file_number) %> * 4 = <%= documents_num(@project) %> * 4 = <%= format("%.2f" , documents_score(@project)).to_i %></div>
<div><%= l(:label_file_score) %> = <%= format("%.2f" , documents_score(@project)).to_i %></div>
<!-- end -->

View File

@ -45,8 +45,8 @@
</tr>
<tr>
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
<% #find_project_repository @project %>
<strong><%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %></strong>
<!-- @project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count -->
<strong><%= content_tag('span', "#{changesets_num(@project)}", :class => "info") %></strong>
</td>
<td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_commit_on)) %>

View File

@ -129,7 +129,7 @@
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% else %>
<td colspan="2" valign="top">

View File

@ -2,7 +2,7 @@
<div id='leave-message'>
<%= render :partial => 'words/new', :locals => {:user => @user, :sta => @state} %>
</div>
<div style="border-bottom: 1px dashed rgb(204, 204, 204);font-size: 14px; font-family: 微软雅黑; padding-bottom: 10px; font-weight: bold; color:#807a76">
<div style="border-bottom: 1px dashed rgb(204, 204, 204);font-size: 14px; font-family: '微软雅黑'; padding-bottom: 10px; font-weight: bold; color:#807a76">
<%= l(:label_newfeedback_message) %><%= @feedback_count%>
</div>

View File

@ -197,7 +197,7 @@
<span style="margin-top: -20px;float: right; display: block;"><%#= link_to l(:label_more_information), forums_path %></span>
<div style="height: 167px; padding-top:6px;">
<fieldset style="padding-left: 36px; margin-left: 13px; height: 150px; width:380px; border-radius:10px;">
<div style="font-size:14px; color: #1166AD; padding-left:52px; "><strong><%= @contestNotification.title %></strong></div>
<div style="font-size:14px; color: #1166AD;text-align:center;word-break: break-all; "><strong style="margin:auto;"><%= @contestNotification.title %></strong></div>
<div class="underline-contests_four"></div>
<div id="up_zzjs">
<div id="marqueebox">

View File

@ -72,7 +72,7 @@
<table border="0" width="525px" align="center">
<tr>
<td align="right"> <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
<%= submit_tag l(:button_clear), :name => nil, :class => "enterprise", :onclick => "clearMessage('new_form_user_message');", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
<%= submit_tag l(:button_cancel), :name => nil, :class => "enterprise", :onclick => "clearMessage('new_form_user_message');", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
</tr>
</table>
<% else %>

View File

@ -1641,7 +1641,7 @@ zh:
label_call_bonus: 奖金
label_bids_form_new_description: 企业可以在此发布一个软件开发任务或者一个技术方案需求1获得价廉物美的解决方案2发现对此项任务有贡献的大学生获得可以招聘的人才。
label_bids_form_contest_new_description: 企业或者高校可以在此发布一个竞赛。
label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式,在作业类型里面设置
label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式
label_fork_form_new_description: 该需求将作为某课程的作业被发布,作业提交方式可以使附件或者项目形式,在作业类型里面设置。
label_bids_new_money: 输入奖励金额,如 500,2.5等
label_bids_new_credit: 输入该作业对应课程的学分,如 3,2.5等

View File

@ -275,6 +275,8 @@ RedmineApp::Application.routes.draw do
match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
get 'my/page2', :to => 'my#page2', :as => "my_page2"
resources :users
match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140812065417) do
ActiveRecord::Schema.define(:version => 20140814062455) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -441,21 +441,21 @@ ActiveRecord::Schema.define(:version => 20140812065417) do
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "sort_type"
t.integer "image_width", :default => 107
t.integer "image_height", :default => 63
t.integer "show_course", :default => 1
t.integer "show_contest", :default => 1
t.integer "image_width", :default => 107
t.integer "image_height", :default => 63
end
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.string "description", :default => ""
t.string "name", :null => false
t.text "description"
t.integer "topic_count", :default => 0
t.integer "memo_count", :default => 0
t.integer "last_memo_id", :default => 0
t.integer "creator_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "creator_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "groups_users", :id => false, :force => true do |t|