新版base完成

This commit is contained in:
huang 2016-10-11 10:16:17 +08:00
parent 3c15c4f315
commit 227965aafe
3 changed files with 13 additions and 169 deletions

View File

@ -38,6 +38,16 @@
$('#incourse').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
function project_files_upload()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_project_files',:locals => {:project => @project, :project_attachment_type => 1}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
</script>
<div class="homepageRight mt0 ml10">

View File

@ -2,6 +2,8 @@
<% project_issue_count = @project.issues.count %>
<% project_acts = ForgeActivity.where("project_id = ?", @project.id).count %>
<% raodmaps = Version.where("project_id = ?", @project.id).count %>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @project %>
<div class="pro_new_top clear mb10">
<div class="fl pro_new_name ml15">
@ -92,54 +94,4 @@
$("#navContentCourse").toggle();
}
})
</script>
<div class="sy_class_infobox mb10 clear">
<div class="sy_class_logo fl">
<div class="pr" style="width: 110px; height:110px;">
<% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?) %>
<%=link_to image_tag(url_to_avatar(@project), width:"110", height: "110", :id => 'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @project.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@project), :width => "110", :height => "110", :alt => "项目logo") %>
<% end %>
</div>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @project %>
<div class="sy_class_id fl"><p><%= l(:label_project_ivite_code)%><br /><span class="sy_corange"><%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %></span></p></div>
<div class="sy_class_info fl ml15">
<div class="sy_class_titbox clear">
<h3 class="fl sy_class_title">
<a href="javascript:void(0);"class="mr5 c_dark"><%= @project.creater %></a>/
<a href="javascript:void(0);"class=" ml5 c_dark"><%= @project.name %></a>
</h3>
<span class="sy_new_orange fl ml10 mt5"><%= @project.is_public? ? l(:label_public) : l(:label_private) %></span>
</div>
<p class="sy_cgrey">
<span class=" mr15">项目评分:
<% if @project.project_type == 0 %>
<%# unless static_project_score(@project.project_score) == 0 %>
<%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
{:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "sy_cblue" ) %>
<%# end %>
<% end %>
</span>
<span class=" mr15">浏览:<a class="sy_corange"><%= @project.visits.to_i %></a></span>
<span class=" mr15">关注:<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %></span>
<span class=" mr15">成员:<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %></span>
</p>
<div class="mt15 clear" id="join_exit_project_div">
<%= render 'layouts/join_exit_project' %>
</div>
</div>
<div class="cl"></div>
</div>
</script>

View File

@ -42,52 +42,11 @@
<% end%>
</div>
<div class="cl"></div>
<div id="Container">
<div class="cl"></div>
<div id="content" class="sy_contanier" style=" width:1000px; margin:0 auto;">
<%= render :partial => 'layouts/base_project_top' %>
<div id="LSide" class="fl">
<!--邀请加入-->
<div class="subNavBoxProject">
<div id="project_memu_list">
<%= render :partial => 'projects/development_group', :locals => {:project => @project} %>
</div>
</div>
<!--项目侧导航 end-->
<div class="cl"></div>
<!-- 项目描述 -->
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_project_overview)%></h4>
<div id="course_description_content" class="break_word">
<%= textilizable(@project.description) if @project.description && !@project.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<label id="expend_more_information" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
</div><!--项目简介 end-->
<!-- tag模块 -->
<div class="project_Label">
<h4 class="mb5"><%= l(:label_tag)%></h4>
<div class="tag_h">
<div id="tags">
<%= render :partial => 'tags/project_tag', :locals => {:obj => @project,:object_flag => "2"}%>
</div>
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @project.visits.to_i %> 自2016年5月</div>
</div>
</div>
<div class="fl">
<%= render_flash_messages %>
<%= yield %>
@ -101,83 +60,6 @@
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="light" class="white_content02">
<!-- 这里写需弹出框的HTML代码 -->
<% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%>
<div ><a href="javascript:void(0)" onClick="close_window('<%= text%>');" class="box_close" id="close_light"></a></div>
<div class=" mt10">
<h3 class="mb10 c_blue">请选择项目类型:</h3>
<ul class="mb10" id="project_type">
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label class="f14">&nbsp;&nbsp;开发模式:<span class="f12 ml5 c_grey">面向小组开发,支持问题跟踪、代码托管、论坛交流等所有功能。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label class="f14">&nbsp;&nbsp;研讨模式:<span class="f12 ml5 c_grey">面向小组研究,支持任务分工、论坛交流、资源分享等。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label class="f14">&nbsp;&nbsp;圈子模式:<span class="f12 ml5 c_grey">面向好友分享,支持论坛交流、资源分享等。</span></label></li>
</ul>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>
</div>
<!--项目的三种类型-->
<script type="text/javascript">
function click_ok(url)
{
$('#light').css('display','none');
$('#fade').css('display','none');
//ajax处理请求
var project_type;
if($("#development_group").attr("checked") == "checked"){
project_type = 1;
}
else if($("#research_group").attr("checked") == "checked"){
project_type = 2;
}
else if($("#friend_organization").attr("checked") == "checked"){
project_type = 3;
}
$.get(
url,
{ project_type: project_type},
function (data) {
if(data == 1)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team), 1))%>");
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/development_group', :locals => {:project => @project})) %>');
$("#close_light").attr("onClick","close_window('development_group');");
}
else if(data == 2)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group), 2))%>");
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/research_team', :locals => {:project => @project})) %>');
$("#close_light").attr("onClick","close_window('research_group');");
}
else if(data == 3)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization), 3))%>");
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/friend_group', :locals => {:project => @project})) %>');
$("#close_light").attr("onClick","close_window('friend_organization');");
}
else
{
alert("服务器异常,请与管理员联系");
}
}
);
}
function project_files_upload()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_project_files',:locals => {:project => @project, :project_attachment_type => 1}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
$("#expand_tools_expand").click(function(){
$("#navContent").toggle();
});
</script>
</div>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>