Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
sw 2014-10-08 14:56:56 +08:00
commit ecfcbf1078
6 changed files with 13 additions and 8 deletions

View File

@ -195,6 +195,8 @@ class AttachmentsController < ApplicationController
end
elsif !@attachment.container.nil? && @attachment.container.is_a?(Softapplication)
format.html { redirect_to_referer_or softapplications_path(@attachment.container) }
elsif !@attachment.container.nil? && @attachment.container.is_a?(Bid)
format.html { redirect_to_referer_or respond_path(@attachment.container) }
else
if @project.nil?
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }

View File

@ -137,7 +137,7 @@ module WelcomeHelper
#获取课程列表
# add by nwb
def find_miracle_course(sum=10, max_rate=7, school_id)
if User.current.user_extensions.school.nil? and school_id.nil?
if User.current.user_extensions.nil? && User.current.user_extensions.school.nil? and school_id.nil?
Course.active.visible.
joins(:memberships).
group('members.course_id').

View File

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

View File

@ -3,14 +3,17 @@
<% 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;") +
if attachment.id.nil?
else
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
<%= if attachment.id.nil?
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
%>
<%#= 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 %>

View File

@ -16,7 +16,7 @@
<div class="bid_description">
<%= textilizable(@bid, :description) %>
<% if @bid.attachments.any?%>
<% options = {:author => true} %>
<% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false)} %>
<%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %>
<% end %>
</div>

View File

@ -34,7 +34,7 @@
<div id="account">
<%= render_menu :account_menu -%>
</div>
<% if User.current.logged? -%>
<% if User.current.logged? -%>
<div id="loggedas">
<ul style="padding:0 0; margin:0 0;display:inline;">
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;" class="loggedas_li">