Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:yzhang/Confforge
Browse files Browse the repository at this point in the history
  • Loading branch information
wear committed Sep 10, 2010
2 parents eea7872 + cfb8ca3 commit f85ee4f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
8 changes: 5 additions & 3 deletions app/controllers/rows_controller.rb
Expand Up @@ -95,12 +95,14 @@ def create
@fields = @form.find_fields_by_page(@page)
@keys = @fields.map{|f| "f#{f.id}".to_sym}
session[:row] ||= {}
@row = klass.new(params[:row].merge(session[:row]))
session[:row] = params[:row]
@row = klass.new(session[:row].merge(params[:row]))
@row.valid?
errors = @row.errors.select {|k, v| @keys.include?(k) }
@result = errors.empty?
@row.save if @page == @form.total_page && @result
if @page == @form.total_page && @result
@row.save
session[:row] = nil
end
end

respond_to do |want|
Expand Down
4 changes: 3 additions & 1 deletion app/views/fields/_field.html.erb
Expand Up @@ -12,7 +12,7 @@
<%= t(:reserved) %>
<% end -%>
</div>

<div class="question" ondblclick="field_start_editing(this);">
<%= render :partial => "/forms/#{field.input}_field", :locals => {:field => field, :row => @row} %>
</div>
Expand All @@ -21,3 +21,5 @@
<%= render :partial => "/fields/form", :locals => {:parent => parent, :field => field, :row => @row} %>
</div>
</div>
<div style="clear:both"></div>

4 changes: 2 additions & 2 deletions app/views/forms/_page_field.html.erb
@@ -1,3 +1,3 @@
<div style="height:10px;"></div>
<div style="height:10px;margin:0;"></div>
<div style="width:100%; margin: 10px 0; background:#EFEFEF; height: 20px; border-top:2px solid #E1E8F0; border-bottom:2px solid #E1E8F0;"></div>
<div style="height:10px;text-align:center;"></div>
<div style="height:10px;margin:0;"></div>
5 changes: 3 additions & 2 deletions config/locales/en.yml
Expand Up @@ -147,12 +147,13 @@ en:
meta: "ThunderSurvey is the simplest free online survey solution, if you perfer to clean and simple survey design, then thundersurvey should be your first choice."
blog: 'Blog'
open_source: "Open Source"
site_title: "ThunderSurvey"
site_title: "抢答"
referrer: "Referrer"
location: "Location"
total: "Total"
count: "Count"
city: "City"
must_be_unique: "Must be unique"
setting: "Setting"
locale: "Locale"
locale: "Locale"
page_break: "Page Break"
3 changes: 1 addition & 2 deletions public/stylesheets/simple.css
Expand Up @@ -147,7 +147,7 @@ input.inputFocus {
color:#0099FF;
}

.field_form { padding: 10px; margin-top: 10px;}
.field_form { padding: 20px; margin-top: 10px;}

div.field {
padding: 20px;
Expand All @@ -163,7 +163,6 @@ div.field {

.opration{
float:right;
margin: 15px 10px;
}

.placeholder{
Expand Down

0 comments on commit f85ee4f

Please sign in to comment.