Merge branch 'develop' into szzh

This commit is contained in:
sw 2014-12-12 14:51:00 +08:00
commit 402148d088
3 changed files with 51 additions and 19 deletions

View File

@ -44,7 +44,7 @@ class ZipdownController < ApplicationController
if homework != nil
unless homework.attachments.empty?
zipfile = zip_homework_by_user homework
send_file zipfile, :filename => (homework.user.user_extensions.nil? ? "" : homework.user.user_extensions.student_id) +
send_file zipfile, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
"_" + (homework.user.lastname.nil? ? "" : homework.user.lastname) + (homework.user.firstname.nil? ? "" : homework.user.firstname) +
"_" + homework.name + ".zip", :type => detect_content_type(zipfile) if(zipfile)
else
@ -80,7 +80,7 @@ class ZipdownController < ApplicationController
homeattach.attachments.each do |attach|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
end
zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{(homework.user.user_extensions.nil? ? "" : homework.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{((homeattach.user.user_extensions.nil? || homeattach.user.user_extensions.student_id.nil?) ? "" : homeattach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
end

View File

@ -153,7 +153,11 @@
<div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-left" >
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_hot_contest)%></strong></h3>
<h3 style="margin-left: 5px; color: #e8770d;">
<strong>
<%=l(:label_current_hot_contest)%>
</strong>
</h3>
<span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %>
@ -171,15 +175,26 @@
<div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;">
<%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<% 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}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<span class="font_lighter">(
<span style="font-size: 13px">
<%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), 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}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<span class="font_lighter">(
<span style="font-size: 13px">
<%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %>
</span>)
</span>
<% end %>
</div>
<div style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;" class="text_nowrap">
<span class='font_lighter' title ='<%=contest.description%>'><%=contest.description.truncate(100, omission: '...')%></span>
</div><br />
<span class='font_lighter' title ='<%=contest.description%>'>
<%=contest.description.truncate(100, omission: '...')%>
</span>
</div>
<br />
<div style="padding-left: 57px; clear: left;">
<span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time contest.created_on %></span>
@ -193,7 +208,9 @@
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_notification)%></strong>
<strong>
<%=l(:label_notification)%>
</strong>
</h3>
<ul class="contest-notification-list">
@ -204,13 +221,19 @@
</div>
<div class="font_lighter" style="padding-top: 7px;padding-left: 55px;" title="<%= notification.title%>">
<span>
<strong><%= link_to_user(notification.author) %></strong>
<strong>
<%= link_to_user(notification.author) %>
</strong>
<%= l(:label_project_notice) %>
<%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %>
</span>
</div>
<div class="font_lighter" style="padding-left: 55px;" title="<%= notification.description%>"><%= notification.description.truncate(30, omission: '...') %></div>
<div class="font_lighter" style="padding-left: 55px;"><%=l(:label_release_time)%>:&nbsp;<%=format_time notification.created_at %></div>
<div class="font_lighter" style="padding-left: 55px;" title="<%= notification.description%>">
<%= notification.description.truncate(30, omission: '...') %></div>
<div class="font_lighter" style="padding-left: 55px;">
<%=l(:label_release_time)%>:&nbsp;
<%=format_time notification.created_at %>
</div>
</li>
<% end %>
</ul>
@ -239,10 +262,14 @@
<%=l(:label_question_sponsor)%>:&nbsp;<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
<%=l(:label_final_reply)%>:&nbsp;<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %>
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%=l(:label_final_reply)%>:&nbsp;
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
<% end %>
</span>
<span class="memo_reply">
<%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>)
<%=l(:label_reply)%>
(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</div>
@ -265,17 +292,21 @@
<div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/app1.png')%>
</div>
<div style="float: left; margin-left: 10px; margin-top: 7px;margin-bottom: -2px; width: 380px;">
<%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
</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.to_s.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;">
<span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time softapplication.created_at %></span>
<span class="font_lighter">
<%=l(:label_release_time)%>:&nbsp;
<%=format_time softapplication.created_at %>
</span>
</div>
</li>
@ -283,8 +314,9 @@
</div>
<% else %>
<p class="font_lighter"><%= l(:label_no_ftapplication) %></p>
<p class="font_lighter">
<%= l(:label_no_ftapplication) %>
</p>
<% end %>
</div>
</div>

View File

@ -153,8 +153,8 @@
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person" title="<%= topic.last_reply.author.login unless (topic.last_reply.nil? || topic.last_reply.author.nil?)%>">
<%= l(:label_final_reply)%>
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%= l(:label_final_reply)%>
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
<% end %>
</span>