Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list templates by name, include screen count #1435

Merged
merged 1 commit into from May 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/template.rb
Expand Up @@ -19,6 +19,8 @@ class Template < ActiveRecord::Base
# Validations
validates :name, presence: true, uniqueness: true

default_scope { order('templates.name asc') }

#Placeholder attributes
attr_accessor :path, :css_path

Expand Down
5 changes: 4 additions & 1 deletion app/views/templates/_template.html.erb
Expand Up @@ -7,5 +7,8 @@
<div class="cont">
<p><b><%= link_to template.name, template %></b></p>
<p><%= t '.by', author: template.author %></p>
<% if template.screens.count > 0 %>
<p><%= t('.screens', count: template.screens.count) %></p>
<% end %>
</div>
</li>
</li>
9 changes: 6 additions & 3 deletions config/locales/en.yml
Expand Up @@ -806,7 +806,7 @@ en:
import_the_model: imported the %{model}
membership:
article: the
approve:
approve:
approved_member_of_group: '%{owner} approved %{member} in the %{group} group as a %{role}'
leader: leader
regular_member: regular member
Expand All @@ -815,13 +815,13 @@ en:
leader: leader
regular_member: regular member
pending_regular_member: pending regular member
demote:
demote:
leader: leader
regular_member: regular member
demoted_member_of_group: '%{owner} demoted %{member} in the %{group} group to a %{role}'
update:
updated_member_of_group: '%{owner} %{action} %{member} in the %{group} group'
promote:
promote:
leader: leader
regular_member: regular member
promoted_member_of_group: '%{owner} promoted %{member} in the %{group} group to a %{role}'
Expand Down Expand Up @@ -1043,6 +1043,9 @@ en:
edit_template: Edit Template
template:
by: by %{author}
screens:
one: 1 Screen
other: '%{count} Screens'
time:
formats:
date: '%D'
Expand Down