From bb676b697b78ce8e050179a233f4e196f070dfdd Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 24 Sep 2015 09:47:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E2=80=9C=E9=A1=B9=E7=9B=AE=E7=B1=BB=E5=9E=8B=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E2=80=9D=20=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=96=B0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/_form_new.html.erb | 28 +++++++++++++++++++++++++++ app/views/projects/new.html.erb | 28 +++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 app/views/projects/_form_new.html.erb diff --git a/app/views/projects/_form_new.html.erb b/app/views/projects/_form_new.html.erb new file mode 100644 index 000000000..c53c23d47 --- /dev/null +++ b/app/views/projects/_form_new.html.erb @@ -0,0 +1,28 @@ +<%# 这些代码删除也没什么影响,暂时放着,待优化 %> +<%= wikitoolbar_for 'project_description' %> + +<% @project.custom_field_values.each do |value| %> +

+ <%= custom_field_tag_with_label :project, value %> +

+<% end %> +<%= call_hook(:view_projects_form, :project => @project, :form => f) %> +<% unless @project.identifier_frozen? %> + <% content_for :header_tags do %> + <%= javascript_include_tag 'project_identifier' %> + <% end %> +<% end %> + +<% if !User.current.admin? && @project.inherit_members? && @project.parent && User.current.member_of?(@project.parent) %> + <%= javascript_tag do %> + $(document).ready(function() { + $("#project_inherit_members").change(function(){ + if (!$(this).is(':checked')) { + if (!confirm("<%= escape_javascript(l(:text_own_membership_delete_confirmation)) %>")) { + $("#project_inherit_members").attr("checked", true); + } + } + }); + }); + <% end %> +<% end %> diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index 039a9e69c..26fb104bd 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -1,6 +1,6 @@ <% @nav_dispaly_project_label = 1 @nav_dispaly_forum_label = 1 %> - +<%= error_messages_for 'project' %>

<%= l(:label_project_new)%>

@@ -17,7 +17,7 @@
  • - <%= select_tag :project_new_type, options_for_select(project_type_select, @project.project_new_type) %> + <%= select_tag :project_new_type, options_for_select(project_type_select, @project.project_new_type) %>开发模式开发模式开发模式开发模式开发模式开发模式开发模式开发模
  • @@ -25,12 +25,31 @@
  • +
  • +

    + <%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH, + value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %> + <% unless @project.identifier_frozen? %> + + <%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> + <%= l(:text_project_identifier_info).html_safe %> + + <% end %>

    +
  • - + (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
  • +
  • +

    + <%= f.text_field :project_type, :value => 0 %> +

    +
  • +
  • + <%= render :partial => 'form_new', :locals => { :f => f } %> +
  • 提交 <%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%> @@ -70,4 +89,5 @@ $("#new_project").submit(); } } - \ No newline at end of file + +