Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds group functionality and variety of other changes
- Loading branch information
Showing
19 changed files
with
240 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
} | ||
|
||
.document_show { | ||
margin-left: 300px; | ||
position: relative; | ||
text-align: center; | ||
} |
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
<% @featured.each do |cat, docs| %> | ||
<div class="featured_category"> | ||
<ol class="breadcrumb featured_category_title"> | ||
<li><%= Category.find_by_id(cat).name %></li> | ||
</ol> | ||
<div class="categories_grid"> | ||
<% docs.each do |doc| %> | ||
<%= render partial: "documents/document_list_item", locals: {doc: doc} %> | ||
<% end %> | ||
<!-- Limit the number of featured categories to 3 | ||
and only show categories with documents available --> | ||
<% total_featured = 0 %> | ||
<% if docs.length > 0 or total_featured > 2 %> | ||
<% total_featured += 1 %> | ||
<div class="featured_category"> | ||
<ol class="breadcrumb featured_category_title"> | ||
<li><%= Category.find_by_id(cat).name %></li> | ||
</ol> | ||
<div class="categories_grid"> | ||
<% docs.each do |doc| %> | ||
<%= render partial: "documents/document_list_item", locals: {doc: doc} %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if !@category.nil? and @category.parent %> | ||
<%= link_to "<< prev", @category.parent, :class => "prev_category" %> | ||
<% elsif !@category.nil? %> | ||
<%= link_to "<< prev", categories_path, :class => "prev_category" %> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="panel panel-default"> | ||
<ol class="breadcrumb"> | ||
<li><%= link_to "Home", categories_path %></li> | ||
<li><%= link_to "Categories Index", manage_categories_path %></li> | ||
<li class="active"> <%= "Editing #{@category.name}" %></li> | ||
</ol> | ||
|
||
<div class="panel-body"> | ||
<%= form_for @category do |f| %> | ||
<% end %> | ||
</div> | ||
</div> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<div class="panel panel-default"> | ||
<ol class="breadcrumb"> | ||
<li><%= link_to "Home", categories_path %></li> | ||
<li class="active">Manage Categories</li> | ||
</ol> | ||
|
||
<div class="panel-body"> | ||
<table class="table"> | ||
<tr> | ||
<th> Category name </th> | ||
<th> Group </th> | ||
<th> Parent </th> | ||
<th> Featured? </th> | ||
<th> Private? </th> | ||
<th> Actions </th> | ||
</tr> | ||
<% @categories.each do |cat| %> | ||
<tr> | ||
<td> <%= cat.name %> </td> | ||
<td> </td> | ||
<td> | ||
<% if cat.parent %> | ||
<%= link_to cat.parent.name, cat.parent %> | ||
<% else %> | ||
None | ||
<% end %> | ||
</td> | ||
<td> <%= cat.is_featured? ? "yes" : "no" %> </td> | ||
<td> <%= cat.is_private? ? "yes" : "no" %> </td> | ||
<td> <%= link_to "Edit", edit_category_path(cat), :class => "btn btn-primary btn-xs" %> | ||
<%= link_to "Delete", category_path(cat), method: :delete, :class => "btn btn-primary btn-xs" %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> | ||
</div> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div class="panel panel-default"> | ||
<ol class="breadcrumb"> | ||
<li><%= link_to "Home", categories_path %></li> | ||
<li><%= link_to "Groups Index", groups_path %></li> | ||
<li class="active"> <%= "Editing #{@group.name}" %></li> | ||
</ol> | ||
|
||
<div class="panel-body"> | ||
<div class="col-md-8"> | ||
<div class="row"> | ||
<%= form_for @group do |f| %> | ||
<%= f.label :name %> | ||
<%= f.text_field :name, :class => "form-control", placeholder: @group.name %> | ||
<br /> | ||
<%= f.submit "submit", :class => "btn btn-default btn-xs" %> | ||
<% end %> | ||
|
||
<h3> Group Leaders </h3> | ||
<%= @group.leader_names %> | ||
<hr /> | ||
|
||
<%= form_for :membership, url: add_member_group_path(group_id: params[:id]) do |l| %> | ||
<%= l.label :add_leader %> | ||
<%= l.select :user_id, User.all.collect { |u| [u.username, u.id] }, {include_blank: true} %> | ||
<%= l.hidden_field :level, value: Membership::LEVELS[:leader] %> | ||
<%= l.submit "add", :class => "btn btn-default btn-xs" %> | ||
<% end %> | ||
<hr /> | ||
|
||
<h3> Group Members </h3> | ||
<%= @group.member_names %> | ||
<hr /> | ||
|
||
<%= form_for :membership, url: add_member_group_path(group_id: params[:id]) do |m| %> | ||
<%= m.label :add_member %> | ||
<%= m.select :user_id, User.all.collect { |u| [u.username, u.id]}, {include_blank: true} %> | ||
<%= m.hidden_field :level, value: Membership::LEVELS[:regular] %> | ||
<%= m.submit "add", :class => "btn btn-default btn-xs" %> | ||
<% end %> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> |
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
Oops, something went wrong.