diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8381170cb..b5b0bdb5f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -622,16 +622,12 @@ class ApplicationController < ActionController::Base ## Please added code in html. # def paginateHelper obj, pre_size=20 - # current_count = pre_size * (params['page'].to_i - 1) if params['page'].to_i > 0 - offset, limit = api_offset_and_limit({:limit => pre_size}) - objs_all = obj - @obj_count = objs_all.count - @obj_pages = Paginator.new @obj_count, limit, params['page'] - offset ||= @obj_pages.offset + @obj_count = obj.count + @obj_pages = Paginator.new @obj_count, pre_size, params['page'] if obj.kind_of? ActiveRecord::Base or obj.kind_of? ActiveRecord::Relation - obj.offset(offset).limit(limit).all + obj.limit(@obj_pages.per_page).offset(@obj_pages.offset).all elsif obj.kind_of? Array - obj[offset..(offset+limit-1)] + obj[@obj_pages.offset, @obj_pages.per_page] else logger.error "[ApplicationController] Error : application_controller#paginateHelper ===> unknow category: #{obj.class}" nil diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 15e612fc5..078e990ba 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -3,7 +3,7 @@ class BidsController < ApplicationController #Added by young menu_item l(:label_homework), :only => [:edit, :udpate] menu_item :respond - menu_item :project, :only => [:show_project,:show_results] + menu_item :project, :only => [:show_project,:show_results, :new_submit_homework] menu_item :homework_respond, :only => :homework_respond menu_item :homework_statistics, :only => :homework_statistics #Ended by young @@ -454,7 +454,7 @@ class BidsController < ApplicationController ###添加应标项目 def add - project = Project.where('name = ?', params[:bid]).first + project = Project.find(params[:bid]) bid_message = params[:bid_for_save][:bid_message] if BidingProject.where("project_id = ? and bid_id = ?", project.id, @bid.id).size == 0 if BidingProject.cerate_bidding(@bid.id, project.id, bid_message) @@ -713,24 +713,42 @@ class BidsController < ApplicationController render :action => 'edit' end end + + def new_submit_homework + #render html to prepare create submit homework + find_bid + render :layout => 'base_homework' + end def add_homework if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) # homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id) # homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads])) @homework = HomeworkAttach.new + @homework.safe_attributes = params[:homeworkattach] @homework.bid_id = @bid.id @homework.user_id = User.current.id @homework.save_attachments(params[:attachments]) - @homework.save + render_attachment_warning_if_needed(@homework) + if @homework.save + @homework_flag = l(:label_bidding_homework_succeed) + else + @homework_flag = l(:label_bidding_homework_failed) + end if @homework.attachments.empty? @homework.delete flash[:error] = l(:no_attachmens_allowed) + @homework_flag = l(:no_attachmens_allowed) # else end end @homework_list = @bid.homeworks - @homework = HomeworkAttach.new + respond_to do |format| + format.html{ + redirect_to project_for_bid_path, notice: @homework_flag.to_s + } + format.js + end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4dfb67c0c..ea8109dd0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -410,8 +410,8 @@ class UsersController < ApplicationController @message = messages[@info_pages.offset, @info_pages.per_page] @state = 2 else - where_condition = nil;#"act_type <> 'JournalsForMessage'" - where_condition = "act_type <> 'JournalsForMessage'" + where_condition = nil; + # where_condition = "act_type <> 'JournalsForMessage'" if @user == User.current watcher = User.watched_by(@user) watcher.push(User.current) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ac0165f79..97e76a0c9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1378,6 +1378,39 @@ module ApplicationHelper html.html_safe end +#display bid project + def show_more_bid_project?(bid) + if bid.projects.where('is_public = 1').count > 12 + return true + else + return false + end + end + + def show_bid_project(bid) + html = '' + if bid.projects.where('is_public = 1').count == 0 + html << (content_tag "p", l(:label_no_bid_project), :class => "font_lighter") + else + bid.projects.where('is_public = 1').take(12).each do |project| + html << (link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar") + end + end + html.html_safe + end + + def show_bid_fans_picture(obj) + html = '' + if obj.watcher_users.count == 0 + html << (content_tag "span", l(:label_project_no_follow)) + else + obj.watcher_users.take(12).each do |user| + html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name) + end + end + html.html_safe + end + #display fans picture def show_more_fans?(obj) if obj.watcher_users.count > 12 @@ -1389,23 +1422,19 @@ module ApplicationHelper def show_fans_picture(obj) html = '' - count = 0 if obj.watcher_users.count == 0 html << (content_tag "span", l(:label_no_current_fans)) + else + obj.watcher_users.take(12).each do |user| + html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name) + end end - for user in obj.watcher_users - html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.show_name}") - count = count + 1 - if count >= 12 - break - end - end html.html_safe end # added by bai def show_more_participate?(obj) - if obj.join_in_contests.count > 0 + if obj.join_in_contests.count > 12 return true else return false @@ -1427,6 +1456,7 @@ module ApplicationHelper end html.html_safe end + #end # add by huang diff --git a/app/helpers/bids_helper.rb b/app/helpers/bids_helper.rb index 103dbccfa..cb3a8f784 100644 --- a/app/helpers/bids_helper.rb +++ b/app/helpers/bids_helper.rb @@ -135,4 +135,12 @@ module BidsHelper people.include?(User.current) end + def select_option_helper option + tmp = Hash.new + option.each do |project| + tmp[project.name] = project.identifier + end + tmp + end + end \ No newline at end of file diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 5921fb377..63d5fea2a 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -237,7 +237,22 @@ module ProjectsHelper when "attachment" l :label_attachment when "news" - l :label_news + l :label_news + else + "" + end + end + + def eventToLanguageCourse event_type, project + case event_type + when "issue-note" + l :label_issue + when "issue" + l :label_issue + when "attachment" + l :label_attachment + when "news" + project.project_type == 1 ? (l :label_notification) : (l :label_news) else "" end diff --git a/app/models/homework_attach.rb b/app/models/homework_attach.rb index aea68abb5..5ce08a0a8 100644 --- a/app/models/homework_attach.rb +++ b/app/models/homework_attach.rb @@ -1,9 +1,10 @@ class HomeworkAttach < ActiveRecord::Base - attr_accessible :bid_id, :user_id - + include Redmine::SafeAttributes belongs_to :user belongs_to :bid + safe_attributes "bid_id", + "user_id" acts_as_attachable end diff --git a/app/models/user.rb b/app/models/user.rb index 48bda02a6..6b1ee3d1b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -245,6 +245,8 @@ class User < Principal self.read_attribute(:identity_url) end + VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i + # VALID_EMAIL_REGEX = /^[0-9a-zA-Z_-]+@[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+)+$/ # Returns the user that matches provided login and password, or nil #登录,返回用户名与密码匹配的用户 def self.try_to_login(login, password) @@ -253,7 +255,11 @@ class User < Principal # Make sure no one can sign in with an empty login or password return nil if login.empty? || password.empty? - user = find_by_login(login) + if (login =~ VALID_EMAIL_REGEX) + user = find_by_mail(login) + else + user = find_by_login(login) + end if user # user is already in local database #return nil unless user.active? diff --git a/app/views/attachments/upload.js.erb b/app/views/attachments/upload.js.erb index 04e30b569..4761f4635 100644 --- a/app/views/attachments/upload.js.erb +++ b/app/views/attachments/upload.js.erb @@ -1,9 +1,14 @@ -var fileSpan = $('#attachments_<%= j params[:attachment_id] %>'); -$('', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan); -fileSpan.find('a.remove-upload') - .attr({ - "data-remote": true, - "data-method": 'delete', - href: '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>' - }) - .off('click'); +var fileSpan = $('#attachments_<%= j params[:attachment_id] %>'); +<% if(!@attachment.nil? && @attachment.new_record?) %> + fileSpan.hide(); + alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>"); +<% else %> +$('', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan); +fileSpan.find('a.remove-upload') + .attr({ + "data-remote": true, + "data-method": 'delete', + href: '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>' + }) + .off('click'); +<% end %> diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index d3c4d65d2..2c347fa64 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -56,7 +56,7 @@ <%= bid.description %> - <%= l(:label_create_time) %> : <%=format_time bid.created_on %> <%= l(:field_deadline) %> : <%=bid.deadline %> + <%= l(:label_create_time) %> :  <%=format_time bid.created_on %> <%= l(:field_deadline) %> :  <%=bid.deadline %> diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb index 79d10bff0..5094d0c0a 100644 --- a/app/views/bids/_homework.html.erb +++ b/app/views/bids/_homework.html.erb @@ -1,21 +1,33 @@ +<%= render_flash_messages %> <% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) %>
- <%= toggle_link l(:label_commit_homework), 'put-bid-form' %> + <%= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
<% end %> diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index f016eafc5..0fd2bf202 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -1,10 +1,9 @@ -<%= render_flash_messages %> <%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %>
- +
<%= l(:label_task_plural)%><%= l(:label_task_plural)%>(<%= @homework_list.count%>) - - - - - <%= sort_bid(@s_state, @project_type)%> - - - - + <% if @bids.size > 0 %>
- <%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %> + <%= sort_bid(@s_state, @project_type)%> + <%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
+ <% else %> + <%= render :partial => "layouts/no_content"%> + <% end %> diff --git a/app/views/bids/new_submit_homework.html.erb b/app/views/bids/new_submit_homework.html.erb new file mode 100644 index 000000000..dd06af643 --- /dev/null +++ b/app/views/bids/new_submit_homework.html.erb @@ -0,0 +1,15 @@ +

<%= l :label_bidding_homework %>

+
+ <%= form_for HomeworkAttach.new, :method => :post, :url => {:controller => 'bids', :action => 'add_homework'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true} do |f| %> +
+ + <%= l(:label_attachment_plural) %> + +

+ <%= render :partial => 'attachments/form' %> +

+
+ <%= submit_tag l(:button_create) %> + <%= link_to (t :button_back), project_for_bid_homework_path %> + <% end %> +
\ No newline at end of file diff --git a/app/views/bids/show_bid_user.html.erb b/app/views/bids/show_bid_user.html.erb index 2fd6205d0..f4d7b2642 100644 --- a/app/views/bids/show_bid_user.html.erb +++ b/app/views/bids/show_bid_user.html.erb @@ -1,5 +1,5 @@
- <% for user in @users %> + <% for user in @bid.watcher_users %>
  • diff --git a/app/views/bids/show_project.html.erb b/app/views/bids/show_project.html.erb index be9c9db3b..502d07d46 100644 --- a/app/views/bids/show_project.html.erb +++ b/app/views/bids/show_project.html.erb @@ -70,7 +70,7 @@ :complete => '$("#put-bid-form").hide();' do |f| %>
    - +
    <%= select_tag 'bid', options_for_select(@option), :name => 'bid', :class => 'grayline' %><%= select_tag 'bid', options_for_select(select_option_helper(@option)), :name => 'bid', :class => 'grayline' %>

    diff --git a/app/views/common/_project.html.erb b/app/views/common/_project.html.erb index 516ed0f5e..9109c3fd6 100644 --- a/app/views/common/_project.html.erb +++ b/app/views/common/_project.html.erb @@ -1,58 +1,58 @@ -

    -
    - <%= content_tag('div', tag('img', {:src => '../images/logo-only_med.png', :class => 'img_ta'}, false, false), :class => 'img-tag') %> -
    -
    -

    - Claimed by <%= content_tag('a', project.name) %> | Analyzed about 11 hours ago -

    -

    - <%= textilizable(project.short_description, :project => project) %> -

    -
    -
    -

    - <%= content_tag('a', "9.23M") %><%= content_tag('span', "lines of codes") %> -

    -

    - <%= content_tag('a', "963") %><%= content_tag('span', "current contributors") %> -

    -

    - <%= content_tag('a', "1 day") %><%= content_tag('span', "since last commits") %> -

    -

    - <%= content_tag('a', "12,169") %><%= content_tag('span', "users on trustie2") %> -

    -
    -
    - <%= content_tag('a', tag('img', {:src => '../images/pai.png', :class => 'img-ta'}, false, false), :class => 'img-tag3') %> - <%= content_tag('div', "Vert High Activity", :class => 'img-tag4') %> - <%= content_tag('div', tag('img', {:src => '../images/stars_ro.png', :class => 'img-ta'}, false, false), :class => 'img-tag2') %> - <%= content_tag('div', "#{WatchersOfProjects.watcher_count(project)}Reviews", :class => 'img-tag1') %> -
    -
    -
    -
    - <%= content_tag('a', 'Mostly written in C++') %> -
    -
    - <%= content_tag('a', 'Licenses:') %><%= content_tag('span', 'GPL-2.0+, LGPL, MPL-1.1') %> -
    -
    -
    - <%= tag('img', {:src => "../images/user.png"}, false, false) %> - <% tags = ProjectTags.find_tag(project.id) - tags.each do |t_tag| - content = t_tag.tag.content - description = t_tag.description -%> - <%= content_tag('a', content, :class => 'tag', :title => description) %> - <% end -%> - <%= content_tag('a', 'css', :class => 'tag') %> - <%= content_tag('a', 'web_browser', :class => 'tag') %> - <%= content_tag('a', 'development', :class => 'tag') %> - <%= content_tag('a', 'client', :class => 'tag') %> - <%= content_tag('a', 'web', :class => 'tag') %> - <%= content_tag('a', 'xhtml', :class => 'tag') %> - <%= content_tag('a', 'tabbed', :class => 'tag') %> - <%= content_tag('a', 'and more') %> -
    +
    +
    + <%= content_tag('div', tag('img', {:src => '../images/logo-only_med.png', :class => 'img_ta'}, false, false), :class => 'img-tag') %> +
    +
    +

    + Claimed by <%= content_tag('a', project.name) %> | Analyzed about 11 hours ago +

    +

    + <%= textilizable(project.short_description, :project => project) %> +

    +
    +
    +

    + <%= content_tag('a', "9.23M") %><%= content_tag('span', "lines of codes") %> +

    +

    + <%= content_tag('a', "963") %><%= content_tag('span', "current contributors") %> +

    +

    + <%= content_tag('a', "1 day") %><%= content_tag('span', "since last commits") %> +

    +

    + <%= content_tag('a', "12,169") %><%= content_tag('span', "users on trustie2") %> +

    +
    +
    + <%= content_tag('a', tag('img', {:class => 'img-ta'}, false, false), :class => 'img-tag3') %> + <%= content_tag('div', "Vert High Activity", :class => 'img-tag4') %> + <%= content_tag('div', tag('img', {:src => '../images/stars_ro.png', :class => 'img-ta'}, false, false), :class => 'img-tag2') %> + <%= content_tag('div', "#{WatchersOfProjects.watcher_count(project)}Reviews", :class => 'img-tag1') %> +
    +
    +
    +
    + <%= content_tag('a', 'Mostly written in C++') %> +
    +
    + <%= content_tag('a', 'Licenses:') %><%= content_tag('span', 'GPL-2.0+, LGPL, MPL-1.1') %> +
    +
    +
    + <%= tag('img', {:src => "../images/user.png"}, false, false) %> + <% tags = ProjectTags.find_tag(project.id) + tags.each do |t_tag| + content = t_tag.tag.content + description = t_tag.description -%> + <%= content_tag('a', content, :class => 'tag', :title => description) %> + <% end -%> + <%= content_tag('a', 'css', :class => 'tag') %> + <%= content_tag('a', 'web_browser', :class => 'tag') %> + <%= content_tag('a', 'development', :class => 'tag') %> + <%= content_tag('a', 'client', :class => 'tag') %> + <%= content_tag('a', 'web', :class => 'tag') %> + <%= content_tag('a', 'xhtml', :class => 'tag') %> + <%= content_tag('a', 'tabbed', :class => 'tag') %> + <%= content_tag('a', 'and more') %> +
    diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index f6546778a..dc7c97b36 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -24,5 +24,8 @@
- -<%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %> +<% if @forums.size > 0 %> + <%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %> +<% else %> + <%= render :partial => "layouts/no_content" %> +<% end %> diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 8a82741cc..2019a7b45 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -38,12 +38,12 @@ <% end -%>
    - <%= l(:field_description)%>:<%= issue.description %> + <%= l(:field_description)%>: <%= issue.description %>
    <% unless issue.assigned_to_id.nil? %> - <%= l(:field_assigned_to)%><%= raw column_content[5] %> + <%= l(:field_assigned_to)%> <%= raw column_content[5] %>  <% end %> <%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
    diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 5934733cd..a72eb4b41 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -4,7 +4,7 @@ :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %> <%= link_to l(:label_query), '#', :class => 'icon icon-help', - :onclick => '$("#custom_query").toggle(); ' if User.current.logged? %> + :onclick => '$("#custom_query").slideToggle(); ' if User.current.logged? %>
    diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index df99cceff..8a543c517 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -4,4 +4,14 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/layouts/_no_content.html.erb b/app/views/layouts/_no_content.html.erb new file mode 100644 index 000000000..990b85bae --- /dev/null +++ b/app/views/layouts/_no_content.html.erb @@ -0,0 +1,10 @@ +
    +

    没有搜索到相关的内容!

    +
    +

    建议您 :

    +
    重新设置搜索关键词
    +
    不要使用太长的关键词
    +
    不要使用特殊符号,如"^&%$#@*%"等
    +
    清除关键词之间的空格
    +
    +
    diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb index 5736f0821..cbc2173b1 100644 --- a/app/views/layouts/base_contest.html.erb +++ b/app/views/layouts/base_contest.html.erb @@ -21,20 +21,19 @@
    <%=render :partial => 'layouts/base_header'%>
    -
    - - + + @@ -46,9 +45,7 @@
    创新竞赛社区<%= l(:label_user_location) %> : 创新竞赛社区<%= l(:label_user_location) %> :
    - -
- - - <%if User.current.logged? %> + <% if User.current.logged? %> <% if @bid.author.id == User.current.id %> - <%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %> + <%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %> <% end %> <% end %>
-
@@ -98,7 +92,6 @@
-
@@ -112,20 +105,13 @@
<%= l(:label_limit_time) %> : <%= @bid.deadline%>
-
- <%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %>   - <%= link_to l(:label_bidding_project)+"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>  - <%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%> -
-
<%= l(:label_project_overview) %>
-
<% if @bid.description.size>0 %>
@@ -145,7 +131,6 @@
-
@@ -154,24 +139,20 @@
-
+
<%= l(:label_x_followers, :count => @bid.watcher_users.count) %> + <% if show_more_fans?(@bid) %> + <%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%> + <% end %>
-
- <% if @bid.watcher_users.size>0 && @bid.watcher_users.count<13%> - <% for user in @bid.watcher_users%> - <%= link_to image_tag(url_to_avatar(user), :class => "avatar", :title => user.name ), user_path(user), :class => "avatar" %> - <% end %> - <% else %> -

<%= l(:label_project_no_follow) %>

- <% end%> + <%= show_bid_fans_picture(@bid)%>
@@ -179,33 +160,24 @@
-
- <%= l(:label_bidding_project) %> - <%= link_to "更多>>", :controller => 'bids', :action => 'show_project'%> -
-
+
+ <%= l(:label_bidding_project) %> + <% if show_more_bid_project?(@bid) %> + <%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%> + <% end %> +
+ <%= show_bid_project(@bid) %> +
- <% if @bid.projects.size<0%> -

<%= l(:label_no_bid_project) %>

- - <%else%> - <% for project in objCut12(@bid.projects.where('is_public=1')) %> - <%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %> - <% end%> - <% end %> -
- -
-
@@ -215,9 +187,9 @@
<%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %> <% if show_more_participate?(@bid) %> -
+ <%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%> -
+ <% end %>
@@ -228,8 +200,8 @@
- - + +
<% if display_main_menu?(@bid) %>
diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 82cceaaec..827874d55 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -8,7 +8,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= heads_for_theme %> diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 597ccd6a6..33b296bfb 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -162,24 +162,12 @@
- - <% if User.current.logged? %> - <% if User.current.admin?||User.current.login==@user.login%>
- - -
<%= render :partial => 'tags/tag', :locals => {:obj => @user,:object_flag => "1"}%>
- <% end %> - <% end %> - - - -
diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb index 32c03d2ad..a8991b572 100644 --- a/app/views/memos/_reply_box.html.erb +++ b/app/views/memos/_reply_box.html.erb @@ -1,4 +1,4 @@ -<%= form_for(@mome_new, url: forum_memos_path) do |f| %> +<%= form_for(@mome_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %> <%= f.hidden_field :subject, :required => true, value: @memo.subject %> <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> @@ -8,7 +8,7 @@

<%= l(:label_attachment_plural) %>
- <%= render :partial => 'attachments/form', :locals => {:container => @mome_new} %> + <%= render :partial => 'attachments/form' %>

<%= f.submit value: l(:label_reply_plural), class: "replies" %> <% end %> \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 5e2c83790..6c5aae172 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -45,7 +45,7 @@

<%= l(:label_reply_plural) %> (<%= @replies.nil? ? 0 : @replies.size %>)

- <% pages_count = (params['page'].to_i - 1) * 10 %> + <% pages_count = @reply_pages.offset %> <% @replies.each do |reply| %>
">

<%= pages_count += 1 %>楼 :

diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index d2ff856f2..a71941ee1 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -171,6 +171,10 @@ <%= link_to_attachments message, :author => false %> --> <% end %> + +<% end %> + + <% if !@topic.locked? && authorize_for('messages', 'reply') %>

<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>

<% end %> diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index 0e67766db..a43565cfc 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -28,23 +28,6 @@ <% end if @project %>
- - -
<% if @newss.empty? %> @@ -73,7 +56,7 @@ <%= textilizable(news, :description) %> - <%= l :label_update_time %>: <%= format_time(news.created_on) %> + <%= l :label_update_time %>: <%= format_time(news.created_on) %> <%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %> diff --git a/app/views/projects/course.html.erb b/app/views/projects/course.html.erb index 8c1212c46..d7235aa3f 100644 --- a/app/views/projects/course.html.erb +++ b/app/views/projects/course.html.erb @@ -25,7 +25,7 @@ - <%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> + <%= link_to "forge.trustie.net/project/course", :controller => 'projects', :action => 'course', :project_type => 1 %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %> diff --git a/app/views/projects/search.html.erb b/app/views/projects/search.html.erb index b3f5c22ea..2915c032f 100644 --- a/app/views/projects/search.html.erb +++ b/app/views/projects/search.html.erb @@ -1,36 +1,6 @@ <% content_for :header_tags do %> <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> <% end %> - - -
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %> <% if params[:project_type] == "1" %> @@ -85,10 +55,13 @@ <% end %>
- +<% if @projects.size == 0 %> +<%= render :partial => 'layouts/no_content'%> +<% else %>
<%= render_project_hierarchy(@projects)%>
+<% end %>