Skip to content

Commit

Permalink
tweak projects interface/route for preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
mjy committed Jan 22, 2019
1 parent 726c0d6 commit fc2733b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
8 changes: 7 additions & 1 deletion app/controllers/tasks/projects/preferences_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
class Tasks::Projects::PreferencesController < ApplicationController
include TaskControllerConfiguration
before_action :require_administrator_sign_in
before_action :require_superuser_sign_in
before_action :can_administer_projects?

end
def index
end

end
9 changes: 7 additions & 2 deletions app/views/projects/_attributes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
<%= @project.is_api_accessible %>
</p>

<%= render partial: '/shared/data/all/show/housekeeping', locals: {object: @project} -%>



<%= render partial: '/shared/data/all/show/housekeeping', locals: {object: @project} -%>
<div class="attribute_set" data-title="Preferences">
<p>
<strong>Preferences:</strong>
<%= ap(@project.preferences).html_safe %>
</p>
</div>
22 changes: 12 additions & 10 deletions app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<%= content_for :head do -%>
<%= javascript_include_tag "https://www.gstatic.com/charts/loader.js", "chartkick" %>
<% end %>

<h1><%= @project.name -%></h1>
<%= link_to 'Edit', edit_project_path(@project) %> <br>
<%= link_to 'Customize attributes', index_preferences_task_path() %>

<div>

<div class="row1">
<div class="flexbox">
<div class="item item1">

<h2> Edit </h2>
<ul class="no_bullets list list-arrow">
<%= content_tag(:li, link_to('Edit', edit_project_path(@project)) ) %>
<%= content_tag(:li, link_to('Preferences', project_preferences_task_path, data: { turbolinks: false } ) ) %>
</ul>

<h2> Project attributes </h2>
<%= render partial: 'attributes' -%>
<div class="attributes">
<%= render partial: 'attributes' -%>
</div>

</div>

<div class="item item2">
Expand Down Expand Up @@ -62,5 +65,4 @@
</div>
</div>
</div>

</div>
9 changes: 4 additions & 5 deletions config/interface/hub/user_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,10 @@ index_print_labels_task:
- collecting_event
status: prototype
description: 'Print and manage labels.'

index_preferences_task:
hub: true
name: 'TODO: Task name'
hub: false
name: 'Project preferences'
related:
categories:
status: prototype
description: 'TODO: Task description'
status: stable
description: 'Project wide settings, accessible to project administrator.'
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@
scope :tasks do
scope :projects do
scope :preferences, controller: 'tasks/projects/preferences' do
get :index, as: 'index_preferences_task'
get :index, as: 'project_preferences_task'
end
end

Expand Down

0 comments on commit fc2733b

Please sign in to comment.