forked from harley/newstc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git@github.com:Smudge/newstc
- Loading branch information
Showing
13 changed files
with
64 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,16 +1,20 @@ | |||
module NoticesHelper | module NoticesHelper | ||
def show_notice_archive |
|
||
if params[:show_inactive].nil? | def locations_check(location) | ||
link_to "Show Inactive Notices", :show_inactive => true | @notice.departments.locations.include?(location) or current_user.current_shift.location == location or @notice.locations.include?(location) or loc_group.locations.include?(location) | ||
end | |||
|
|||
def loc_group_check(loc_group) | |||
if @notice.departments.empty? | |||
@notice.loc_groups.include?(loc_group) | |||
else | else | ||
link_to "Hide Inactive Notices", notices_path | @notice.departments.loc_groups.include?(loc_group) | ||
unless Notice.inactive.empty? | |||
concat('<fieldset class ="index">') | |||
concat('<legend>Inactive Notices</legend>') | |||
render(:partial => 'notice', :collection => Notice.inactive) | |||
concat("<fieldset>") | |||
end | |||
end | end | ||
end | end | ||
|
|||
def dept_check | |||
@notice.departments.include?(current_department) | |||
end | |||
|
|||
end | end | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,28 +1,38 @@ | |||
<% stylesheet 'thickbox' %> | <% stylesheet 'thickbox' %> | ||
<% javascript 'jrails', 'jquery', 'jquery-ui', 'thickbox-compressed' %> | <% javascript 'jrails', 'jquery', 'jquery-ui', 'thickbox-compressed' %> | ||
|
|
||
<h1 id="page_title"><%=h "Notices - " %><font size = -2><%= link_to 'Post a new notice', new_notice_path, :class => "thickbox" %></font></h1> | <h1 id="page_title"> | ||
|
Notices - | ||
<font size = -2> | |||
<%= link_to 'Post a new notice', {:action => 'new', :TB_iframe => true}, :class => "thickbox" %> | |||
</font> | |||
</h1> | |||
<div id = "for_you"> | |||
<% unless current_user.notices.empty? %> | <% unless current_user.notices.empty? %> | ||
<fieldset class ="index"> | <fieldset class ="index"> | ||
<legend>For you</legend> | <legend>For you</legend> | ||
<%= render :partial => 'for_you' %> | <%= render :partial => 'for_you' %> | ||
</fieldset> | </fieldset> | ||
<br /> | <br /> | ||
<% end %> | <% end %> | ||
</div> | |||
<div id = "location_notices"> | |||
<% @department.locations.each do |loc| %> | <% current_department.locations.each do |loc| %> | ||
<% unless loc.notices.empty? %> | <% unless loc.find_notices.empty? %> | ||
<fieldset class ="index"> | <fieldset class ="index"> | ||
<legend><%= loc.name %></legend> | <legend><%= loc.name %></legend> | ||
<%= render :partial => 'notice', :collection => loc.notices %> | <%= render :partial => 'notice', :collection => loc.find_notices%> | ||
</fieldset> | </fieldset> | ||
<br/> | <br/> | ||
<% end %> | <% end %> | ||
<% end %> | <% end %> | ||
</div> | |||
|
|
||
<% if current_user.is_admin_of?(@department) %> | <% if current_user.is_admin_of?(@department) %> | ||
<%= link_to 'Notice archive', 'notices/archive' %> | <%= link_to 'Notice archive', 'notices/archive' %> | ||
<% end %> | <% end %> | ||
<script type="text/javascript" charset="utf-8"> | |||
page.replace_html("for_you", :partial => "for_you" ); | |||
page.replace_html("location_notices", :partial => "notice", :collection => "loc.notices" ); | |||
</script> | |||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters