source = find_filter(params[:id])
target = MeasureFilter.new
- target.name = params[:name]
- target.description = params[:description]
- target.user_id = current_user.id
- target.shared = source.shared
- target.data = source.data
- target.shared = false
+ target.name=params[:name]
+ target.description=params[:description]
+ target.user_id=current_user.id
+ target.shared=(params[:shared]=='true')
+ target.data=source.data
if target.save
current_user.favourited_measure_filters << target
render :text => target.id.to_s, :status => 200
<input type="text" size="50" maxlength="100" value="<%= h @filter.name -%>" disabled="disabled"/>
</div>
<div class="form-field">
- <label for="name">Name <em class="mandatory">*</em></label>
+ <label for="name"><%= h message('name') -%> <em class="mandatory">*</em></label>
<input id="name" name="name" type="text" size="50" maxlength="100" value=""/>
</div>
<div class="form-field">
- <label for="description">Description</label>
+ <label for="description"><%= h message('description') -%></label>
<input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= h @filter.description -%>"/>
</div>
+ <div class="form-field">
+ <label for="shared"><%= h message('measure_filter.shared_with_all_users') -%></label>
+ <input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if @filter.shared -%>/>
+ </div>
</div>
<div class="form-foot">
<input type="submit" value="<%= h message('copy') -%>" id="copy-submit"/>
<p class="error"><%= h msg -%></p>
<% end %>
<div class="form-field">
- <label for="name">Name <em class="mandatory">*</em></label>
+ <label for="name"><%= h message('name') -%> <em class="mandatory">*</em></label>
<input id="name" name="name" type="text" size="50" maxlength="100" value="<%= h @filter.name -%>"/>
</div>
<div class="form-field">
- <label for="description">Description</label>
+ <label for="description"><%= h message('description') -%></label>
<input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= h @filter.description -%>"/>
</div>
<div class="form-field">
- <label for="shared">Shared with all users</label>
+ <label for="shared"><%= h message('measure_filter.shared_with_all_users') -%></label>
<input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if @filter.shared -%>/>
</div>
</div>
<% end %>
<% unless @filter.id %>
<li>
- <a id="save_as" href="<%= url_for params.merge({:action => 'save_as_form', :id => @filter.id}) -%>" class="link-action open-modal"><%= message('save_as') -%></a>
+ <a id="save-as" href="<%= url_for params.merge({:action => 'save_as_form', :id => @filter.id}) -%>" class="link-action open-modal"><%= message('save_as') -%></a>
</li>
<% end %>
<% end %>