commit
aaa8a4b94d
@ -0,0 +1,25 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>
|
||||
Client
|
||||
</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<hr />
|
||||
<h2>这是一张图片</h2>
|
||||
<p>photo<a href="http://10.0.47.15:3000/shares/new?access_token='2d3dda45dsd'&comment='verygood'&title=davide&share_type=1&url=http://www.baidu.com"> Share A </a></p>
|
||||
<hr />
|
||||
|
||||
<h2>这是一段视频</h2>
|
||||
<p>Text<a href="http://10.0.47.15:3000/shares/new?access_token=2d3dda45dsd&comment=verygood&title=kaka&share_type=2&url=http://www.sina.com"> Share B </a></p>
|
||||
<hr />
|
||||
|
||||
<h2>这是一篇文章</h2>
|
||||
<p>Text<a href="http://10.0.47.15:3000/shares/new?access_token=2d3dda45dsd&comment=verygood&title=pepe&share_type=3&url=http://www.sina.com"> Share C </a></p>
|
||||
<hr />
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -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.
|
@ -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;
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Place all the styles related to the matching controller here.
|
||||
They will automatically be included in application.css.
|
||||
*/
|
@ -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
|
@ -0,0 +1,2 @@
|
||||
module SharesHelper
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
class Share < ActiveRecord::Base
|
||||
attr_accessible :access_token, :comment, :share_type, :title, :url
|
||||
end
|
@ -1,13 +1,14 @@
|
||||
<%= form_tag({:controller => 'bids',
|
||||
|
||||
<%= form_for('user_message', :remote => true, :method => :post,
|
||||
:url => {:controller => 'bids',
|
||||
:action => 'create',
|
||||
:bid_id => bid,
|
||||
:sta => sta},
|
||||
:remote => true,
|
||||
:method => :post) do %>
|
||||
|
||||
<p><%= label_tag 'user_message', l(:label_leave_message) %><%= text_area_tag 'user_message', nil %></p>
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_leave_meassge), :name => nil %>
|
||||
<%= submit_tag l(:button_clear), :name => nil, :onclick => "clearMessage('user_message');", :type => 'button' %>
|
||||
</p>
|
||||
:sta => sta}) do |f|%>
|
||||
<table border="0" width="500px" align="center">
|
||||
<tr>
|
||||
<td><%= f.text_area 'message', :rows => 4, :cols => 65, :value => "我要反馈", :required => true, :style => "resize: none;" %></td>
|
||||
</tr>
|
||||
<tr><td align="right"><%= submit_tag l(:button_leave_meassge), :name => nil %>
|
||||
<%= submit_tag l(:button_clear), :name => nil, :onclick => "clearMessage('user_message_message');", :type => 'button' %></td></tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
@ -1,4 +1,4 @@
|
||||
$('#bidding_project_list').html('<%= escape_javascript(render(:partial => 'project_list', :locals => {:bidding_project => @bidding_project})) %>');
|
||||
$("#project_id").val("请选择项目");
|
||||
$("#project_id").val("请输入应标理由");
|
||||
$("#bid_message").val("请输入应标理由");
|
||||
$("#put-bid-form").hide();
|
@ -1,2 +1,2 @@
|
||||
$('#history').html('<%= escape_javascript(render(:partial => 'history', :locals => {:bid => @bid, :journals => @jour, :state => true})) %>');
|
||||
$('#user_message').val("");
|
||||
$('#history').html('<%= escape_javascript(render(:partial => 'bids/history', :locals => {:bid => @bid, :journals => @jour, :state => true})) %>');
|
||||
$('#user_message_message').val("");
|
||||
|
@ -1,2 +1,2 @@
|
||||
$('#user_message').val("<%= raw escape_javascript(@content) %>");
|
||||
$('#user_message_message').val("<%= raw escape_javascript(@content) %>");
|
||||
showAndScrollTo("user_message", "user_message");
|
||||
|
@ -1,32 +1,29 @@
|
||||
</br>
|
||||
</br>
|
||||
<div class='icon icon-add'>
|
||||
<%= toggle_link "我要应标", 'put-bid-form', {:focus => 'project_id'} %>
|
||||
<div class="contextual">
|
||||
<div class='icon icon-add' style="margin-right: 30px;">
|
||||
<%= toggle_link "我要应标", 'put-bid-form', {:focus => 'project_id'} %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="put-bid-form" style="display: none">
|
||||
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add'},
|
||||
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add'},
|
||||
:update => "bidding_project_list",
|
||||
:complete => '$("#put-bid-form").hide();' do |f| %>
|
||||
|
||||
<table id="bidding_table" border="1">
|
||||
<table id="bidding_table" border="0" align='center' width="500">
|
||||
<tr>
|
||||
<td><%= f.text_field :project_id, :id => "project_id", :required => true, :size => 55, :value => "请选择项目"%></td>
|
||||
<td><%= select_tag 'bid', options_for_select(@option), :name => 'bid' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 3, :cols => 50, :value => "请输入应标理由"%></td>
|
||||
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :value => "请输入应标理由", :style => "resize: none;"%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.submit "add"%><%= link_to_function l(:button_cancel), '$("#put-bid-form").hide();'%></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h3>应标项目列表</h3>
|
||||
<ul>
|
||||
<div id='bidding_project_list'>
|
||||
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<table width="200px" border="0" style="padding-left: 15px">
|
||||
<td class="font_lighter" style="font-size: 18px;">应标项目(<%= @bidding_project.count%>)</td>
|
||||
</table>
|
||||
<div id='bidding_project_list'>
|
||||
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %>
|
||||
</div>
|
||||
|
@ -0,0 +1,37 @@
|
||||
<%= form_for(@share) do |f| %>
|
||||
<% if @share.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@share.errors.count, "error") %> prohibited this share from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @share.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :access_token %><br />
|
||||
<%= f.text_field :access_token %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :comment %><br />
|
||||
<%= f.text_field :comment %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :url %><br />
|
||||
<%= f.text_field :url %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :title %><br />
|
||||
<%= f.text_field :title %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :share_type %><br />
|
||||
<%= f.number_field :share_type %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
@ -0,0 +1,6 @@
|
||||
<h1>Editing share</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @share %> |
|
||||
<%= link_to 'Back', shares_path %>
|
@ -0,0 +1,31 @@
|
||||
<h1>Listing shares</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Access token</th>
|
||||
<th>Comment</th>
|
||||
<th>Url</th>
|
||||
<th>Title</th>
|
||||
<th>Share type</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @shares.each do |share| %>
|
||||
<tr>
|
||||
<td><%= share.access_token %></td>
|
||||
<td><%= share.comment %></td>
|
||||
<td><%= share.url %></td>
|
||||
<td><%= share.title %></td>
|
||||
<td><%= share.share_type %></td>
|
||||
<td><%= link_to 'Show', share %></td>
|
||||
<td><%= link_to 'Edit', edit_share_path(share) %></td>
|
||||
<td><%= link_to 'Destroy', share, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Share', new_share_path %>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue