Commit b9ff0c79b49c24dfcfc8e3188c76a861b2035770
1 parent
4a6596af
Exists in
master
and in
4 other branches
Changed filters to readable one. Styled some stuff
Showing
15 changed files
with
96 additions
and
48 deletions
Show diff stats
app/assets/javascripts/projects.js
@@ -7,8 +7,10 @@ function Projects() { | @@ -7,8 +7,10 @@ function Projects() { | ||
7 | 7 | ||
8 | $('.new_project, .edit_project').live('ajax:before', function() { | 8 | $('.new_project, .edit_project').live('ajax:before', function() { |
9 | $('.project_new_holder, .project_edit_holder').hide(); | 9 | $('.project_new_holder, .project_edit_holder').hide(); |
10 | - $('.ajax_loader').show(); | 10 | + $('.save-project-loader').show(); |
11 | }); | 11 | }); |
12 | 12 | ||
13 | $('form #project_default_branch').chosen(); | 13 | $('form #project_default_branch').chosen(); |
14 | + | ||
15 | + disableButtonIfEmtpyField("#project_name", ".project-submit") | ||
14 | } | 16 | } |
app/assets/stylesheets/common.scss
@@ -165,11 +165,11 @@ span.update-author { | @@ -165,11 +165,11 @@ span.update-author { | ||
165 | background-color: #999; | 165 | background-color: #999; |
166 | 166 | ||
167 | &.pushed { | 167 | &.pushed { |
168 | - background-color: #3A87AD; | 168 | + background-color: #4A97BD; |
169 | } | 169 | } |
170 | 170 | ||
171 | &.opened { | 171 | &.opened { |
172 | - background-color: #468847; | 172 | + background-color: #469847; |
173 | } | 173 | } |
174 | 174 | ||
175 | &.closed { | 175 | &.closed { |
app/assets/stylesheets/sections/projects.scss
app/contexts/merge_requests_load.rb
1 | class MergeRequestsLoad < BaseContext | 1 | class MergeRequestsLoad < BaseContext |
2 | def execute | 2 | def execute |
3 | - type = params[:f].to_i | 3 | + type = params[:f] |
4 | 4 | ||
5 | merge_requests = project.merge_requests | 5 | merge_requests = project.merge_requests |
6 | 6 | ||
7 | merge_requests = case type | 7 | merge_requests = case type |
8 | - when 1 then merge_requests | ||
9 | - when 2 then merge_requests.closed | ||
10 | - when 3 then merge_requests.opened.assigned(current_user) | 8 | + when 'all' then merge_requests |
9 | + when 'closed' then merge_requests.closed | ||
10 | + when 'assigned-to-me' then merge_requests.opened.assigned(current_user) | ||
11 | else merge_requests.opened | 11 | else merge_requests.opened |
12 | end.page(params[:page]).per(20) | 12 | end.page(params[:page]).per(20) |
13 | 13 |
app/controllers/issues_controller.rb
@@ -168,10 +168,10 @@ class IssuesController < ApplicationController | @@ -168,10 +168,10 @@ class IssuesController < ApplicationController | ||
168 | 168 | ||
169 | def issues_filter | 169 | def issues_filter |
170 | { | 170 | { |
171 | - all: "1", | ||
172 | - closed: "2", | ||
173 | - to_me: "3", | ||
174 | - open: "0" | 171 | + all: "all", |
172 | + closed: "closed", | ||
173 | + to_me: "assigned-to-me", | ||
174 | + open: "open" | ||
175 | } | 175 | } |
176 | end | 176 | end |
177 | end | 177 | end |
app/controllers/milestones_controller.rb
@@ -17,8 +17,8 @@ class MilestonesController < ApplicationController | @@ -17,8 +17,8 @@ class MilestonesController < ApplicationController | ||
17 | respond_to :html | 17 | respond_to :html |
18 | 18 | ||
19 | def index | 19 | def index |
20 | - @milestones = case params[:f].to_i | ||
21 | - when 1; @project.milestones | 20 | + @milestones = case params[:f] |
21 | + when 'all'; @project.milestones | ||
22 | else @project.milestones.active | 22 | else @project.milestones.active |
23 | end | 23 | end |
24 | 24 |
app/views/admin/projects/_form.html.haml
@@ -13,8 +13,8 @@ | @@ -13,8 +13,8 @@ | ||
13 | = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary" | 13 | = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary" |
14 | 14 | ||
15 | %hr | 15 | %hr |
16 | - .alert.alert-info | ||
17 | - %h5 Advanced settings: | 16 | + .adv_settings |
17 | + %h6 Advanced settings: | ||
18 | .clearfix | 18 | .clearfix |
19 | = f.label :path do | 19 | = f.label :path do |
20 | Git Clone | 20 | Git Clone |
@@ -42,8 +42,9 @@ | @@ -42,8 +42,9 @@ | ||
42 | .input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;") | 42 | .input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;") |
43 | 43 | ||
44 | - unless project.new_record? | 44 | - unless project.new_record? |
45 | - .alert.alert-info | ||
46 | - %h5 Features: | 45 | + %hr |
46 | + .adv_settings | ||
47 | + %h6 Features: | ||
47 | 48 | ||
48 | .clearfix | 49 | .clearfix |
49 | = f.label :issues_enabled, "Issues" | 50 | = f.label :issues_enabled, "Issues" |
@@ -63,7 +64,8 @@ | @@ -63,7 +64,8 @@ | ||
63 | 64 | ||
64 | - unless project.new_record? | 65 | - unless project.new_record? |
65 | .actions | 66 | .actions |
66 | - = f.submit 'Save Project', class: "btn primary" | 67 | + = f.submit 'Save Project', class: "btn save-btn" |
68 | + = link_to 'Cancel', admin_projects_path, class: "btn cancel-btn" | ||
67 | 69 | ||
68 | 70 | ||
69 | 71 |
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | += form_for [:admin, @admin_project] do |f| | ||
2 | + - if @admin_project.errors.any? | ||
3 | + .alert-message.block-message.error | ||
4 | + %span= @admin_project.errors.full_messages.first | ||
5 | + .clearfix.project_name_holder | ||
6 | + = f.label :name do | ||
7 | + Project name is | ||
8 | + .input | ||
9 | + = f.text_field :name, placeholder: "Example Project", class: "xxlarge" | ||
10 | + = f.submit 'Create project', class: "btn primary project-submit" | ||
11 | + | ||
12 | + %hr | ||
13 | + %div.adv_settings | ||
14 | + %h6 Advanced settings: | ||
15 | + .clearfix | ||
16 | + = f.label :path do | ||
17 | + Git Clone | ||
18 | + .input | ||
19 | + .input-prepend | ||
20 | + %span.add-on= Gitlab.config.ssh_path | ||
21 | + = f.text_field :path, placeholder: "example_project", disabled: !@admin_project.new_record? | ||
22 | + %span.add-on= ".git" | ||
23 | + .clearfix | ||
24 | + = f.label :code do | ||
25 | + URL | ||
26 | + .input | ||
27 | + .input-prepend | ||
28 | + %span.add-on= web_app_url | ||
29 | + = f.text_field :code, placeholder: "example" |
app/views/admin/projects/new.html.haml
1 | -%h3.page_title New project | ||
2 | -%hr | ||
3 | -= render 'form', project: @admin_project | 1 | +.project_new_holder |
2 | + %h3.page_title | ||
3 | + New Project | ||
4 | + %hr | ||
5 | + = render 'new_form' | ||
6 | +%div.save-project-loader.hide | ||
7 | + %center | ||
8 | + = image_tag "ajax_loader.gif" | ||
9 | + %h3 Creating project & repository. Please wait a few minutes | ||
10 | + | ||
11 | +:javascript | ||
12 | + $(function(){ new Projects(); }); |
app/views/merge_requests/index.html.haml
@@ -10,17 +10,17 @@ | @@ -10,17 +10,17 @@ | ||
10 | .ui-box | 10 | .ui-box |
11 | .title | 11 | .title |
12 | %ul.nav.nav-pills | 12 | %ul.nav.nav-pills |
13 | - %li{class: ("active" if (params[:f] == "0" || !params[:f]))} | ||
14 | - = link_to project_merge_requests_path(@project, f: 0) do | 13 | + %li{class: ("active" if (params[:f] == 'open' || !params[:f]))} |
14 | + = link_to project_merge_requests_path(@project, f: 'open') do | ||
15 | Open | 15 | Open |
16 | - %li{class: ("active" if params[:f] == "2")} | ||
17 | - = link_to project_merge_requests_path(@project, f: 2) do | 16 | + %li{class: ("active" if params[:f] == "closed")} |
17 | + = link_to project_merge_requests_path(@project, f: "closed") do | ||
18 | Closed | 18 | Closed |
19 | - %li{class: ("active" if params[:f] == "3")} | ||
20 | - = link_to project_merge_requests_path(@project, f: 3) do | 19 | + %li{class: ("active" if params[:f] == 'assigned-to-me')} |
20 | + = link_to project_merge_requests_path(@project, f: 'assigned-to-me') do | ||
21 | To Me | 21 | To Me |
22 | - %li{class: ("active" if params[:f] == "1")} | ||
23 | - = link_to project_merge_requests_path(@project, f: 1) do | 22 | + %li{class: ("active" if params[:f] == 'all')} |
23 | + = link_to project_merge_requests_path(@project, f: 'all') do | ||
24 | All | 24 | All |
25 | 25 | ||
26 | %ul.unstyled | 26 | %ul.unstyled |
app/views/milestones/_form.html.haml
@@ -32,17 +32,12 @@ | @@ -32,17 +32,12 @@ | ||
32 | 32 | ||
33 | .form-actions | 33 | .form-actions |
34 | - if @milestone.new_record? | 34 | - if @milestone.new_record? |
35 | - = f.submit 'Create milestone', class: "primary btn" | 35 | + = f.submit 'Create milestone', class: "save-btn btn" |
36 | + = link_to "Cancel", project_milestones_path(@project), class: "btn cancel-btn" | ||
36 | -else | 37 | -else |
37 | - = f.submit 'Save changes', class: "primary btn" | 38 | + = f.submit 'Save changes', class: "save-btn btn" |
39 | + = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn cancel-btn" | ||
38 | 40 | ||
39 | - - if request.xhr? | ||
40 | - = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn" | ||
41 | - - else | ||
42 | - - if @milestone.new_record? | ||
43 | - = link_to "Cancel", project_milestones_path(@project), class: "btn" | ||
44 | - - else | ||
45 | - = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn" | ||
46 | 41 | ||
47 | :javascript | 42 | :javascript |
48 | $(function() { | 43 | $(function() { |
app/views/milestones/index.html.haml
@@ -8,11 +8,11 @@ | @@ -8,11 +8,11 @@ | ||
8 | %div.ui-box | 8 | %div.ui-box |
9 | .title | 9 | .title |
10 | %ul.nav.nav-pills | 10 | %ul.nav.nav-pills |
11 | - %li{class: ("active" if (params[:f] == "0" || !params[:f]))} | ||
12 | - = link_to project_milestones_path(@project, f: 0) do | 11 | + %li{class: ("active" if (params[:f] == "active" || !params[:f]))} |
12 | + = link_to project_milestones_path(@project, f: "active") do | ||
13 | Active | 13 | Active |
14 | - %li{class: ("active" if params[:f] == "1")} | ||
15 | - = link_to project_milestones_path(@project, f: 1) do | 14 | + %li{class: ("active" if params[:f] == "all")} |
15 | + = link_to project_milestones_path(@project, f: "all") do | ||
16 | All | 16 | All |
17 | 17 | ||
18 | %ul.unstyled | 18 | %ul.unstyled |
app/views/projects/_new_form.html.haml
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | Project name is | 7 | Project name is |
8 | .input | 8 | .input |
9 | = f.text_field :name, placeholder: "Example Project", class: "xxlarge" | 9 | = f.text_field :name, placeholder: "Example Project", class: "xxlarge" |
10 | - = f.submit 'Create project', class: "btn primary" | 10 | + = f.submit 'Create project', class: "btn primary project-submit" |
11 | 11 | ||
12 | %hr | 12 | %hr |
13 | %div.adv_settings | 13 | %div.adv_settings |
app/views/projects/new.html.haml
@@ -3,10 +3,10 @@ | @@ -3,10 +3,10 @@ | ||
3 | New Project | 3 | New Project |
4 | %hr | 4 | %hr |
5 | = render 'new_form' | 5 | = render 'new_form' |
6 | -%div.ajax_loader.hide | 6 | +%div.save-project-loader.hide |
7 | %center | 7 | %center |
8 | - %div.padded= image_tag "ajax_loader.gif" | ||
9 | - %h3.prepend-top Creating project & repository. Please wait a few minutes | 8 | + = image_tag "ajax_loader.gif" |
9 | + %h3 Creating project & repository. Please wait a few minutes | ||
10 | 10 | ||
11 | :javascript | 11 | :javascript |
12 | $(function(){ new Projects(); }); | 12 | $(function(){ new Projects(); }); |
app/views/wikis/_form.html.haml
@@ -23,5 +23,5 @@ | @@ -23,5 +23,5 @@ | ||
23 | = f.label :content | 23 | = f.label :content |
24 | .input= f.text_area :content, class: 'span8' | 24 | .input= f.text_area :content, class: 'span8' |
25 | .actions | 25 | .actions |
26 | - = f.submit 'Save', class: "primary btn" | ||
27 | - = link_to "Cancel", project_wiki_path(@project, :index), class: "btn" | 26 | + = f.submit 'Save', class: "save-btn btn" |
27 | + = link_to "Cancel", project_wiki_path(@project, :index), class: "btn cancel-btn" |