完成修改项目界面

This commit is contained in:
sw 2015-04-11 17:04:48 +08:00
parent b19bfa5c0a
commit fb935f124c
3 changed files with 41 additions and 53 deletions

View File

@ -455,22 +455,10 @@ class ProjectsController < ApplicationController
def update
@project.safe_attributes = params[:project]
@project.organization_id = params[:organization_id]
#@project.dts_test = params[:project][:dts_test]
params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0
if validate_parent_id && @project.save
@course = Course.find_by_extra(@project.identifier)
unless @course.nil?
@course.password = params[:project][:course][:password]
# added by bai
@course.term = params[:term]
@course.time = params[:time]
@course.setup_time = params[:setup_time]
@course.endup_time = params[:endup_time]
@course.class_period = params[:class_period]
# end
@course.save
end
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
if params[:project][:is_public] == '0'
project_status = ProjectStatus.find_by_project_id(@project.id)
project_status.destroy if project_status

View File

@ -1,40 +1,37 @@
<ul class="newpro_box ">
<form>
<li class="ml110">
<a href="javascript:void(0)" class="upimg fl"><img src="images/project/img_upsampn.png" width="60" height="60" alt="上传图片" /></a>
<input type="file" class="upbtn"/>
<%= labelled_form_for @project do |f| %>
<ul class="newpro_box ">
<li class="ml110 mb10">
<%= render :partial=>"avatar/new_avatar_form",:locals=> {source:@project} %>
<div class="cl"></div>
</li>
<li >
<label class="label02"><span class="c_red">*</span>&nbsp;名称&nbsp;&nbsp;</label>
<input type="text" name="" class=" w543" >
<input id="project_name" name="project[name]" class=" w543" type="text" value="<%= @project.name%>">
</li>
<div class="cl"></div>
<li >
<label class="label02" >&nbsp;&nbsp;描述&nbsp;&nbsp;</label>
<textarea name="" placeholder="最多3000个汉字(或6000个英文字符)" class=" w543" ></textarea>
<textarea class="w543" id="project_description" name="project[description]" rows="8" placeholder="最多3000个汉字(或6000个英文字符)"><%= @project.description%></textarea>
<div class="cl"></div>
</li>
<li >
<label class="label02"><span class="c_red">*</span>&nbsp;组织&nbsp;&nbsp;</label>
<select id="" name="">
<option value="" selected="selected">--请选择组织--</option>
<option value="">广州超算中心</option>
</select>
<%= select_tag :organization_id,options_for_select(project_organizations_id_option,@project.organization_id),{} %>
</li>
<div class="cl"></div>
<li >
<label class="label02">公开&nbsp;&nbsp;</label>
<input type="checkbox" name="" checked="" >
<input id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
<div class="cl"></div>
</li>
<li >
<label class="label02">隐藏代码库&nbsp;&nbsp;</label>
<input type="checkbox" name="" checked="" >
<input id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
<div class="cl"></div>
</li>
</form>
</ul>
<a href="javascript:void(0)" class="blue_btn ml110" >保存</a>
</ul>
<a href="javascript:void(0)" class="blue_btn ml110" onclick="$('#edit_project_<%= @project.id%>').submit();">保存</a>
<% end %>
<div class="cl"></div>

View File

@ -354,6 +354,9 @@ blockquote {
font-family: "Microsoft YaHei";
background: url(http://test.forge.trustie.net/images/requirements/xreference.jpg.pagespeed.ic.h4inUJNyH0.jpg);
}
/*上传项目图片*/
.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
/*配置*/
.pro_st_ttl{ height:24px;}
.pro_st_ctt{height:auto; clear:both;}
.pro_setting{width:670px;/*滑动门的宽度*/}