diff --git a/Client.html b/Client.html new file mode 100644 index 000000000..5ba9775f1 --- /dev/null +++ b/Client.html @@ -0,0 +1,25 @@ + + + + +Client + + + + +
+

这是一张图片

+

photo Share A

+
+ +

这是一段视频

+

Text Share B

+
+ +

这是一篇文章

+

Text Share C

+
+ + + + \ No newline at end of file diff --git a/app/assets/javascripts/shares.js b/app/assets/javascripts/shares.js new file mode 100644 index 000000000..dee720fac --- /dev/null +++ b/app/assets/javascripts/shares.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/scaffold.css b/app/assets/stylesheets/scaffold.css new file mode 100644 index 000000000..1ae700029 --- /dev/null +++ b/app/assets/stylesheets/scaffold.css @@ -0,0 +1,56 @@ +body { background-color: #fff; color: #333; } + +body, p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { color: #000; } +a:visited { color: #666; } +a:hover { color: #fff; background-color:#000; } + +div.field, div.actions { + margin-bottom: 10px; +} + +#notice { + color: green; +} + +.field_with_errors { + padding: 2px; + background-color: red; + display: table; +} + +#error_explanation { + width: 450px; + border: 2px solid red; + padding: 7px; + padding-bottom: 0; + margin-bottom: 20px; + background-color: #f0f0f0; +} + +#error_explanation h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + margin-bottom: 0px; + background-color: #c00; + color: #fff; +} + +#error_explanation ul li { + font-size: 12px; + list-style: square; +} diff --git a/app/assets/stylesheets/shares.css b/app/assets/stylesheets/shares.css new file mode 100644 index 000000000..afad32db0 --- /dev/null +++ b/app/assets/stylesheets/shares.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb new file mode 100644 index 000000000..9a76d26b8 --- /dev/null +++ b/app/controllers/shares_controller.rb @@ -0,0 +1,92 @@ +class SharesController < ApplicationController + # GET /shares + # GET /shares.json + def index + @shares = Share.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @shares } + end + end + + # GET /shares/1 + # GET /shares/1.json + def show + @share = Share.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @share } + end + end + + # GET /shares/new + # GET /shares/new.json + def new + @share = Share.new + + #add by mkz 鎶撳彇鍙傛暟浼犵粰share + @share[:access_token] = params[:access_token] + @share[:comment] = params[:comment] + @share[:title] = params[:title] + @share[:url] = params[:url] + @share[:share_type] = params[:share_type] + @share.save + # + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @share } + end + end + + # GET /shares/1/edit + def edit + @share = Share.find(params[:id]) + end + + # POST /shares + # POST /shares.json + def create + @share = Share.new(params[:share]) + + respond_to do |format| + if @share.save + format.html { redirect_to @share, notice: 'Share was successfully created.' } + format.json { render json: @share, status: :created, location: @share } + else + format.html { render action: "new" } + format.json { render json: @share.errors, status: :unprocessable_entity } + end + end + end + + # PUT /shares/1 + # PUT /shares/1.json + def update + @share = Share.find(params[:id]) + + respond_to do |format| + if @share.update_attributes(params[:share]) + format.html { redirect_to @share, notice: 'Share was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @share.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /shares/1 + # DELETE /shares/1.json + def destroy + @share = Share.find(params[:id]) + @share.destroy + + respond_to do |format| + format.html { redirect_to shares_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 319608718..18d3e9abf 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,7 +17,7 @@ class UsersController < ApplicationController layout 'base_users' - before_filter :require_admin, :except => [:show, :index,:tag_save] + before_filter :require_admin, :except => [:show, :index,:tag_save, :user_projects, :user_newfeedback, :user_comments] before_filter :find_user, :only => [:show, :edit, :update, :destroy, :edit_membership, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments] accept_api_auth :index, :show, :create, :update, :destroy diff --git a/app/helpers/shares_helper.rb b/app/helpers/shares_helper.rb new file mode 100644 index 000000000..e51aa8b87 --- /dev/null +++ b/app/helpers/shares_helper.rb @@ -0,0 +1,2 @@ +module SharesHelper +end diff --git a/app/models/share.rb b/app/models/share.rb new file mode 100644 index 000000000..f597ae790 --- /dev/null +++ b/app/models/share.rb @@ -0,0 +1,3 @@ +class Share < ActiveRecord::Base + attr_accessible :access_token, :comment, :share_type, :title, :url +end diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index f323e3783..ab14360f2 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -78,6 +78,7 @@
  • "> <% column_content = ( query.inline_columns.map {|column| "
  • #{column_content(column, issue)}
  • "}) %> + <%= image_tag("/images/issues.png", :class => "img-tag-issues") %>