1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

[feature] display 'draft' badge on drafts

This commit is contained in:
Sylvain 2016-06-01 10:47:00 +02:00
parent 31356a02f5
commit 306e0322c5
5 changed files with 10 additions and 3 deletions

View File

@ -12,7 +12,9 @@
<div class="wrapper" ng-if="user.all_projects.length == 0" translate>{{ 'you_dont_have_any_projects' }}</div>
<div class="widget panel b-a m m-t-lg" ng-repeat="project in user.all_projects">
<div class="panel-heading b-b clearfix">
<h4 class="text-u-c font-sbold pull-left">{{project.name}}</h4> <span class="m-l-sm label label-success text-white">{{project.author_id == currentUser.id ? 'author' : 'collaborator' | translate}}</span>
<h4 class="text-u-c font-sbold pull-left">{{project.name}}</h4>
<span class="m-l-sm label label-success text-white">{{project.author_id == currentUser.id ? 'author' : 'collaborator' | translate}}</span>
<span class="badge" ng-if="project.state == 'draft'" translate>{{ 'rough_draft' }}</span>
<div class="pull-right">
<a class="btn btn-warning bg-white b-2x rounded upper text-sm text-black" ui-sref="app.public.projects_show({id:project.slug})" role="button" translate>{{ 'consult' }}</a>
</div>

View File

@ -98,6 +98,10 @@
<h1 class="card-title">{{project.name}}</h1>
</div>
<div class="text-center">
<span class="badge" ng-if="project.state == 'draft'" translate>{{ 'rough_draft' }}</span>
</div>
<div class="card-overlay">
<div class="btn-group">
<div class="btn btn-default" ng-click="showProject(project)">

View File

@ -103,6 +103,7 @@
<div class="text-center">
<span class="m-l-sm label label-success text-white">{{project.author_id == user.id ? 'author' : 'collaborator' | translate}}</span>
<span class="badge" ng-if="project.state == 'draft'" translate>{{ 'rough_draft' }}</span>
</div>
<div class="card-overlay">

View File

@ -65,7 +65,7 @@ end
json.last_sign_in_at @member.last_sign_in_at.iso8601 if @member.last_sign_in_at
json.all_projects @member.all_projects do |project|
if requested_current || project.state == 'published'
json.extract! project, :id, :name, :description, :author_id, :licence_id, :slug
json.extract! project, :id, :name, :description, :author_id, :licence_id, :slug, :state
json.url project_url(project, format: :json)
json.project_image project.project_image.attachment.large.url if project.project_image
json.machine_ids project.machine_ids

View File

@ -1,5 +1,5 @@
json.projects @projects do |project|
json.extract! project, :id, :name, :description, :author_id, :licence_id, :slug
json.extract! project, :id, :name, :description, :author_id, :licence_id, :slug, :state
json.url project_url(project, format: :json)
json.project_image project.project_image.attachment.medium.url if project.project_image
json.author_id project.author_id