Adding wysiwyg and settings

This commit is contained in:
2013-09-28 04:59:19 -07:00
parent f03ffcd356
commit 2c204a8f9d
171 changed files with 26473 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
<h1>Welcome to the HeatSync Labs Members App.</h1>
<h1><%= Setting.welcome_title %></h1>
<% if !user_signed_in? then %>
<p>You can sign up to become a member here!</p>
<%= simple_format Setting.welcome_body %>
<% end %>
@@ -45,27 +45,7 @@
<td>
<h2>Member Resources</h2>
<ul>
<li><%= link_to "Wiki", "http://wiki.heatsynclabs.org" %></li>
<li><%= link_to "Discussion Group", "http://groups.google.com/group/heatsynclabs" %></li>
<li><%= link_to "IRC", "irc://irc.freenode.net#heatsynclabs" %></li>
<li><%= link_to "Live Webcams", "http://live.heatsynclabs.org/" %></li>
<li>Lab Phone: (480) 751-1929</li>
<li>
<style type="text/css">
form input {font-family: 'Lucida Console', Monaco, monospace; }
</style>
<b>Send a Message!</b>
<form method="post" action="http://tweet.zyphon.com/signage.php">
<em>Type here and your message will show up on the LED sign in the front window!</em><br/>
<em>(Please be nice!)</em><br/>
<input type="text" name="msg" id="msg" value=" Hello" size="9" /> (max 9 chars per line)<br/>
<input type="text" name="msg2" id="msg2" value=" World" size="9" /><br/>
<input type="submit" name="submitbutton" id="submitbutton" value="Go!" />
</form>
</li>
</ul>
<%= simple_format Setting.member_resources_inset %>
</td>
</tr>

View File

@@ -0,0 +1,2 @@
<h1>More Information</h1>
<%= simple_format Setting.more_info_page %>

View File

@@ -18,7 +18,7 @@
<%= link_to 'Certifications', certifications_path if can? :read, Certification %>
<% end %>
<%= link_to 'Payments', payments_path if can? :read, Payment %>
<%= link_to 'Computers', macs_path if user_signed_in? && (can? :read, Mac) %>
<%= link_to 'Computers', macs_path if user_signed_in? || (can? :read, Mac) %>
<% if user_signed_in? then %><%= link_to 'Profile', edit_user_registration_path %><% end %>
<%= link_to 'Logout', destroy_user_session_path, :method => :delete if user_signed_in? %>
<%= link_to 'Login', new_user_session_path unless user_signed_in? %>

View File

@@ -1,3 +1,4 @@
<% if @mac_time_start_date.present? %>
<b>Most Active Machine Last <%= distance_of_time_in_words DateTime.now, @mac_time_start_date %>:</b>
<span title="<%= @most_active_mac.mac %><%= " - "+@most_active_mac.ip.to_s if can? :read_details, @most_active_mac %>">
<%= @most_active_mac.user.name unless @most_active_mac.user.blank? %>
@@ -11,6 +12,7 @@
<%= "("+@runner_up_mac.note+")" unless @runner_up_mac.note.blank? %>
- <%= (@runner_up.last[:time] / 1.hour).round %> hrs
</span>
<% end %>
<h2>What machines are on our network?</h2>
<%= link_to "New MAC registration", new_mac_path if can? :create, Mac %>

View 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 %>

View 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>