From ed3be27687d32398fd0d9ccaecede8c804d6fb0c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 18:07:31 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 97a159884..7e42d8332 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -1,5 +1,5 @@ -
+
消息
    From 631283ae79f5a15bb0da7741b97477a1a154458d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 26 Aug 2015 20:37:43 +0800 Subject: [PATCH 02/12] remove grack --- app/controllers/repositories_controller.rb | 12 ++++++------ .../projects/settings/_new_repositories.html.erb | 15 +++++++++++++++ config/routes.rb | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 6dec9a82f..126b269bb 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -127,18 +127,19 @@ update end else # 原逻辑 ##xianbo - params[:repository_scm] = "Git" @root_path=RepositoriesHelper::ROOT_PATH @repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git" @project_path=@root_path+"htdocs/"+@repository_name - @repository_tag=params[:repository][:upassword] || params[:repository][:password] || '1234' + @repository_tag=params[:repository][:upassword] || params[:repository][:password] @repo_name=User.current.login.to_s+"_"+params[:repository][:identifier] logger.info "htpasswd -mb "+@root_path+"htdocs/user.passwd "+@repo_name+": "+@repository_tag logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name attrs = pickup_extra_info - params[:repository][:url]=@project_path + if((@repository_tag!="")&¶ms[:repository_scm]=="Git") + params[:repository][:url]=@project_path + end ###xianbo - @repository = Repository.factory(params[:repository_scm]||"Git") + @repository = Repository.factory(params[:repository_scm]) @repository.safe_attributes = params[:repository] if attrs[:attrs_extra].keys.any? @repository.merge_extra_info(attrs[:attrs_extra]) @@ -277,8 +278,7 @@ update @course_tag = params[:course] project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT ip = RepositoriesHelper::REPO_IP_ADDRESS - # @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+ - @repos_url = "http://#{Setting.host_name}/#{@repository.login.to_s}/#{@repository.identifier.to_s}.git" + @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+ @repository.url.slice(project_path_cut, @repository.url.length).to_s if @course_tag == 1 render :action => 'show', :layout => 'base_courses' diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb index b626b4089..be793a409 100644 --- a/app/views/projects/settings/_new_repositories.html.erb +++ b/app/views/projects/settings/_new_repositories.html.erb @@ -62,6 +62,16 @@ <%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post"} do |f| %>
      +
    • + + <%= select_tag('repository_scm', + options_for_select(["Git"],@repository.class.name.demodulize), + :data => {:remote => true, :method => 'get'})%> + <% if @repository && ! @repository.class.scm_available %> + <%= l(:text_scm_command_not_available) %> + <% end %> +
    • + <% unless judge_main_repository(@project) %>
    • @@ -75,6 +85,11 @@ <%=l(:text_length_between,:min=>1,:max=>254)< <% end %>
    • +
    • + + <%= f.password_field :upassword, :label=> "", :no_label => true %> + <%= l(:label_upassword_info)%> +
    <%=l(:button_save)%> diff --git a/config/routes.rb b/config/routes.rb index 7ba09a83a..7c0042f6d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,7 +29,7 @@ RedmineApp::Application.routes.draw do mount Mobile::API => '/api' # Enable Grack support - mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] + # mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] resources :homework_users resources :no_uses From 1f87c4adf5293612b04445f3b58c5ed255d12778 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Aug 2015 09:46:17 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E9=87=8D=E5=A4=8DCSS=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 22e13709b..c86435a4d 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -380,8 +380,6 @@ a.sendButtonBlue:hover {color:#ffffff;} background-color: #64bdd9; outline:none; } -.homepageRightBanner {width:720px; height:34px; margin:0px auto; border-bottom:1px solid #e9e9e9;} -.NewsBannerName {font-size:16px; color:#4b4b4b; display:block; background:url(images/homepage_icon.png) -18px -230px no-repeat; width:150px; float:left; padding-left:15px; margin-top:4px;} a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;} a.resourcesTypeAtt {background:url(images/homepage_icon.png) -180px -49px no-repeat; padding-left:23px;} .resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2;} @@ -504,7 +502,7 @@ a.coursesLineGrey:hover {color:#ffffff;} a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} .homepageLeftLabelContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px;} .homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;} -.homepageRightBanner {width:720px; height:34px; margin:0px auto; border-bottom:1px solid #e9e9e9;} +.homepageRightBanner {width:720px; height:34px; margin:0px auto;} .NewsBannerName {font-size:16px; color:#4b4b4b; display:block; background:url(../images/homepage_icon.png) -18px -230px no-repeat; width:150px; float:left; padding-left:15px; margin-top:4px;} .newsType {width:60px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-40px; font-size:12px; color:#888888; display:none; line-height:2; z-index:9999;} .newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;} From cc76c1370049bea2ab0f17b877e6d4136113f898 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Aug 2015 15:07:48 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_resource.html.erb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index c36fdc293..b644fc73e 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -43,7 +43,7 @@ $("#upload_form").submit(); } -
    +
    资源库
      @@ -102,12 +102,14 @@
    +
    +
    +
      + <%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true%> +
    +
    -
    -
      - <%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true%> -
    -
    +
- + + +
\ No newline at end of file diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index eafa9cf0d..e184d4132 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -10,6 +10,7 @@ <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> +
<% end %> <% container.saved_attachments.each_with_index do |attachment, i| %> @@ -20,6 +21,7 @@ <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> +
<% end %> <% end %> diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index c38454a6b..2d4c7eb49 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -27,11 +27,13 @@
- <%= select_tag :course_id,options_for_select(get_as_teacher_courses(User.current),homework.course_id), {:class => "InputBox W700 SearchIcon"} %> + <%= select_tag :course_id,options_for_select(get_as_teacher_courses(User.current),homework.course_id), {:class => "InputBox w708 SearchIcon"} %>
- <%= render :partial => 'users/user_homework_attachment', :locals => { :container => homework } %> +
+ <%= render :partial => 'users/user_homework_attachment', :locals => { :container => homework } %> +
发送 diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 0191dca7f..16f3a3472 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -21,7 +21,9 @@
<% homework = HomeworkCommon.new %> <%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %> - <%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> +
+ <%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> +
<% end%>
diff --git a/app/views/users/user_select_homework.js.erb b/app/views/users/user_select_homework.js.erb new file mode 100644 index 000000000..945da4c9a --- /dev/null +++ b/app/views/users/user_select_homework.js.erb @@ -0,0 +1,7 @@ +//$("#HomeWorkCon").replaceWith("<%#= escape_javascript(render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:edit_mode => true })%>"); +hideModal('#coursesChoosePopup'); +$("#homework_name").val("<%= @homework.name%>"); +$("#homework_end_time").val("<%= @homework.end_time%>"); +$("#course_id").val("<%= @homework.course_id%>"); +$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework })%>"); +homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>"); diff --git a/config/routes.rb b/config/routes.rb index 62c23b959..634fb6d27 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -309,6 +309,7 @@ RedmineApp::Application.routes.draw do collection do match "tag_saveEx" , :via => [:get, :post] post "user_new_homework" + post 'user_select_homework' end member do match 'user_projects_index', :to => 'users#user_projects_index', :via => :get diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index e4b735b73..cfb8fb867 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -859,7 +859,8 @@ a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; l a:hover.BlueCirBtn{ background:#15bccf; color:#fff;} .W440{ width:440px;} .W120{ width:110px;} -.W700{ width:700px;} +.W700{ width:700px;max-width: 700px;min-width: 700px;} +.w708{width: 708px;} a.AnnexBtn{ background: url(../images/homepage_icon.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} a:hover.AnnexBtn{background: url(../images/homepage_icon.png) -90px -343px no-repeat; color:#15bccf;} a.FilesBtn{ background: url(../images/homepage_icon.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} @@ -919,7 +920,7 @@ img.ui-datepicker-trigger { #attachments_fields input.filename { border: 0; height: 1.8em; - max-width: 670px; + width: 630px; color: #7f7f7f; background-color: inherit; background: url(../images/pic_file.png) 0 3px no-repeat; @@ -932,6 +933,7 @@ img.ui-datepicker-trigger { .description{display: none !important;} .ispublic-label{display: none !important;} .is_public_checkbox{display: none !important;} +.is_public{display: none !important;} From 711b21070f4d32d7bc2a38f478952124599baa20 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 28 Aug 2015 11:53:05 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index cfb8fb867..43b7ec22c 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -764,6 +764,9 @@ div.modal { .ui-widget { font-family: Verdana, sans-serif; font-size: 1.1em; + width: 200px; + height: 14px; + background: #e2e2e2; } .ui-dialog .ui-dialog-content { position: relative; @@ -934,6 +937,7 @@ img.ui-datepicker-trigger { .ispublic-label{display: none !important;} .is_public_checkbox{display: none !important;} .is_public{display: none !important;} +.ui-corner-left{background: #64bdd9;} From 43d9697195828ad22fc3c9283aa09475923e6af2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 28 Aug 2015 11:55:32 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9D=97=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_homeworks.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 16f3a3472..2813f2006 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -15,10 +15,14 @@ <% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> -
-
+
+
发布作业
+
+
+ +
<% homework = HomeworkCommon.new %> <%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %>