1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-21 12:29:03 +01:00

Merge branch 'projects' into dev

Conflicts:
	app/views/api/members/show.json.jbuilder
This commit is contained in:
Sylvain 2016-07-13 15:57:45 +02:00
commit 2c8001f38f
12 changed files with 49 additions and 42 deletions

View File

@ -74,14 +74,6 @@ class ProjectsController
##
# Changes the user's view to the projects list page
##
$scope.cancel = ->
$state.go('app.public.projects_list')
##
# For use with 'ng-class', returns the CSS class name for the uploads previews.
# The preview may show a placeholder or the content of the file depending on the upload state.

View File

@ -9,10 +9,16 @@
<div class="row no-gutter">
<div class="row m-t-md">
<a class="btn btn-lg btn-warning bg-white b-2x rounded m-t-sm upper text-sm col-lg-offset-10" ui-sref="app.logged.projects_new" role="button" translate>{{ 'add_a_project' }}</a>
</div>
<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

@ -7,7 +7,7 @@
<div class="row no-gutter">
<div class="col-xs-2 col-sm-2 col-md-1">
<section class="heading-btn">
<a ng-click="cancel()"><i class="fa fa-long-arrow-left"></i></a>
<a ng-click="backPrevLocation($event)"><i class="fa fa-long-arrow-left"></i></a>
</section>
</div>
<div class="col-xs-10 col-sm-10 col-md-7 b-l b-r-md">

View File

@ -94,10 +94,14 @@
</div>
<div class="card-block">
<h3 class="card-meta" ng-if="openlab.searchOverWholeNetwork && project.app_id != openlabAppId"><i class="fa fa-tag"></i> {{ project.app_name }}</h3>
<h3 class="card-meta" ng-if="openlab.searchOverWholeNetwork"><i class="fa fa-tag"></i> {{ project.app_name }}</h3>
<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

@ -4,7 +4,7 @@
<div class="row no-gutter">
<div class="col-xs-2 col-sm-2 col-md-1">
<section class="heading-btn">
<a ng-click="cancel()"><i class="fa fa-long-arrow-left"></i></a>
<a ng-click="backPrevLocation($event)"><i class="fa fa-long-arrow-left"></i></a>
</section>
</div>
<div class="col-xs-10 col-sm-10 col-md-8 b-l ">

View File

@ -104,6 +104,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

@ -1,3 +1,5 @@
requested_current = (current_user and current_user.id == @member.id)
json.extract! @member, :id, :uid, :username, :email, :group_id, :slug, :invoicing_disabled, :is_allow_contact
json.role @member.roles.first.name
json.name @member.profile.full_name
@ -62,33 +64,35 @@ json.machine_credits @member.machine_credits do |mc|
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|
json.extract! project, :id, :name, :description, :author_id, :licence_id, :slug
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
json.machines project.machines do |m|
json.id m.id
json.name m.name
end
json.author_id project.author_id
json.user_ids project.user_ids
json.component_ids project.component_ids
json.components project.components do |c|
json.id c.id
json.name c.name
end
json.project_users project.project_users do |pu|
json.id pu.user.id
json.first_name pu.user.profile.first_name
json.last_name pu.user.profile.last_name
json.full_name pu.user.profile.full_name
json.user_avatar do
json.id pu.user.profile.user_avatar.id
json.attachment_url pu.user.profile.user_avatar.attachment_url
end if pu.user.profile.user_avatar
json.username pu.user.username
json.is_valid pu.is_valid
json.valid_token pu.valid_token if !pu.is_valid and @member == pu.user
if requested_current || project.state == 'published'
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
json.machines project.machines do |m|
json.id m.id
json.name m.name
end
json.author_id project.author_id
json.user_ids project.user_ids
json.component_ids project.component_ids
json.components project.components do |c|
json.id c.id
json.name c.name
end
json.project_users project.project_users do |pu|
json.id pu.user.id
json.first_name pu.user.profile.first_name
json.last_name pu.user.profile.last_name
json.full_name pu.user.profile.full_name
json.user_avatar do
json.id pu.user.profile.user_avatar.id
json.attachment_url pu.user.profile.user_avatar.attachment_url
end if pu.user.profile.user_avatar
json.username pu.user.username
json.is_valid pu.is_valid
json.valid_token pu.valid_token if !pu.is_valid and @member == pu.user
end
end
end
json.events_reservations @member.reservations.where(reservable_type: 'Event').joins(:slots).order('slots.start_at asc') do |r|

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

View File

@ -125,7 +125,6 @@ en:
tooltip_openlab_projects_switch: "The search over the whole network lets you search over the projects of every Fab-manager using this feature !"
openlab_search_not_available_at_the_moment: "Search over the whole network is not available at the moment. You still can search over the projects of this platform."
project_search_result_is_empty: "Sorry, we found no results matching your search criteria."
add_a_project: "Add a project"
reset_all_filters: "Reset all filters"
search: "Search"
all_projects: "All projects"

View File

@ -125,7 +125,6 @@ fr:
tooltip_openlab_projects_switch: "La recherche sur tout le réseau vous permet de rechercher parmis les projets de tous les Fab-managers utilisant cette fonctionnalité !"
openlab_search_not_available_at_the_moment: "La recherche sur tout le réseau n'est pas disponible pour le moment. Vous pouvez cependant effectuer une recherche parmis les projets de cette plateforme."
project_search_result_is_empty: "Il n'y a pas de projets correspondant à vos critères de recherche."
add_a_project: "Ajouter un projet"
reset_all_filters: "Réinitialiser tous les filtres"
search: "Rechercher"
all_projects: "Tous les projets"

View File

@ -86,6 +86,7 @@ en:
_click_on_the_synchronization_button_opposite_: "click on the synchronization button opposite"
_disconnect_then_reconnect_: "disconnect then reconnect"
_for_your_changes_to_take_effect: "for your changes to take effect."
add_a_project: "Add a project"
messages:
you_will_lose_any_unsaved_modification_if_you_quit_this_page: "You will lose any unsaved modification if you quit this page"

View File

@ -86,6 +86,7 @@ fr:
_click_on_the_synchronization_button_opposite_: "cliquez sur le bouton de synchronisation ci-contre"
_disconnect_then_reconnect_: "déconnectez-vous puis re-connectez vous"
_for_your_changes_to_take_effect: "pour que les modifications soient prises en compte."
add_a_project: "Ajouter un projet"
messages:
you_will_lose_any_unsaved_modification_if_you_quit_this_page: "Vous perdrez les modifications non enregistrées si vous quittez cette page"