diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index f08d14fda..95f29e862 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -251,6 +251,13 @@ $sidebar-active: #f4fcd0; max-width: none; } + form { + + .input-group-label { + height: $line-height * 2; + } + } + .menu.simple { margin-bottom: $line-height / 2; diff --git a/app/views/admin/milestones/_milestones.html.erb b/app/views/admin/milestones/_milestones.html.erb index 823e07717..1b5a4933b 100644 --- a/app/views/admin/milestones/_milestones.html.erb +++ b/app/views/admin/milestones/_milestones.html.erb @@ -1,6 +1,8 @@ -
| <%= ProgressBar.human_attribute_name("id") %> | <%= ProgressBar.human_attribute_name("kind") %> | <%= ProgressBar.human_attribute_name("title") %> | -<%= ProgressBar.human_attribute_name("percentage") %> | +<%= ProgressBar.human_attribute_name("percentage") %> | <%= t("admin.actions.actions") %> | @@ -18,32 +25,33 @@ <%= progress_bar.id %><%= ProgressBar.human_attribute_name("kind.#{progress_bar.kind}") %> | -<%= progress_bar.title %> | + <% if progress_bar.title.present? %> + <%= progress_bar.title %> + <% else %> + <%= t("admin.progress_bars.index.primary") %> + <% end %> + | +<%= number_to_percentage(progress_bar.percentage, strip_insignificant_zeros: true) %> | <%= link_to t("admin.actions.edit"), polymorphic_path([:admin, *resource_hierarchy_for(progress_bar)], action: :edit), - class: "button hollow expanded" %> + class: "button hollow" %> <%= link_to t("admin.actions.delete"), polymorphic_path([:admin, *resource_hierarchy_for(progress_bar)]), method: :delete, - class: "button hollow alert expanded" %> + class: "button hollow alert" %> | <% end %>
|---|
<%= t("admin.progress_bars.index.no_progress_bars") %>
+- <%= link_to t("admin.progress_bars.index.new_progress_bar"), - polymorphic_path([:admin, *resource_hierarchy_for(progressable.progress_bars.new)], - action: :new), - class: "button hollow" %> -
diff --git a/app/views/admin/progress_bars/index.html.erb b/app/views/admin/progress_bars/index.html.erb index ff17e5188..bcac8d7a4 100644 --- a/app/views/admin/progress_bars/index.html.erb +++ b/app/views/admin/progress_bars/index.html.erb @@ -4,4 +4,6 @@ <%= back_link_to polymorphic_path([:admin, *resource_hierarchy_for(@progressable)]) %> + + <%= render "admin/progress_bars/progress_bars", progressable: @progressable %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 76c3b7121..6f7d9d4d5 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -338,6 +338,7 @@ en: title: "Progress bars" no_progress_bars: "There are no progress bars" new_progress_bar: "Create new progress bar" + primary: "Primary progress bar" new: creating: "Create progress bar" edit: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index a8b337ca6..60a02402f 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -338,6 +338,7 @@ es: title: "Barras de progreso" no_progress_bars: "No hay barras de progreso" new_progress_bar: "Crear nueva barra de progreso" + primary: "Barra de progreso principal" new: creating: "Crear barra de progreso" edit: diff --git a/spec/shared/features/progressable.rb b/spec/shared/features/progressable.rb index 870e61825..b28c383c6 100644 --- a/spec/shared/features/progressable.rb +++ b/spec/shared/features/progressable.rb @@ -42,6 +42,7 @@ shared_examples "progressable" do |factory_name, path_name| expect(page).to have_content "Progress bar created successfully" expect(page).to have_content "43%" expect(page).to have_content "Primary" + expect(page).to have_content "Primary progress bar" end scenario "Secondary progress bar", :js do