Adding wysiwyg and settings
This commit is contained in:
18
app/views/settings/edit.html.erb
Normal file
18
app/views/settings/edit.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<script type="text/javascript" src="/wymeditor/wymeditor/jquery.wymeditor.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.wysiwyg').wymeditor();
|
||||
});
|
||||
</script>
|
||||
<%= form_tag(setting_path(@setting[:var]), :method => :put) do %>
|
||||
<h3>Editing <%= @setting[:var].titleize %></h3>
|
||||
<div class="field">
|
||||
<%= text_area_tag :value, @setting[:value], :cols => 50, :class => "wysiwyg" %><br/>
|
||||
<em>Use %{provider_name} or %{client_name} to include names in messages.</em>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= submit_tag "Save", {:class => "wymupdate"} %><br/>
|
||||
<%= link_to "Back", settings_path %>
|
||||
</div>
|
||||
<% end %>
|
||||
16
app/views/settings/index.html.erb
Normal file
16
app/views/settings/index.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<h2>Site-Wide Settings</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
<% @settings.each do |setting| %>
|
||||
<tr>
|
||||
<td><%= setting.first.titleize %></td>
|
||||
<td>"<%= setting.last %>"</td>
|
||||
<% if can? :update, setting %>
|
||||
<td><%= link_to 'Edit', edit_setting_path(setting.first) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
Reference in New Issue
Block a user