diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c055d38ae..f9ad609cc 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -759,7 +759,7 @@ class CoursesController < ApplicationController def homework if @course.is_public != 0 || User.current.member_of_course?(@course) || User.current.admin? @offset, @limit = api_offset_and_limit({:limit => 10}) - @bids = @course.homeworks.order('deadline DESC') + @bids = @course.homeworks.order('deadline ASC') @bids = @bids.like(params[:name]) if params[:name].present? @bid_count = @bids.count @bid_pages = Paginator.new @bid_count, @limit, params['page'] diff --git a/app/controllers/discuss_demos_controller.rb b/app/controllers/discuss_demos_controller.rb index a0955efe2..b0c9791cb 100644 --- a/app/controllers/discuss_demos_controller.rb +++ b/app/controllers/discuss_demos_controller.rb @@ -26,10 +26,12 @@ class DiscussDemosController < ApplicationController def destroy asset = Kindeditor::Asset.find_by_owner_id(params[:id]) - filepath = File.join(Rails.root,"public","files","uploads", - asset[:created_at].to_s.gsub("+0800","").to_datetime.strftime("%Y%m").to_s, - asset[:asset].to_s) - File.delete(filepath) if File.exist?filepath + if !asset.nil? + filepath = File.join(Rails.root,"public","files","uploads", + asset[:created_at].to_s.gsub("+0800","").to_datetime.strftime("%Y%m").to_s, + asset[:asset].to_s) + File.delete(filepath) if File.exist?filepath + end DiscussDemo.destroy(params[:id]) redirect_to :controller=> 'discuss_demos',:action => 'index' end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index de9477b8a..790718e5d 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -162,7 +162,8 @@ class IssuesController < ApplicationController respond_to do |format| format.html { render_attachment_warning_if_needed(@issue) - flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("#{@issue.subject}", issue_path(@issue), :title => @issue.subject)) + flash[:notice] = l(:label_successful_create) + #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("#{@issue.subject}", issue_path(@issue), :title => @issue.subject)) #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject)) if params[:continue] attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 02bc3d8b3..294d895a5 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -43,7 +43,7 @@ module WatchersHelper ) method = watched ? 'delete' : 'post' - link_to text, url, :remote => true, :method => method, :style => "color: #fff; display:block; padding: 0px 5px; margin-right: 10px; height: 22px; line-height: 21px;padding-top:1px; background: none repeat scroll 0% 0% #64BDD9; TES" + link_to text, url, :remote => true, :method => method, :class => css end ############## added by linchun @@ -278,11 +278,48 @@ module WatchersHelper ) method = applied ? 'delete' : 'post' - link_to text, url, :remote => true, :method => method ,:style => "color: #fff; display:block; padding: 0px 5px; margin-right: 10px; height: 21px; line-height: 22px;padding-top:1px; background: none repeat scroll 0% 0% #64BDD9; TES" + link_to text, url, :remote => true, :method => method , :class => css end def exit_project_link(project) link_to(l(:label_exit_project),exit_cur_project_path(project.id), - :remote => true, :confirm => l(:lable_sure_exit_project), :style => "color: #fff; display:block; padding: 0px 5px; margin-right: 10px; height: 21px; line-height: 22px; background: none repeat scroll 0% 0% #64BDD9; TES;padding-top:1px;" ) + :remote => true, :confirm => l(:lable_sure_exit_project), + :style => "color: #fff; display:block;font-size:12px; padding: 0px 5px; margin-right: 10px; height: 20px; line-height: 22px; background: none repeat scroll 0% 0% #64BDD9; TES;padding-top:1px;" ) + end + + #项目关注、取消关注 + #REDO:项目样式确定后方法需要对CSS变量进行改进 + def watcher_link_for_project(objects, user, options=[]) + return '' unless user && user.logged? + objects = Array.wrap(objects) + watched = objects.any? {|object| object.watched_by?(user)} + @watch_flag = objects.first.instance_of?(Project) + id = watcher_css(objects) + text = @watch_flag ? + (watched ? l(:button_unfollow) : l(:label_button_following)) : (watched ? l(:button_unwatch) : l(:label_button_following)) + url = watch_path(:object_type => objects.first.class.to_s.underscore, + :object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)) + method = watched ? 'delete' : 'post' + link_to text, url, :remote => true, :method => method, + :class => "project_watch_new" ,:id=>id + end + + #申请加入项目 + def join_in_project_link(project, user, options=[]) + return '' unless user && user.logged? + applied = project.applied_projects.find_by_user_id(user.id) + text = applied ? l(:label_unapply_project) : l(:label_apply_project) + @applied_flag = project.instance_of?(Project) + if applied + appliedid = applied.id + end + id = applied_css(project) + url = appliedproject_path( + :id=>appliedid, + :user_id => user.id, + :project_id => project.id) + method = applied ? 'delete' : 'post' + link_to text, url, :remote => true, :method => method , :class => "project_watch_new",:id => id end + end diff --git a/app/views/applied_project/_set_applied.js.erb b/app/views/applied_project/_set_applied.js.erb index 7403b963b..33d862d1c 100644 --- a/app/views/applied_project/_set_applied.js.erb +++ b/app/views/applied_project/_set_applied.js.erb @@ -1,5 +1,14 @@ <% selector = ".#{applied_css(@project)}" %> -$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript applied_link(@project, User.current) %>")}); +<% id_selector = "#{applied_css(@project)}" %> +if($("<%= selector %>").get(0) == undefined) +{ + $("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript join_in_project_link(@project, User.current) %>")}); +} +else +{ + $("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript applied_link(@project, User.current) %>")}); +} + if (window.Messenger) { Messenger.options = { extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right', diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 67ae4ce66..b026fead2 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -1,6 +1,6 @@ <% if defined?(container) && container && container.saved_attachments %> - <% container.saved_attachments.each_with_index do |attachment, i| %> + <% container.attachments.each_with_index do |attachment, i| %> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> @@ -60,7 +60,11 @@ :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',:project =>project), - :description_placeholder => l(:label_optional_description) + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) } %> <%= l(:label_no_file_uploaded)%> diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index 43f99056b..301c49506 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -50,7 +50,11 @@ :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) + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) } %> <%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 8913febd0..4c2ee0c8f 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -7,9 +7,9 @@ <% end%> <% if options[:length] %> - <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%> + <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%> <% else %> - <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%> + <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%> <% end %> <%if is_float%> diff --git a/app/views/contests/watcherlist.html.erb b/app/views/contests/watcherlist.html.erb index 4987f3616..5628e5e95 100644 --- a/app/views/contests/watcherlist.html.erb +++ b/app/views/contests/watcherlist.html.erb @@ -15,7 +15,7 @@

<% unless user.memberships.empty? %> - <%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %> + <%= l(:label_contribute_to, :count => "#{user.memberships.count}") %> <% for member in user.memberships %> <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %> <% end %> diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 41025e619..6b9758fd2 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -34,7 +34,11 @@ :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) + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) } %>

+
<% curse_attachments.each do |file| %>
-
+
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> @@ -50,6 +51,7 @@
<% end %> +
    <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index bcd7b30c5..61cea920c 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -12,7 +12,7 @@ <% end %> - +<%= watcher_link(@issue, User.current) %> <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %>
diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index bf6862244..2172af8de 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -89,7 +89,7 @@ closeBtn.bind("click",function(){ sideContent.animate({width: '0px'},"fast"); show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); - cookiesave('minStatue','false','','',''); + cookiesave('minStatue','true','','',''); }); //show??? show_btn.bind("click",function() { diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index 0c4e54317..a5269d422 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -1,11 +1,11 @@
<% if ( !(User.current.member_of? @project) && User.current.login?) %> - <%= watcher_link(@project, User.current) %> + <%= watcher_link_for_project(@project, User.current) %> <% end %> <% if ( !(User.current.member_of? @project) && User.current.login?) %> - <%= applied_link(@project, User.current) %> + <%= join_in_project_link(@project, User.current) %> <% end %> <% if ((User.current.member_of? @project) && diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 9c999aa05..e69d92694 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -153,7 +153,7 @@ (<%= @project.issues.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px !important;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> <% end %>
<% end %> @@ -164,7 +164,7 @@ (<%= @project.boards.first.topics.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:0px 3px 3px 3px;height:16px;margin-top:5px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px !important;color:#fff; padding:0px 3px 3px 3px;height:16px;margin-top:5px;background:#28be6c;float:right;line-height:20px;" %> <% end %>
<% end%> @@ -175,7 +175,7 @@ (<%= attaments_num %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px !important;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> <% end %> <% end%> diff --git a/app/views/poll/publish_poll.js.erb b/app/views/poll/publish_poll.js.erb index 2e8dab181..721b920e5 100644 --- a/app/views/poll/publish_poll.js.erb +++ b/app/views/poll/publish_poll.js.erb @@ -1,7 +1,7 @@ $("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); $('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>"); showModal('ajax-modal', '250px'); -$('#ajax-modal').css('height','111px'); +//$('#ajax-modal').css('height','111px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); diff --git a/app/views/poll/republish_poll.js.erb b/app/views/poll/republish_poll.js.erb index f2fcee96a..8327c3a71 100644 --- a/app/views/poll/republish_poll.js.erb +++ b/app/views/poll/republish_poll.js.erb @@ -1,7 +1,7 @@ $("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); $('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>"); showModal('ajax-modal', '250px'); -$('#ajax-modal').css('height','80px'); +//$('#ajax-modal').css('height','80px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); diff --git a/app/views/projects/invite_members_by_mail.html.erb b/app/views/projects/invite_members_by_mail.html.erb index c222bece1..4fcc2e77d 100644 --- a/app/views/projects/invite_members_by_mail.html.erb +++ b/app/views/projects/invite_members_by_mail.html.erb @@ -1,68 +1,68 @@ - -
-

<%= l(:label_invite_join)%>

-
-
-
- -
-
-
-
-

<%= l(:label_invite_new_user)%>

-

- <%= l(:label_invite_email_tips)%> -

-
- <%= render :partial => 'regested', locals: { :isregisted => false} %> -
- <%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get') do %> - - <%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "verifyAddress();" %> -
-
- - <%= l(:label_send_email)%> - - <%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %> - <% end %> -
-
+ +
+

<%= l(:label_invite_join)%>

+
+
+
+ +
+
+
+
+

<%= l(:label_invite_new_user)%>

+

+ <%= l(:label_invite_email_tips)%> +

+
+ <%= render :partial => 'regested', locals: { :isregisted => false} %> +
+ <%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get') do %> + + <%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onblur => "verifyAddress();" %> +
+
+ + <%= l(:label_send_email)%> + + <%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %> + <% end %> +
+
\ No newline at end of file diff --git a/app/views/repositories/newrepo.html.erb b/app/views/repositories/newrepo.html.erb index 0c95a0335..3facbe96b 100644 --- a/app/views/repositories/newrepo.html.erb +++ b/app/views/repositories/newrepo.html.erb @@ -1,5 +1,7 @@ -

<%= l(:label_repository_new_repos) %>

+
+

<%= l(:label_repository_new_repos) %>

+
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form'} do |f| %> <%= render :partial => 'form_create', :locals => {:f => f} %> diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb index b97012723..2ee4d3f20 100644 --- a/app/views/tags/_tag_name.html.erb +++ b/app/views/tags/_tag_name.html.erb @@ -34,7 +34,12 @@ <% if object_flag == '2' %> - <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> + <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> + <% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %> + <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, + :taggable_id => obj.id, :taggable_type => object_flag %> + <% end %> + <% else %>
@@ -47,7 +52,7 @@ <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, :taggable_id => obj.id, :taggable_type => object_flag %> - <% end %> + <% end %> <% when '3' %> <% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %> diff --git a/app/views/watchers/_set_watcher.js.erb b/app/views/watchers/_set_watcher.js.erb index e5cdc4f3e..92fcbd489 100644 --- a/app/views/watchers/_set_watcher.js.erb +++ b/app/views/watchers/_set_watcher.js.erb @@ -1,2 +1,11 @@ <% selector = ".#{watcher_css(watched)}" %> -$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")}); +<% id_selector = "#{watcher_css(watched)}" %> +if($("<%= selector %>").get(0) == undefined) +{ + $("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")}); +} +else +{ + $("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")}); +} + diff --git a/config/locales/projects/en.yml b/config/locales/projects/en.yml index 5aca81426..8c8ab7bc4 100644 --- a/config/locales/projects/en.yml +++ b/config/locales/projects/en.yml @@ -33,7 +33,7 @@ en: # label_project_id: "Projcet ID:" - label_apply_project: Apply to Join + label_apply_project: "+Apply to Join" label_exit_project: Exit label_apply_project_waiting: "Application has been processed, please wait for administrator review." label_unapply_project: Cancel the application @@ -136,6 +136,7 @@ en: # 项目托管平台 # # 问题跟踪 + label_successful_create: Successfully created # diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index bd547c37e..7524c0415 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -10,9 +10,8 @@ zh: # # 公共类 # - label_apply_project: 申请加入 - label_project_new: 新建项目 - label_join_project: 加入项目 + label_project_new: "新建项目" + label_join_project: "加入项目" # @@ -36,7 +35,8 @@ zh: # label_project_id: "项目ID:" - label_apply_project: 申请加入 + label_apply_project: "+申请加入" + label_button_following: "+关注" label_exit_project: 退出项目 label_apply_project_waiting: 已处理申请,请等待管理员审核 label_unapply_project: 取消申请 @@ -135,11 +135,12 @@ zh: label_optional_description: 可选的描述 - + text_are_you_sure_all: 您确定要删除所有文件吗 # # 项目托管平台 # # 问题跟踪 + label_successful_create: 创建成功 # @@ -194,7 +195,7 @@ zh: label_invite_join: 邀请加入 label_invite_email_tips: 输入好友邮箱地址,Trustie会自动为该邮箱注册用户! notice_registed_success: 您输入的邮箱为空或者该邮箱已被注册! - label_email_format_error: 您所填写的电子邮件格式不正确 + label_email_format_error: 您输入的邮箱格式不正确! label_user_role_null: 用户和角色不能留空! label_send_email: 免费发送 label_input_email: 请输入邮箱地址 diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 9e9bc9859..5d2423238 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -629,10 +629,15 @@ function img_thumbnails() { $('.thumbnails a').colorbox({rel:'nofollow'}); $('.attachments').find('a').each(function(index, element) { var href_value = $(element).attr('href'); - if (/\.(jpg|png|gif|bmp)$/.test(href_value)) { + if (/\.(jpg|png|gif|bmp|jpeg|PNG|BMP|GIF|JPG|JPEG)$/.test(href_value)) { $(element).colorbox({rel:'nofollow'}); } - + }); + $('.for_img_thumbnails').find('a').each(function(index, element) { + var href_value = $(element).attr('href'); + if (/\.(jpg|png|gif|bmp|jpeg|PNG|BMP|GIF|JPG|JPEG)$/.test(href_value)) { + $(element).colorbox({rel:'nofollow'}); + } }); } $(document).ready(img_thumbnails); diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 8fbaa5981..44aa7a404 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -22,10 +22,10 @@ function addFile(inputEl, file, eagerUpload) { fileSpan.append( $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), - $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), - $('公开:').attr({ 'class': 'ispublic-label' }) , + $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload), + $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) , $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), - $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload), + $('   ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : $(inputEl).data('areYouSure') }).click(removeFile).toggle(!eagerUpload), $('
', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} ) ).appendTo('#attachments_fields'); @@ -86,8 +86,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { //gcm files count and add delete_all link var count=$('#attachments_fields>span').length; - $('#upload_file_count').html("已上传"+""+count+""+"个文件"); - + $('#upload_file_count').html(""+count+""+"个文件已上传"); if(count>=1){ var add_attachs=$('.add_attachment'); var delete_all=$('.remove_all'); @@ -121,7 +120,7 @@ function removeFile() { //gcm delete all file function removeAll(){ - if(confirm("您确定要删除所有文件吗?")){ + if(confirm("您确定要删除所有文件吗")){ $(".remove-upload").removeAttr("data-confirm"); $(".remove-upload").click(); } diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index ca8f0c3b6..8413b3c54 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -31,7 +31,7 @@ a{ text-decoration:none; } .fl{ float: left;} .fr{ float:right;} .project_h4{ font-size:14px; color:#3b3b3b;} - +.project_watch_new{color: #fff !important;font-size:12px; display:block !important; padding: 0px 4px !important; margin-right: 10px !important; height: 20px !important; line-height: 21px !important;padding-top:1px !important; background: none repeat scroll 0% 0% #64BDD9 !important;} .project_content{ width:940px; margin:10px auto;} .project_left{ float:left;} @@ -51,7 +51,6 @@ a{ text-decoration:none; } a.info_foot_num{ font-weight: bold; color:#3ca5c6; } .pr_info_foot{ color:#7f7f7f; margin-top:5px; font-size:12px } a:hover.info_foot_num{ color:#2390b2;} - /*左侧导航*/ .subNavBox{width:222px; background:#fff;margin:10px 10px 0 0;} .subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6;line-height:28px;padding-left:10px;background-color:#fff;} @@ -75,7 +74,7 @@ a:hover.subnav_green{ background:#14ad5a;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;} .lg-foot:hover{ color:#787b7e;} /****标签(和资源库的tag样式一致)***/ -.project_Label{ width:220px; padding-left:10px; padding-right:10px; background:#fff; margin-top:10px;} +.project_Label{ width:220px; padding-left:10px !important; padding-right:10px; background:#fff; margin-top:10px;} a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;} .submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; } .isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;} diff --git a/public/stylesheets/resource.css b/public/stylesheets/resource.css index f0f969b4a..d5b887de9 100644 --- a/public/stylesheets/resource.css +++ b/public/stylesheets/resource.css @@ -57,6 +57,7 @@ a.re_select{ display: block; height: 22px; border: 1px solid #ff9900; + width: auto; color: #ff9900; margin-left: 10px; padding-left: 10px;