Commit Graph

251 Commits

Author SHA1 Message Date
Stan Hu 15d5dfdb33 Fix diff syntax highlighting
Refactored HTML parser to avoid duplication of newline parsing.

Closes #2235
2015-08-10 08:07:26 -07:00
Stan Hu 0abe98f049 Fix multi-line syntax highlighting
HTML span elements only apply to a single line, and in the case of multi-line
comments, the highlighting was dropped as a result. Ensure that each line has
the proper styling to fix this.

Closes #1577
2015-07-30 22:37:53 -07:00
Valery Sizov bbbcc9657f Merge branch 'fix-error-500-when-no-head' into 'master'
Fix error 500 when no HEAD is available

Steps to reproduce:

1. Create a project with a README
2. In the actual remote, type: `git symbolic-ref HEAD refs/heads/nowhere`
3. Check that HEAD is gone via `git ls-remote .`
4. Go to the projects page and see the Error 500

Error:

```
NoMethodError - undefined method `sha' for nil:NilClass:
  app/helpers/projects_helper.rb:281:in `readme_cache_key'
  app/views/projects/_readme.html.haml:10:in `_app_views_projects__readme_html_haml___2036282917939462960_70154565285700'
  actionview (4.1.11) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `instrument'
  actionview (4.1.11) lib/action_view/template.rb:339:in `instrument'
  actionview (4.1.11) lib/action_view/template.rb:143:in `render'
  rack-mini-profiler (0.9.0) lib/mini_profiler/profiling_methods.rb:108:in `block in profile_method'
  actionview (4.1.11) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
  actionview (4.1.11) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
  actionview (4.1.11) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `instrument'
  actionview (4.1.11) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionview (4.1.11) lib/action_view/renderer/partial_renderer.rb:278:in `render'
  actionview (4.1.11) lib/action_view/renderer/renderer.rb:47:in `render_partial'
  actionview (4.1.11) lib/action_view/helpers/rendering_helper.rb:35:in `render'
  haml (4.0.5) lib/haml/helpers/action_view_mods.rb:10:in `block in render_with_haml'
  haml (4.0.5) lib/haml/helpers.rb:89:in `non_haml'
  haml (4.0.5) lib/haml/helpers/action_view_mods.rb:10:in `render_with_haml'
  app/views/projects/show.html.haml:47:in `_app_views_projects_show_html_haml__1458303859692972698_70154948164180'
  actionview (4.1.11) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `block in instrument'
```

Closes https://github.com/gitlabhq/gitlabhq/issues/9484, but there may be some other issue there.

See merge request !1041
2015-07-24 20:18:14 +00:00
Stan Hu a5e8ea54ec Fix Error 500 when browsing projects with no HEAD
Steps to reproduce:
1. Create a project with a README
2. In the actual remote, type: `git symbolic-ref HEAD refs/heads/nowhere`
3. Check that HEAD is gone via `git ls-remote .`
4. Go to the projects page and see the Error 500

Closes https://github.com/gitlabhq/gitlabhq/issues/9484
2015-07-24 10:14:58 -07:00
Douwe Maan 70a3c165a9 Allow custom label to be set for authentication providers. 2015-07-23 15:20:12 +02:00
Dmitriy Zaporozhets bda04bc687 Merge branch 'fork_visibility_level' into 'master'
Forks should not have more permissive visibility levels than the original

https://dev.gitlab.org/gitlab/gitlabhq/issues/2286

See merge request !936
2015-07-10 12:05:54 +00:00
Dmitriy Zaporozhets fdbaffdc08 Merge branch 'comment-box-changes' of gitlab.com:gitlab-org/gitlab-ce 2015-07-10 13:13:02 +02:00
Darby 360ee25ddb Fixed the issues 2015-07-09 13:38:33 -07:00
Valery Sizov 111ebe5471 Fork visibility level fix 2015-07-06 17:40:33 +03:00
Darby c611b6f623 Comment box/Placeholder text redo 2015-07-01 15:49:31 -07:00
Robert Speicher 42b643f057 Fix ApplicationHelper specs
There were several specs that were failing when run by themselves.

- Use the `helper` object, as per RSpec 3 standards
- Use `assign` to assign instance variables that helpers expect
- Add `StubConfiguration` support module
2015-06-30 17:47:53 -04:00
Dmitriy Zaporozhets 88162f6970 Merge branch 'fix-relative-submodule-namespace-path' into 'master'
Fix Error 500 when relative submodule resolves to a namespace that has a different name from its path

### What does this MR do?

This MR fixes a bug in resolving a namespace when the `name` differed from `path`.

### Why was this MR needed?

The original code was using `name`, when the proper input to `namespace_project_path` was `path`.

### What are the relevant issue numbers?

Closes #1849

See merge request !864
2015-06-29 14:04:04 +00:00
Robert Speicher 09f2bec64c Prefix random Markdown tips with "Tip:" 2015-06-24 18:43:57 -04:00
Robert Speicher 82a671704d Show a random Markdown tip in the textarea placeholder 2015-06-23 21:00:10 -04:00
Stan Hu 774b7ee277 Fix Error 500 when relative submodule resolves to a namespace that has a different name from its path
Closes #1849
2015-06-23 05:49:19 -07:00
Dmitriy Zaporozhets f40b99d02e
Merge branch 'master' into rubocop-for-tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/issues_spec.rb
	spec/models/forked_project_link_spec.rb
	spec/models/hooks/service_hook_spec.rb
	spec/models/hooks/web_hook_spec.rb
	spec/models/project_services/hipchat_service_spec.rb
	spec/requests/api/project_members_spec.rb
	spec/requests/api/projects_spec.rb
	spec/requests/api/system_hooks_spec.rb
	spec/services/archive_repository_service_spec.rb
	spec/support/matchers.rb
	spec/tasks/gitlab/backup_rake_spec.rb
2015-06-23 10:44:03 +02:00
Robert Speicher 871bb2f143 Fix bad multi-line split from previous commit 2015-06-22 16:06:04 -04:00
Robert Speicher 15a05be70d Fix Style/Blocks cop violations 2015-06-22 16:00:54 -04:00
Stan Hu fe94254571 Fix avatar tests to use banana_sample.gif since SVG is not supported 2015-06-22 12:04:07 -07:00
Robert Speicher 0bb320cfda Fix Style/HashSyntax violations 2015-06-22 14:54:33 -04:00
Robert Speicher 94eff65569 Fix Style/SpaceInsideHashLiteralBraces cop violations
These fixes were performed automatically by Rubocop's `-a` flag.
2015-06-22 14:41:00 -04:00
Robert Speicher 56246b70fb Fix Style/TrailingBlankLines cop violations 2015-06-22 14:38:33 -04:00
Dmitriy Zaporozhets 595b3323a8 Merge branch 'rs-rspec3' into 'master'
RSpec3

Upgrades rspec to 3.3.0, we're now up-to-date! 🎉

See merge request !831
2015-06-22 13:15:27 +00:00
Dmitriy Zaporozhets 6c4d48b8b9
Merge branch 'rs-remove-link-to-override'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/helpers/application_helper_spec.rb
2015-06-22 12:26:41 +02:00
Robert Speicher 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Robert Speicher ff27747ec7 Fix timezone-based time_ago_with_tooltip spec failures 2015-06-19 16:49:52 -04:00
Robert Speicher 54365ecc7a Remove overridden `link_to` helper
The purpose for this override is now handled by `ExternalLinkFilter`.
2015-06-17 17:23:16 -04:00
Robert Speicher 8c8cd8be43 Update time_ago_with_tooltip helper
Minor refactoring, add specs, changes arguments to use keywords.
2015-06-17 16:37:10 -04:00
Robert Speicher d2894a39e5 Refactor dashboard_choices 2015-06-13 17:59:13 -04:00
Robert Speicher fb5271ddf1 Make the dashboard choice text match the text in the sidebar 2015-06-13 17:59:12 -04:00
Robert Speicher 1eb9a02f21 Add a form field to customize the dashboard preference 2015-06-13 17:59:11 -04:00
Robert Speicher 8112f7550b Add PreferencesHelper module
Consolidates the helpers related to user preferences.

Renames `app_theme` to `user_application_theme` to better explain what
it is.
2015-06-13 17:58:16 -04:00
Robert Speicher 5733bdb7c7 Fix link_to_gfm with only a reference having the incorrect link
Closes #1721
2015-05-29 04:46:14 -04:00
Stan Hu 0cd73885e6 Fix git blame syntax highlighting when different commits break up lines
Closes #1521
2015-05-27 14:10:58 -07:00
Robert Speicher 5a9c5520d9 Make use of to_reference in more specs 2015-05-26 15:49:22 -04:00
Robert Speicher 9bdd7f34a5 Add link_to_label helper 2015-05-21 23:40:25 -04:00
Alex Connor 3c892f3554 Disabled expansion of top/bottom blobs for new file diffs 2015-05-21 09:25:07 +02:00
Jakub Jirutka b0659c1b07 Simplify and unify helpers for rendering markup 2015-05-18 22:52:13 +02:00
Jakub Jirutka 8dbc4746fe Handle AsciiDoc better, reuse HTML pipeline filters (fixes #9263) 2015-05-18 20:48:03 +02:00
Vinnie Okada 0bfab084a8 Explain reset token expiration in emails
Tell new users when their password reset token expires and provide a
link to get a new one.
2015-05-16 14:03:07 -06:00
Douwe Maan cd52cef1c0 Fix reference links in dashboard activity and ATOM feeds. 2015-05-14 13:05:33 +02:00
Jakub Jirutka 44b82396d1 Add spec for RelativeLinkFilter 2015-05-12 02:12:47 +02:00
Dmitriy Zaporozhets 6c32abc5f7 Merge branch 'rs-task_list' into 'master'
Use task_list gem for task lists

Task Lists can now be used in comments, and they'll render in previews. 👏

Closes internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2271

See merge request !599
2015-05-08 09:39:48 +00:00
Robert Speicher 6883e6e084 Remove all references to `parse_tasks` 2015-05-06 12:58:28 -04:00
Alex Lossent affd049dc4 Improve handling of large diffs
Diffs with a large number of changed lines time out (504 HTTP error) or
generate a HTML page that's so heavy web browsers struggle with it.

https://github.com/gitlabhq/gitlabhq/pull/5014 introduced limits on
commit line count so that only a safe portion is rendered. This was
later undone by code refactoring in be5b6db8, e0eb4803 and c741fcab.
This patch re-introduces a safe limit on number of lines.
2015-05-05 18:51:12 +02:00
Robert Speicher 84a7675ea6 Remove title_for_issue helper 2015-04-30 17:27:33 -04:00
Robert Speicher fad015764c More gitlab_markdown_helper_spec cleanup 2015-04-30 16:35:26 -04:00
Robert Speicher e46d1cdd8b Add Gitlab::Markdown::SanitizationFilter
This just extends the HTML::Pipeline::SanitizationFilter with our custom
whitelist.
2015-04-30 16:35:25 -04:00
Robert Speicher 382a0aa6ef Add Gitlab::Markdown::TableOfContentsFilter
Removes header and table of contents processing from Redcarpet renderer.
2015-04-30 16:35:25 -04:00
Dmitriy Zaporozhets 9f443f4257 Merge branch 'fix-relative-submodule-links-with-personal-projects' into 'master'
Fix broken file browsing with relative submodule in personal projects

Git submodules with relative links work fine for projects in groups but not in personal projects. This patch fixes this issue.

To reproduce the problem, go here:

https://gitlab.com/andrewwu.tw/submodule-test/tree/master

Closes https://github.com/gitlabhq/gitlabhq/issues/7554

See merge request !565
2015-04-27 14:23:01 +00:00