Commit b9ff0c79 authored by randx's avatar randx

Changed filters to readable one. Styled some stuff

parent 4a6596af
...@@ -7,8 +7,10 @@ function Projects() { ...@@ -7,8 +7,10 @@ function Projects() {
$('.new_project, .edit_project').live('ajax:before', function() { $('.new_project, .edit_project').live('ajax:before', function() {
$('.project_new_holder, .project_edit_holder').hide(); $('.project_new_holder, .project_edit_holder').hide();
$('.ajax_loader').show(); $('.save-project-loader').show();
}); });
$('form #project_default_branch').chosen(); $('form #project_default_branch').chosen();
disableButtonIfEmtpyField("#project_name", ".project-submit")
} }
...@@ -165,11 +165,11 @@ span.update-author { ...@@ -165,11 +165,11 @@ span.update-author {
background-color: #999; background-color: #999;
&.pushed { &.pushed {
background-color: #3A87AD; background-color: #4A97BD;
} }
&.opened { &.opened {
background-color: #468847; background-color: #469847;
} }
&.closed { &.closed {
......
...@@ -79,3 +79,14 @@ ...@@ -79,3 +79,14 @@
border: 1px solid #BBB; border: 1px solid #BBB;
} }
} }
.save-project-loader {
img {
margin-top:50px;
margin-bottom:50px;
}
h3 {
@extend .page_title;
}
}
class MergeRequestsLoad < BaseContext class MergeRequestsLoad < BaseContext
def execute def execute
type = params[:f].to_i type = params[:f]
merge_requests = project.merge_requests merge_requests = project.merge_requests
merge_requests = case type merge_requests = case type
when 1 then merge_requests when 'all' then merge_requests
when 2 then merge_requests.closed when 'closed' then merge_requests.closed
when 3 then merge_requests.opened.assigned(current_user) when 'assigned-to-me' then merge_requests.opened.assigned(current_user)
else merge_requests.opened else merge_requests.opened
end.page(params[:page]).per(20) end.page(params[:page]).per(20)
......
...@@ -168,10 +168,10 @@ class IssuesController < ApplicationController ...@@ -168,10 +168,10 @@ class IssuesController < ApplicationController
def issues_filter def issues_filter
{ {
all: "1", all: "all",
closed: "2", closed: "closed",
to_me: "3", to_me: "assigned-to-me",
open: "0" open: "open"
} }
end end
end end
...@@ -17,8 +17,8 @@ class MilestonesController < ApplicationController ...@@ -17,8 +17,8 @@ class MilestonesController < ApplicationController
respond_to :html respond_to :html
def index def index
@milestones = case params[:f].to_i @milestones = case params[:f]
when 1; @project.milestones when 'all'; @project.milestones
else @project.milestones.active else @project.milestones.active
end end
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
= f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary" = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary"
%hr %hr
.alert.alert-info .adv_settings
%h5 Advanced settings: %h6 Advanced settings:
.clearfix .clearfix
= f.label :path do = f.label :path do
Git Clone Git Clone
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
.input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;") .input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;")
- unless project.new_record? - unless project.new_record?
.alert.alert-info %hr
%h5 Features: .adv_settings
%h6 Features:
.clearfix .clearfix
= f.label :issues_enabled, "Issues" = f.label :issues_enabled, "Issues"
...@@ -63,7 +64,8 @@ ...@@ -63,7 +64,8 @@
- unless project.new_record? - unless project.new_record?
.actions .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"
......
= 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"
%h3.page_title New project .project_new_holder
%hr %h3.page_title
= render 'form', project: @admin_project New Project
%hr
= render 'new_form'
%div.save-project-loader.hide
%center
= image_tag "ajax_loader.gif"
%h3 Creating project &amp; repository. Please wait a few minutes
:javascript
$(function(){ new Projects(); });
...@@ -10,17 +10,17 @@ ...@@ -10,17 +10,17 @@
.ui-box .ui-box
.title .title
%ul.nav.nav-pills %ul.nav.nav-pills
%li{class: ("active" if (params[:f] == "0" || !params[:f]))} %li{class: ("active" if (params[:f] == 'open' || !params[:f]))}
= link_to project_merge_requests_path(@project, f: 0) do = link_to project_merge_requests_path(@project, f: 'open') do
Open Open
%li{class: ("active" if params[:f] == "2")} %li{class: ("active" if params[:f] == "closed")}
= link_to project_merge_requests_path(@project, f: 2) do = link_to project_merge_requests_path(@project, f: "closed") do
Closed Closed
%li{class: ("active" if params[:f] == "3")} %li{class: ("active" if params[:f] == 'assigned-to-me')}
= link_to project_merge_requests_path(@project, f: 3) do = link_to project_merge_requests_path(@project, f: 'assigned-to-me') do
To Me To Me
%li{class: ("active" if params[:f] == "1")} %li{class: ("active" if params[:f] == 'all')}
= link_to project_merge_requests_path(@project, f: 1) do = link_to project_merge_requests_path(@project, f: 'all') do
All All
%ul.unstyled %ul.unstyled
......
...@@ -32,17 +32,12 @@ ...@@ -32,17 +32,12 @@
.form-actions .form-actions
- if @milestone.new_record? - 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 -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 :javascript
$(function() { $(function() {
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
%div.ui-box %div.ui-box
.title .title
%ul.nav.nav-pills %ul.nav.nav-pills
%li{class: ("active" if (params[:f] == "0" || !params[:f]))} %li{class: ("active" if (params[:f] == "active" || !params[:f]))}
= link_to project_milestones_path(@project, f: 0) do = link_to project_milestones_path(@project, f: "active") do
Active Active
%li{class: ("active" if params[:f] == "1")} %li{class: ("active" if params[:f] == "all")}
= link_to project_milestones_path(@project, f: 1) do = link_to project_milestones_path(@project, f: "all") do
All All
%ul.unstyled %ul.unstyled
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
Project name is Project name is
.input .input
= f.text_field :name, placeholder: "Example Project", class: "xxlarge" = 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 %hr
%div.adv_settings %div.adv_settings
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
New Project New Project
%hr %hr
= render 'new_form' = render 'new_form'
%div.ajax_loader.hide %div.save-project-loader.hide
%center %center
%div.padded= image_tag "ajax_loader.gif" = image_tag "ajax_loader.gif"
%h3.prepend-top Creating project &amp; repository. Please wait a few minutes %h3 Creating project &amp; repository. Please wait a few minutes
:javascript :javascript
$(function(){ new Projects(); }); $(function(){ new Projects(); });
...@@ -23,5 +23,5 @@ ...@@ -23,5 +23,5 @@
= f.label :content = f.label :content
.input= f.text_area :content, class: 'span8' .input= f.text_area :content, class: 'span8'
.actions .actions
= f.submit 'Save', class: "primary btn" = f.submit 'Save', class: "save-btn btn"
= link_to "Cancel", project_wiki_path(@project, :index), class: "btn" = link_to "Cancel", project_wiki_path(@project, :index), class: "btn cancel-btn"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment