Changed filters to readable one. Styled some stuff
This commit is contained in:
parent
4a6596af27
commit
b9ff0c79b4
15 changed files with 96 additions and 48 deletions
|
@ -7,8 +7,10 @@ function Projects() {
|
|||
|
||||
$('.new_project, .edit_project').live('ajax:before', function() {
|
||||
$('.project_new_holder, .project_edit_holder').hide();
|
||||
$('.ajax_loader').show();
|
||||
$('.save-project-loader').show();
|
||||
});
|
||||
|
||||
$('form #project_default_branch').chosen();
|
||||
|
||||
disableButtonIfEmtpyField("#project_name", ".project-submit")
|
||||
}
|
||||
|
|
|
@ -165,11 +165,11 @@ span.update-author {
|
|||
background-color: #999;
|
||||
|
||||
&.pushed {
|
||||
background-color: #3A87AD;
|
||||
background-color: #4A97BD;
|
||||
}
|
||||
|
||||
&.opened {
|
||||
background-color: #468847;
|
||||
background-color: #469847;
|
||||
}
|
||||
|
||||
&.closed {
|
||||
|
|
|
@ -79,3 +79,14 @@
|
|||
border: 1px solid #BBB;
|
||||
}
|
||||
}
|
||||
|
||||
.save-project-loader {
|
||||
img {
|
||||
margin-top:50px;
|
||||
margin-bottom:50px;
|
||||
}
|
||||
h3 {
|
||||
@extend .page_title;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
class MergeRequestsLoad < BaseContext
|
||||
def execute
|
||||
type = params[:f].to_i
|
||||
type = params[:f]
|
||||
|
||||
merge_requests = project.merge_requests
|
||||
|
||||
merge_requests = case type
|
||||
when 1 then merge_requests
|
||||
when 2 then merge_requests.closed
|
||||
when 3 then merge_requests.opened.assigned(current_user)
|
||||
when 'all' then merge_requests
|
||||
when 'closed' then merge_requests.closed
|
||||
when 'assigned-to-me' then merge_requests.opened.assigned(current_user)
|
||||
else merge_requests.opened
|
||||
end.page(params[:page]).per(20)
|
||||
|
||||
|
|
|
@ -168,10 +168,10 @@ class IssuesController < ApplicationController
|
|||
|
||||
def issues_filter
|
||||
{
|
||||
all: "1",
|
||||
closed: "2",
|
||||
to_me: "3",
|
||||
open: "0"
|
||||
all: "all",
|
||||
closed: "closed",
|
||||
to_me: "assigned-to-me",
|
||||
open: "open"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,8 +17,8 @@ class MilestonesController < ApplicationController
|
|||
respond_to :html
|
||||
|
||||
def index
|
||||
@milestones = case params[:f].to_i
|
||||
when 1; @project.milestones
|
||||
@milestones = case params[:f]
|
||||
when 'all'; @project.milestones
|
||||
else @project.milestones.active
|
||||
end
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
= f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary"
|
||||
|
||||
%hr
|
||||
.alert.alert-info
|
||||
%h5 Advanced settings:
|
||||
.adv_settings
|
||||
%h6 Advanced settings:
|
||||
.clearfix
|
||||
= f.label :path do
|
||||
Git Clone
|
||||
|
@ -42,8 +42,9 @@
|
|||
.input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;")
|
||||
|
||||
- unless project.new_record?
|
||||
.alert.alert-info
|
||||
%h5 Features:
|
||||
%hr
|
||||
.adv_settings
|
||||
%h6 Features:
|
||||
|
||||
.clearfix
|
||||
= f.label :issues_enabled, "Issues"
|
||||
|
@ -63,7 +64,8 @@
|
|||
|
||||
- unless project.new_record?
|
||||
.actions
|
||||
= f.submit 'Save Project', class: "btn primary"
|
||||
= f.submit 'Save Project', class: "btn save-btn"
|
||||
= link_to 'Cancel', admin_projects_path, class: "btn cancel-btn"
|
||||
|
||||
|
||||
|
||||
|
|
29
app/views/admin/projects/_new_form.html.haml
Normal file
29
app/views/admin/projects/_new_form.html.haml
Normal file
|
@ -0,0 +1,29 @@
|
|||
= form_for [:admin, @admin_project] do |f|
|
||||
- if @admin_project.errors.any?
|
||||
.alert-message.block-message.error
|
||||
%span= @admin_project.errors.full_messages.first
|
||||
.clearfix.project_name_holder
|
||||
= f.label :name do
|
||||
Project name is
|
||||
.input
|
||||
= f.text_field :name, placeholder: "Example Project", class: "xxlarge"
|
||||
= f.submit 'Create project', class: "btn primary project-submit"
|
||||
|
||||
%hr
|
||||
%div.adv_settings
|
||||
%h6 Advanced settings:
|
||||
.clearfix
|
||||
= f.label :path do
|
||||
Git Clone
|
||||
.input
|
||||
.input-prepend
|
||||
%span.add-on= Gitlab.config.ssh_path
|
||||
= f.text_field :path, placeholder: "example_project", disabled: !@admin_project.new_record?
|
||||
%span.add-on= ".git"
|
||||
.clearfix
|
||||
= f.label :code do
|
||||
URL
|
||||
.input
|
||||
.input-prepend
|
||||
%span.add-on= web_app_url
|
||||
= f.text_field :code, placeholder: "example"
|
|
@ -1,3 +1,12 @@
|
|||
%h3.page_title New project
|
||||
%hr
|
||||
= render 'form', project: @admin_project
|
||||
.project_new_holder
|
||||
%h3.page_title
|
||||
New Project
|
||||
%hr
|
||||
= render 'new_form'
|
||||
%div.save-project-loader.hide
|
||||
%center
|
||||
= image_tag "ajax_loader.gif"
|
||||
%h3 Creating project & repository. Please wait a few minutes
|
||||
|
||||
:javascript
|
||||
$(function(){ new Projects(); });
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
.ui-box
|
||||
.title
|
||||
%ul.nav.nav-pills
|
||||
%li{class: ("active" if (params[:f] == "0" || !params[:f]))}
|
||||
= link_to project_merge_requests_path(@project, f: 0) do
|
||||
%li{class: ("active" if (params[:f] == 'open' || !params[:f]))}
|
||||
= link_to project_merge_requests_path(@project, f: 'open') do
|
||||
Open
|
||||
%li{class: ("active" if params[:f] == "2")}
|
||||
= link_to project_merge_requests_path(@project, f: 2) do
|
||||
%li{class: ("active" if params[:f] == "closed")}
|
||||
= link_to project_merge_requests_path(@project, f: "closed") do
|
||||
Closed
|
||||
%li{class: ("active" if params[:f] == "3")}
|
||||
= link_to project_merge_requests_path(@project, f: 3) do
|
||||
%li{class: ("active" if params[:f] == 'assigned-to-me')}
|
||||
= link_to project_merge_requests_path(@project, f: 'assigned-to-me') do
|
||||
To Me
|
||||
%li{class: ("active" if params[:f] == "1")}
|
||||
= link_to project_merge_requests_path(@project, f: 1) do
|
||||
%li{class: ("active" if params[:f] == 'all')}
|
||||
= link_to project_merge_requests_path(@project, f: 'all') do
|
||||
All
|
||||
|
||||
%ul.unstyled
|
||||
|
|
|
@ -32,17 +32,12 @@
|
|||
|
||||
.form-actions
|
||||
- if @milestone.new_record?
|
||||
= f.submit 'Create milestone', class: "primary btn"
|
||||
= f.submit 'Create milestone', class: "save-btn btn"
|
||||
= link_to "Cancel", project_milestones_path(@project), class: "btn cancel-btn"
|
||||
-else
|
||||
= f.submit 'Save changes', class: "primary btn"
|
||||
= f.submit 'Save changes', class: "save-btn btn"
|
||||
= link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn cancel-btn"
|
||||
|
||||
- if request.xhr?
|
||||
= link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn"
|
||||
- else
|
||||
- if @milestone.new_record?
|
||||
= link_to "Cancel", project_milestones_path(@project), class: "btn"
|
||||
- else
|
||||
= link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn"
|
||||
|
||||
:javascript
|
||||
$(function() {
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
%div.ui-box
|
||||
.title
|
||||
%ul.nav.nav-pills
|
||||
%li{class: ("active" if (params[:f] == "0" || !params[:f]))}
|
||||
= link_to project_milestones_path(@project, f: 0) do
|
||||
%li{class: ("active" if (params[:f] == "active" || !params[:f]))}
|
||||
= link_to project_milestones_path(@project, f: "active") do
|
||||
Active
|
||||
%li{class: ("active" if params[:f] == "1")}
|
||||
= link_to project_milestones_path(@project, f: 1) do
|
||||
%li{class: ("active" if params[:f] == "all")}
|
||||
= link_to project_milestones_path(@project, f: "all") do
|
||||
All
|
||||
|
||||
%ul.unstyled
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
Project name is
|
||||
.input
|
||||
= f.text_field :name, placeholder: "Example Project", class: "xxlarge"
|
||||
= f.submit 'Create project', class: "btn primary"
|
||||
= f.submit 'Create project', class: "btn primary project-submit"
|
||||
|
||||
%hr
|
||||
%div.adv_settings
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
New Project
|
||||
%hr
|
||||
= render 'new_form'
|
||||
%div.ajax_loader.hide
|
||||
%div.save-project-loader.hide
|
||||
%center
|
||||
%div.padded= image_tag "ajax_loader.gif"
|
||||
%h3.prepend-top Creating project & repository. Please wait a few minutes
|
||||
= image_tag "ajax_loader.gif"
|
||||
%h3 Creating project & repository. Please wait a few minutes
|
||||
|
||||
:javascript
|
||||
$(function(){ new Projects(); });
|
||||
|
|
|
@ -23,5 +23,5 @@
|
|||
= f.label :content
|
||||
.input= f.text_area :content, class: 'span8'
|
||||
.actions
|
||||
= f.submit 'Save', class: "primary btn"
|
||||
= link_to "Cancel", project_wiki_path(@project, :index), class: "btn"
|
||||
= f.submit 'Save', class: "save-btn btn"
|
||||
= link_to "Cancel", project_wiki_path(@project, :index), class: "btn cancel-btn"
|
||||
|
|
Loading…
Reference in a new issue