org开发部分(未完)

This commit is contained in:
ouyangxuhua 2015-11-03 17:21:32 +08:00
parent eadab840b6
commit 3f289dcd74
4 changed files with 173 additions and 55 deletions

View File

@ -1,55 +0,0 @@
class OrganizationController < ApplicationController
# layout 'base_projects'
before_filter :require_admin, :except => [:index]
def index
#@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)")
@organizations = Organization.all
respond_to do |format|
format.html
end
end
def new
@organizations = Organization.new
respond_to do |format|
format.html
end
end
def create
@organizations = Organization.new
@organizations.name = params[:organization][:name]
if @organizations.save
redirect_to admin_organization_url
end
end
def edit
@organization = Organization.find params[:id]
respond_to do |format|
format.html
end
rescue Exception => e
render_404
end
def update
@organization = Organization.find params[:id]
@organization.name = params[:organization][:name]
if @organization.save
redirect_to admin_organization_url
end
rescue Exception => e
render_404
end
def destroy
@organization = Organization.find params[:id]
if @organization.destroy
redirect_to admin_organization_url
end
rescue Exception => e
render_404
end
end

View File

@ -1,4 +1,5 @@
class OrganizationsController < ApplicationController
layout 'base_org'
def new
@organization = Organization.new
render :layout => 'new_base'
@ -11,5 +12,16 @@ class OrganizationsController < ApplicationController
@organization.creator_id = User.current.id
member = OrgMember.new(:user_id => User.current.id, :role => 'Manager')
@organization.org_members << member
if @organization.save
redirect_to organization_path(@organization)
end
end
def show
end
def update
end
end

View File

@ -0,0 +1,157 @@
<% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %>
<%#@nav_dispaly_project_label = 1 %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<!--add by huang-->
<body onload="prettyPrint();">
<div class="navContainer mb10">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else %>
<%= render :partial => 'layouts/unlogin_header' %>
<% end %>
</div>
<div class="cl"></div>
<% @organization = Organization.find(params[:id])%>
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="homepageLeft">
<div class="homepagePortraitContainer">
<div class="pr_info_logo fl mr10 mb5">
<%= image_tag(url_to_avatar(@organization), :width=>"60", :height=>"60", :alt=>"组织logo") %>
</div>
<div class="orgName fl mb5 f14">组织id:<%= @organization.id %></div>
<a href="/projects/813/settings" class="pr_join_a"><span class="pr_setting"></span>配置</a>
<div class="cl"></div>
<div class="f12 fontGrey3">文章&nbsp;(&nbsp;<a href="javascript:void(0);" class="linkBlue">3</a>&nbsp;)&nbsp;|&nbsp;成员&nbsp;(&nbsp;<a href="javascript:void(0);" class="linkBlue">10</a>&nbsp;)</div>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">动态</a></div>
<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">项目</a><a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a></div>
<div class="homepageLeftMenuCourses borderBottomNone">
<ul style="display:none;">
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称一</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称二</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称三</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称四</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称五</a></li>
<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li>
</ul>
</div>
</div>
</div>
<div class="homepageRight">
<div class="homepageRightBanner">
<div class="NewsBannerName">最新动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li class="mt-4"><a href="javascript:void(0);" class="homepagePostTypeAll postTypeGrey">全部动态</a></li>
<li class="mt-4"><a href="/users/8523/user_activities?type=current_user" class="homepagePostTypeMine postTypeGrey">我的动态</a> </li>
</ul>
</li>
</ul>
</div>
<div class="resources mt10">
<div class="homepagePostBrief">
<div class="homepagePostPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像" /></a></div>
<div class="homepagePostDes">
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO <a href="javascript:void(0);" class="newsBlue ml15">micROS研究团队 | 组织</a></div>
<div class="homepagePostTitle"><a href="javascript:void(0);" class="postGrey">如何打造一场罗永浩式的精彩演讲?</a></div>
<div class="homepagePostDate"> 发帖时间2015-11-02 11:25 </div>
<div class="homepagePostIntro">罗永浩已经把他的主题演讲成功变成了一次次的重大的媒体事件,这让科技界和营销界的从业者们羡慕不已。事实上,老罗不仅从乔布斯那里继承了乔式审美,设计哲学,同时也继承了乔布斯的演讲艺术。乔布斯是人类历史上最伟大的演讲者。在一次又一次的"罗氏演讲"中,我们可以清晰看到老罗对乔布斯演讲的拆解,学习,模仿。每一次的公开演讲,都是一堂案例级的营销课程,值得每一位有志于从事营销相关的朋友分析研究。<br />
下面,我们将从"故事"、"现场"、"准备"三个方面分析学习老罗的演讲技巧,教你如何打造一场"罗永浩式"的演讲。 </div>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><a href="javascript:void(0);" class="postOptionLink">设为首页</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">编辑文章</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">删除文章</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="cl"></div>
</div>
<div class="homepagePostReply">
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复2</div>
<!--<div class="homepagePostReplyBannerTime">2015-07-31</div>-->
<!--<div class="homepagePostReplyBannerMore"><a href="javascript:void(0);" class="replyGrey">点击展开更多回复</a></div>-->
</div>
<div class="homepagePostReplyContainer">
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="33" height="33" alt="用户头像" /></a></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">黄井泉 学生</a> 2015-11-03 12:26</div>
<div class="homepagePostReplyContent">学习下!</div>
</div>
<div class="cl"></div>
</div>
<div class="homepagePostReplyContainer">
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="33" height="33" alt="用户头像" /></a></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">陈正东 学生</a> 2015-11-02 17:08</div>
<div class="homepagePostReplyContent">锤子手机,卖的就是情怀</div>
</div>
<div class="cl"></div>
</div>
<div class="homepagePostReplyContainer">
<div class="homepagePostReplyPortrait mr15"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="33" height="33" alt="用户头像" /></a></div>
<div class="homepagePostReplyInputContainer">
<textarea class="homepagePostReplyInput fl mr15" placeholder="请输入回复"></textarea>
<a href="javascript:void(0);" class="homepagePostReplyEmotion mt5"></a> <a href="javascript:void(0);" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a> </div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
<div class="resources mt10">
<div class="homepagePostBrief">
<div class="homepagePostPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像" /></a></div>
<div class="homepagePostDes">
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr10">唐湘政</a> 创建了 <a href="javascript:void(0);" class="newsBlue ml10">micROS研究团队
| 组织</a></div>
<div class="homepagePostTitle"><a href="javascript:void(0);" class="postGrey">micROS研究团队 </a></div>
<div class="homepagePostDate"> 创建时间2015-10-29 11:23 </div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
<div id="RSide" class="fl">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
<!--页面底部-->
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
</body>
</html>

View File

@ -0,0 +1,4 @@
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<div class="project_r_h">
<h2 class="project_h2">组织活动</h2>
</div>