From 3f289dcd74ead27f1afbcb0593e0416d5dedf654 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 3 Nov 2015 17:21:32 +0800 Subject: [PATCH] =?UTF-8?q?org=E5=BC=80=E5=8F=91=E9=83=A8=E5=88=86?= =?UTF-8?q?=EF=BC=88=E6=9C=AA=E5=AE=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organization_controller.rb | 55 ------- app/controllers/organizations_controller.rb | 12 ++ app/views/layouts/base_org.html.erb | 157 ++++++++++++++++++++ app/views/organizations/show.html.erb | 4 + 4 files changed, 173 insertions(+), 55 deletions(-) delete mode 100644 app/controllers/organization_controller.rb create mode 100644 app/views/layouts/base_org.html.erb create mode 100644 app/views/organizations/show.html.erb diff --git a/app/controllers/organization_controller.rb b/app/controllers/organization_controller.rb deleted file mode 100644 index 748fc1732..000000000 --- a/app/controllers/organization_controller.rb +++ /dev/null @@ -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 diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 1d0edbd7e..0def8b5f8 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -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 diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb new file mode 100644 index 000000000..a3829ea3b --- /dev/null +++ b/app/views/layouts/base_org.html.erb @@ -0,0 +1,157 @@ +<% @nav_dispaly_project_label = 1 + @nav_dispaly_forum_label = 1 %> +<%#@nav_dispaly_project_label = 1 %> + + + + + <%= h html_title %> + + + <%= 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 %> + + <%= yield :header_tags -%> + + + + + + +
+ <% @organization = Organization.find(params[:id])%> +
+
+
+
+ +
组织id:<%= @organization.id %>
+ 配置 +
+
文章 ( 3 ) | 成员 ( 10 )
+
+ +
+
+
+
最新动态
+ +
+
+
+
用户头像
+
+ + +
发帖时间:2015-11-02 11:25
+
罗永浩已经把他的主题演讲成功变成了一次次的重大的媒体事件,这让科技界和营销界的从业者们羡慕不已。事实上,老罗不仅从乔布斯那里继承了乔式审美,设计哲学,同时也继承了乔布斯的演讲艺术。乔布斯是人类历史上最伟大的演讲者。在一次又一次的"罗氏演讲"中,我们可以清晰看到老罗对乔布斯演讲的拆解,学习,模仿。每一次的公开演讲,都是一堂案例级的营销课程,值得每一位有志于从事营销相关的朋友分析研究。
+ 下面,我们将从"故事"、"现场"、"准备"三个方面分析学习老罗的演讲技巧,教你如何打造一场"罗永浩式"的演讲。
+
+ +
+
+
+
+
+
+
回复(2)
+ + +
+
+
用户头像
+
+
黄井泉 学生 2015-11-03 12:26
+
学习下!
+
+
+
+
+
用户头像
+
+
陈正东 学生 2015-11-02 17:08
+
锤子手机,卖的就是情怀
+
+
+
+
+
用户头像
+
+ + 发送
+
+
+
+
+
+
+
+
用户头像
+
+ + +
创建时间:2015-10-29 11:23
+
+
+
+
+
+
+
+ +
+ <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+
+ + +
+ <%= render :partial => 'layouts/footer' %> +
+ + + diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb new file mode 100644 index 000000000..9d38aedc1 --- /dev/null +++ b/app/views/organizations/show.html.erb @@ -0,0 +1,4 @@ +<%= javascript_include_tag "jquery.infinitescroll.js" %> +
+

组织活动

+
\ No newline at end of file